Skip to content

Commit

Permalink
drop_monitor: Add support for packet alert mode for hardware drops
Browse files Browse the repository at this point in the history
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 <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ido Schimmel authored and David S. Miller committed Aug 17, 2019
1 parent 80cebed commit 5e58109
Show file tree
Hide file tree
Showing 2 changed files with 310 additions and 4 deletions.
10 changes: 10 additions & 0 deletions include/uapi/linux/net_dropmon.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ enum net_dm_attr {
NET_DM_ATTR_ORIG_LEN, /* u32 */
NET_DM_ATTR_QUEUE_LEN, /* u32 */
NET_DM_ATTR_STATS, /* nested */
NET_DM_ATTR_HW_STATS, /* nested */
NET_DM_ATTR_ORIGIN, /* u16 */
NET_DM_ATTR_HW_TRAP_GROUP_NAME, /* string */
NET_DM_ATTR_HW_TRAP_NAME, /* string */

__NET_DM_ATTR_MAX,
NET_DM_ATTR_MAX = __NET_DM_ATTR_MAX - 1
Expand All @@ -101,6 +105,7 @@ enum net_dm_alert_mode {

enum {
NET_DM_ATTR_PORT_NETDEV_IFINDEX, /* u32 */
NET_DM_ATTR_PORT_NETDEV_NAME, /* string */

__NET_DM_ATTR_PORT_MAX,
NET_DM_ATTR_PORT_MAX = __NET_DM_ATTR_PORT_MAX - 1
Expand All @@ -113,4 +118,9 @@ enum {
NET_DM_ATTR_STATS_MAX = __NET_DM_ATTR_STATS_MAX - 1
};

enum net_dm_origin {
NET_DM_ORIGIN_SW,
NET_DM_ORIGIN_HW,
};

#endif
Loading

0 comments on commit 5e58109

Please sign in to comment.