Skip to content

Commit 5e58109

Browse files
idoschdavem330
authored andcommitted
drop_monitor: Add support for packet alert mode for hardware drops
In a similar fashion to software drops, extend drop monitor to send netlink events when packets are dropped by the underlying hardware. The main difference is that instead of encoding the program counter (PC) from which kfree_skb() was called in the netlink message, we encode the hardware trap name. The two are mostly equivalent since they should both help the user understand why the packet was dropped. Signed-off-by: Ido Schimmel <[email protected]> Acked-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 80cebed commit 5e58109

File tree

2 files changed

+310
-4
lines changed

2 files changed

+310
-4
lines changed

include/uapi/linux/net_dropmon.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ enum net_dm_attr {
8383
NET_DM_ATTR_ORIG_LEN, /* u32 */
8484
NET_DM_ATTR_QUEUE_LEN, /* u32 */
8585
NET_DM_ATTR_STATS, /* nested */
86+
NET_DM_ATTR_HW_STATS, /* nested */
87+
NET_DM_ATTR_ORIGIN, /* u16 */
88+
NET_DM_ATTR_HW_TRAP_GROUP_NAME, /* string */
89+
NET_DM_ATTR_HW_TRAP_NAME, /* string */
8690

8791
__NET_DM_ATTR_MAX,
8892
NET_DM_ATTR_MAX = __NET_DM_ATTR_MAX - 1
@@ -101,6 +105,7 @@ enum net_dm_alert_mode {
101105

102106
enum {
103107
NET_DM_ATTR_PORT_NETDEV_IFINDEX, /* u32 */
108+
NET_DM_ATTR_PORT_NETDEV_NAME, /* string */
104109

105110
__NET_DM_ATTR_PORT_MAX,
106111
NET_DM_ATTR_PORT_MAX = __NET_DM_ATTR_PORT_MAX - 1
@@ -113,4 +118,9 @@ enum {
113118
NET_DM_ATTR_STATS_MAX = __NET_DM_ATTR_STATS_MAX - 1
114119
};
115120

121+
enum net_dm_origin {
122+
NET_DM_ORIGIN_SW,
123+
NET_DM_ORIGIN_HW,
124+
};
125+
116126
#endif

0 commit comments

Comments
 (0)