History

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'.

Ido Schimmel committed 7 years ago

Commit d40e1de1 parent 5e581092 files · +196 −2Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/net_dropmon.h+3−0
@@ -87,6 +87,9 @@ enum net_dm_attr { · 86 unmodified lines
87 NET_DM_ATTR_ORIGIN, /* u16 */87 NET_DM_ATTR_ORIGIN, /* u16 */
88 NET_DM_ATTR_HW_TRAP_GROUP_NAME, /* string */88 NET_DM_ATTR_HW_TRAP_GROUP_NAME, /* string */
89 NET_DM_ATTR_HW_TRAP_NAME, /* string */89 NET_DM_ATTR_HW_TRAP_NAME, /* string */
90 NET_DM_ATTR_HW_ENTRIES, /* nested */
91 NET_DM_ATTR_HW_ENTRY, /* nested */
92 NET_DM_ATTR_HW_TRAP_COUNT, /* u32 */
90 93
91 __NET_DM_ATTR_MAX,94 __NET_DM_ATTR_MAX,
92 NET_DM_ATTR_MAX = __NET_DM_ATTR_MAX - 195 NET_DM_ATTR_MAX = __NET_DM_ATTR_MAX - 1