[rack] Support running tcp_benchmarks with RACK.

PiperOrigin-RevId: 360491700
This commit is contained in:
Ayush Ranjan
2021-03-02 12:43:35 -08:00
committed by gVisor bot
parent 6bc27946a6
commit a317174673
2 changed files with 13 additions and 1 deletions
+5 -1
View File
@@ -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)"
+8
View File
@@ -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)