]> git.baikalelectronics.ru Git - kernel.git/commit
drop_monitor: Add support for summary alert mode for hardware drops
authorIdo Schimmel <idosch@mellanox.com>
Sat, 17 Aug 2019 13:28:15 +0000 (16:28 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 17 Aug 2019 19:40:08 +0000 (12:40 -0700)
commit335c66551a9d68aae600258827d598f366fe4ca8
treedee0f882ee543de9150e1ec2bc611c114c89b6cb
parent5bcca770f478719d21c79c854d1a8f588ec651cf
drop_monitor: Add support for summary alert mode for hardware drops

In summary alert mode a notification is sent with a list of recent drop
reasons and a count of how many packets were dropped due to this reason.

To avoid expensive operations in the context in which packets are
dropped, each CPU holds an array whose number of entries is the maximum
number of drop reasons that can be encoded in the netlink notification.
Each entry stores the drop reason and a count. When a packet is dropped
the array is traversed and a new entry is created or the count of an
existing entry is incremented.

Later, in process context, the array is replaced with a newly allocated
copy and the old array is encoded in a netlink notification. To avoid
breaking user space, the notification includes the ancillary header,
which is 'struct net_dm_alert_msg' with number of entries set to '0'.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/net_dropmon.h
net/core/drop_monitor.c