You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
datapath: Increase the devices controller's netlink receive buffer
The devices controller subscribes to address, route, link and neighbor
updates on netlink sockets with the kernel default receive buffer. Under
high churn that buffer overflows with ENOBUFS, and any one socket erroring
restarts all four subscriptions.
Size all four explicitly: 4MiB by default, configurable with the new
--netlink-buffer-size flag.
Signed-off-by: Jared Ledvina <jared.ledvina@datadoghq.com>
flags.StringSlice(option.Devices, []string{}, "List of devices facing cluster/external network (used for BPF NodePort, BPF masquerading and host firewall); supports '+' as wildcard in device name, e.g. 'eth+'; support '!' to exclude devices, e.g. '!eth+' excludes any device with prefix 'eth'. Note '!' says nothing about which ones to include. A device must match other criteria to be selected; The filters are matched in order and whatever matched first wins.")
67
69
68
70
flags.Bool(option.ForceDeviceDetection, false, "Forces the auto-detection of devices, even if specific devices are explicitly listed")
71
+
72
+
flags.Int(option.NetlinkBufferSize, defaults.NetlinkBufferSize, "Size (in bytes) of the netlink socket receive buffer used by the devices controller's address, route, link and neighbor subscriptions; a larger buffer reduces the chance of ENOBUFS errors and subscription restarts under high churn")
69
73
}
70
74
71
75
var (
@@ -93,6 +97,9 @@ type DevicesConfig struct {
93
97
// ForceDeviceDetection forces the auto-detection of devices,
94
98
// even if user-specific devices are explicitly listed.
95
99
ForceDeviceDetectionbool
100
+
// NetlinkBufferSize is the receive buffer size in bytes requested for
101
+
// the controller's netlink subscription sockets.
102
+
NetlinkBufferSizeint
96
103
}
97
104
98
105
typedevicesControllerParamsstruct {
@@ -141,7 +148,7 @@ func newDevicesController(lc cell.Lifecycle, p devicesControllerParams) (*device
log.Warn("Failed to force the netlink receive buffer (SO_RCVBUFFORCE requires CAP_NET_ADMIN); falling back to the kernel default. Netlink updates may be dropped under high churn.",
772
+
logfields.Error, err,
773
+
logfields.BufferSize, bufferSize,
774
+
)
775
+
returnsubscribe(options(0))
776
+
}
777
+
744
778
// makeNetlinkFuncs returns a *netlinkFuncs containing netlink accessors to the
745
779
// network namespace of the calling goroutine's OS thread.
0 commit comments