Blob Blame History Raw
From: Amit Cohen <amitc@mellanox.com>
Date: Sun, 19 Jan 2020 15:00:58 +0200
Subject: devlink: Add overlay source MAC is multicast trap
Patch-mainline: v5.6-rc1
Git-commit: c3cae4916e57d2f0364d5e7769218547fb1b7c60
References: jsc#SLE-12878

Add packet trap that can report NVE packets that the device decided to
drop because their overlay source MAC is multicast.

Signed-off-by: Amit Cohen <amitc@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 Documentation/networking/devlink/devlink-trap.rst |    4 ++++
 include/net/devlink.h                             |    3 +++
 net/core/devlink.c                                |    1 +
 3 files changed, 8 insertions(+)

--- a/Documentation/networking/devlink/devlink-trap.rst
+++ b/Documentation/networking/devlink/devlink-trap.rst
@@ -234,6 +234,10 @@ be added to the following table:
      - Traps NVE and IPinIP packets that the device decided to drop because of
        failure during decapsulation (e.g., packet being too short, reserved
        bits set in VXLAN header)
+   * - ``overlay_smac_is_mc``
+     - ``drop``
+     - Traps NVE packets that the device decided to drop because their overlay
+       source MAC is multicast
 
 Driver-specific Packet Traps
 ============================
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -593,6 +593,7 @@ enum devlink_trap_generic_id {
 	DEVLINK_TRAP_GENERIC_ID_IPV6_LPM_UNICAST_MISS,
 	DEVLINK_TRAP_GENERIC_ID_NON_ROUTABLE,
 	DEVLINK_TRAP_GENERIC_ID_DECAP_ERROR,
+	DEVLINK_TRAP_GENERIC_ID_OVERLAY_SMAC_MC,
 
 	/* Add new generic trap IDs above */
 	__DEVLINK_TRAP_GENERIC_ID_MAX,
@@ -666,6 +667,8 @@ enum devlink_trap_group_generic_id {
 	"non_routable_packet"
 #define DEVLINK_TRAP_GENERIC_NAME_DECAP_ERROR \
 	"decap_error"
+#define DEVLINK_TRAP_GENERIC_NAME_OVERLAY_SMAC_MC \
+	"overlay_smac_is_mc"
 
 #define DEVLINK_TRAP_GROUP_GENERIC_NAME_L2_DROPS \
 	"l2_drops"
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -7708,6 +7708,7 @@ static const struct devlink_trap devlink
 	DEVLINK_TRAP(IPV6_LPM_UNICAST_MISS, EXCEPTION),
 	DEVLINK_TRAP(NON_ROUTABLE, DROP),
 	DEVLINK_TRAP(DECAP_ERROR, EXCEPTION),
+	DEVLINK_TRAP(OVERLAY_SMAC_MC, DROP),
 };
 
 #define DEVLINK_TRAP_GROUP(_id)						      \