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>
This commit is contained in:

committed by
David S. Miller

parent
5e58109b1e
commit
d40e1deb93
@@ -87,6 +87,9 @@ enum net_dm_attr {
|
||||
NET_DM_ATTR_ORIGIN, /* u16 */
|
||||
NET_DM_ATTR_HW_TRAP_GROUP_NAME, /* string */
|
||||
NET_DM_ATTR_HW_TRAP_NAME, /* string */
|
||||
NET_DM_ATTR_HW_ENTRIES, /* nested */
|
||||
NET_DM_ATTR_HW_ENTRY, /* nested */
|
||||
NET_DM_ATTR_HW_TRAP_COUNT, /* u32 */
|
||||
|
||||
__NET_DM_ATTR_MAX,
|
||||
NET_DM_ATTR_MAX = __NET_DM_ATTR_MAX - 1
|
||||
|
Reference in New Issue
Block a user