mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
[rack] Support running tcp_benchmarks with RACK.
PiperOrigin-RevId: 360491700
This commit is contained in:
@@ -91,6 +91,9 @@ while [ $# -gt 0 ]; do
|
||||
--sack)
|
||||
netstack_opts="${netstack_opts} -sack"
|
||||
;;
|
||||
--rack)
|
||||
netstack_opts="${netstack_opts} -rack"
|
||||
;;
|
||||
--cubic)
|
||||
netstack_opts="${netstack_opts} -cubic"
|
||||
;;
|
||||
@@ -150,8 +153,9 @@ while [ $# -gt 0 ]; do
|
||||
echo " --client use netstack as the client"
|
||||
echo " --ideal reset all network emulation"
|
||||
echo " --server use netstack as the server"
|
||||
echo " --mtu set the mtu (bytes)"
|
||||
echo " --mtu set the mtu (bytes)"
|
||||
echo " --sack enable SACK support"
|
||||
echo " --rack enable RACK support"
|
||||
echo " --moderate-recv-buf enable TCP receive buffer auto-tuning"
|
||||
echo " --cubic enable CUBIC congestion control for Netstack"
|
||||
echo " --duration set the test duration (s)"
|
||||
|
||||
@@ -56,6 +56,7 @@ var (
|
||||
mask = flag.Int("mask", 8, "mask size for address")
|
||||
iface = flag.String("iface", "", "network interface name to bind for netstack")
|
||||
sack = flag.Bool("sack", false, "enable SACK support for netstack")
|
||||
rack = flag.Bool("rack", false, "enable RACK in TCP")
|
||||
moderateRecvBuf = flag.Bool("moderate_recv_buf", false, "enable TCP Receive Buffer Auto-tuning")
|
||||
cubic = flag.Bool("cubic", false, "enable use of CUBIC congestion control for netstack")
|
||||
gso = flag.Int("gso", 0, "GSO maximum size")
|
||||
@@ -232,6 +233,13 @@ func newNetstackImpl(mode string) (impl, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if *rack {
|
||||
opt := tcpip.TCPRecovery(tcpip.TCPRACKLossDetection)
|
||||
if err := s.SetTransportProtocolOption(tcp.ProtocolNumber, &opt); err != nil {
|
||||
return nil, fmt.Errorf("enabling RACK failed: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Enable Receive Buffer Auto-Tuning.
|
||||
{
|
||||
opt := tcpip.TCPModerateReceiveBufferOption(*moderateRecvBuf)
|
||||
|
||||
Reference in New Issue
Block a user