Set TCPTotalHeaderMaximumSize to 160.

Adding extra padding to this value seems to improve performance on gVNIC
hardware. When TCPTotalHeaderMaximumSize is <140, 10MB PUT commands start
randomly taking 10x as long as they normally do.

Fixes #9816

PiperOrigin-RevId: 598024702
This commit is contained in:
Lucas Manning
2024-01-12 18:56:38 -08:00
committed by gVisor bot
parent 21f697000c
commit c7c534826e
+7 -3
View File
@@ -217,9 +217,13 @@ const (
TCPHeaderMaximumSize = TCPMinimumSize + TCPOptionsMaximumSize
// TCPTotalHeaderMaximumSize is the maximum size of headers from all layers in
// a TCP packet. This will need to be updated if we decide to support more
// layer 2 protocols or features like IP tunneling.
TCPTotalHeaderMaximumSize = TCPHeaderMaximumSize + IPv4MaximumHeaderSize + EthernetMaximumSize
// a TCP packet. It analogous to MAX_TCP_HEADER in Linux.
//
// TODO(b/319936470): Investigate why this needs to be at least 140 bytes. In
// Linux this value is at least 160, but in theory we should be able to use
// 138. In practice anything less than 140 starts to break GSO on gVNIC
// hardware.
TCPTotalHeaderMaximumSize = 160
// TCPProtocolNumber is TCP's transport protocol number.
TCPProtocolNumber tcpip.TransportProtocolNumber = 6