nhorman / dropwatch

user space utility to interface to kernel dropwatch facility
GNU General Public License v2.0
632 stars 92 forks source link

dwdump: Ignore ENOBUFS errors on data socket #44

Closed idosch closed 3 years ago

idosch commented 3 years ago

The dwdump utility opens two netlink sockets, for control and data messages. The latter can be easily overwhelmed if packets are dropped at a high rate, resulting in ENOBUFS errors upon receive.

The dwdump utility correctly ignores such errors, but the situation can be improved by instructing the kernel not to emit such errors in the first place. This avoids the "go up, go down" effect described in kernel commit 38938bfe3489 ("netlink: add NETLINK_NO_ENOBUFS socket flag").

Achieve this by setting the NETLINK_NO_ENOBUFS socket option on the data socket.

Signed-off-by: Ido Schimmel idosch@nvidia.com