summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/loader.go
diff options
context:
space:
mode:
authorBhasker Hariharan <bhaskerh@google.com>2019-06-14 07:30:30 -0700
committerShentubot <shentubot@google.com>2019-06-14 07:31:45 -0700
commita8608c501b23f89ac3df50cde7428cb3c4b56145 (patch)
tree7d0b9ddb9c659260afce3324ce6864e736c370e6 /runsc/boot/loader.go
parent3d71c627fa03a2da694ec88d690c633a15951fb0 (diff)
Enable Receive Buffer Auto-Tuning for runsc.
Updates #230 PiperOrigin-RevId: 253225078
Diffstat (limited to 'runsc/boot/loader.go')
-rw-r--r--runsc/boot/loader.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go
index 53e61e43d..41027416d 100644
--- a/runsc/boot/loader.go
+++ b/runsc/boot/loader.go
@@ -847,9 +847,17 @@ func newEmptyNetworkStack(conf *Config, clock tcpip.Clock) (inet.Stack, error) {
// privileges.
Raw: true,
})}
+
+ // Enable SACK Recovery.
if err := s.Stack.SetTransportProtocolOption(tcp.ProtocolNumber, tcp.SACKEnabled(true)); err != nil {
return nil, fmt.Errorf("failed to enable SACK: %v", err)
}
+
+ // Enable Receive Buffer Auto-Tuning.
+ if err := s.Stack.SetTransportProtocolOption(tcp.ProtocolNumber, tcpip.ModerateReceiveBufferOption(true)); err != nil {
+ return nil, fmt.Errorf("SetTransportProtocolOption failed: %v", err)
+ }
+
return &s, nil
default: