summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2020-05-29 21:36:40 +0300
committerDavid S. Miller <davem@davemloft.net>2020-06-01 11:49:23 -0700
commit30a4e9a29ab9aadfe6c5386ae4aa396b1d2556c2 (patch)
tree87f5fd2b34514fd7ef932ab419bcebe4320329fd /net
parent9eefeabed6f831018c15bd7e17d34967ee34d9dd (diff)
downloadlinux-30a4e9a29ab9aadfe6c5386ae4aa396b1d2556c2.tar.gz
linux-30a4e9a29ab9aadfe6c5386ae4aa396b1d2556c2.tar.xz
devlink: Add 'control' trap type
This type is used for traps that trap control packets such as ARP request and IGMP query to the CPU. Do not report such packets to the kernel's drop monitor as they were not dropped by the device no encountered an exception during forwarding. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/devlink.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c
index d6298917b077..47c28e0f848f 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -8847,6 +8847,13 @@ void devlink_trap_report(struct devlink *devlink, struct sk_buff *skb,
devlink_trap_stats_update(trap_item->stats, skb->len);
devlink_trap_stats_update(trap_item->group_item->stats, skb->len);
+ /* Control packets were not dropped by the device or encountered an
+ * exception during forwarding and therefore should not be reported to
+ * the kernel's drop monitor.
+ */
+ if (trap_item->trap->type == DEVLINK_TRAP_TYPE_CONTROL)
+ return;
+
devlink_trap_report_metadata_fill(&hw_metadata, trap_item,
in_devlink_port, fa_cookie);
net_dm_hw_report(skb, &hw_metadata);