drop_monitor: remove quadratic behavior
authorEric Dumazet <edumazet@google.com>
Tue, 22 Feb 2022 22:04:50 +0000 (14:04 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Feb 2022 12:39:58 +0000 (12:39 +0000)
commitb26ef81c46ed15d11ddddba9ba1cd52c749385ad
treec83074fe901a74cab6bb8bd438da0b325763cdd0
parent503310a5d4b265ed45158527f0f38309ced94df3
drop_monitor: remove quadratic behavior

drop_monitor is using an unique list on which all netdevices in
the host have an element, regardless of their netns.

This scales poorly, not only at device unregister time (what I
caught during my netns dismantle stress tests), but also at packet
processing time whenever trace_napi_poll_hit() is called.

If the intent was to avoid adding one pointer in 'struct net_device'
then surely we prefer O(1) behavior.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
net/core/drop_monitor.c