Commit 13c056ec7d006b11557cebd9f1803edd646d2876

Authored by Amit Cohen
Committed by David S. Miller
1 parent f528dfc460

devlink: Add tunnel generic packet traps

Add packet traps that can report packets that were dropped during tunnel
decapsulation.

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>

Showing 3 changed files with 16 additions and 0 deletions Side-by-side Diff

Documentation/networking/devlink/devlink-trap.rst
... ... @@ -229,6 +229,11 @@
229 229 supposed to be routed. For example, IGMP queries can be flooded by the
230 230 device in layer 2 and reach the router. Such packets should not be
231 231 routed and instead dropped
  232 + * - ``decap_error``
  233 + - ``exception``
  234 + - Traps NVE and IPinIP packets that the device decided to drop because of
  235 + failure during decapsulation (e.g., packet being too short, reserved
  236 + bits set in VXLAN header)
232 237  
233 238 Driver-specific Packet Traps
234 239 ============================
... ... @@ -265,6 +270,9 @@
265 270 * - ``buffer_drops``
266 271 - Contains packet traps for packets that were dropped by the device due to
267 272 an enqueue decision
  273 + * - ``tunnel_drops``
  274 + - Contains packet traps for packets that were dropped by the device during
  275 + tunnel encapsulation / decapsulation
268 276  
269 277 Testing
270 278 =======
include/net/devlink.h
... ... @@ -592,6 +592,7 @@
592 592 DEVLINK_TRAP_GENERIC_ID_IPV4_LPM_UNICAST_MISS,
593 593 DEVLINK_TRAP_GENERIC_ID_IPV6_LPM_UNICAST_MISS,
594 594 DEVLINK_TRAP_GENERIC_ID_NON_ROUTABLE,
  595 + DEVLINK_TRAP_GENERIC_ID_DECAP_ERROR,
595 596  
596 597 /* Add new generic trap IDs above */
597 598 __DEVLINK_TRAP_GENERIC_ID_MAX,
... ... @@ -605,6 +606,7 @@
605 606 DEVLINK_TRAP_GROUP_GENERIC_ID_L2_DROPS,
606 607 DEVLINK_TRAP_GROUP_GENERIC_ID_L3_DROPS,
607 608 DEVLINK_TRAP_GROUP_GENERIC_ID_BUFFER_DROPS,
  609 + DEVLINK_TRAP_GROUP_GENERIC_ID_TUNNEL_DROPS,
608 610  
609 611 /* Add new generic trap group IDs above */
610 612 __DEVLINK_TRAP_GROUP_GENERIC_ID_MAX,
... ... @@ -662,6 +664,8 @@
662 664 "ipv6_lpm_miss"
663 665 #define DEVLINK_TRAP_GENERIC_NAME_NON_ROUTABLE \
664 666 "non_routable_packet"
  667 +#define DEVLINK_TRAP_GENERIC_NAME_DECAP_ERROR \
  668 + "decap_error"
665 669  
666 670 #define DEVLINK_TRAP_GROUP_GENERIC_NAME_L2_DROPS \
667 671 "l2_drops"
... ... @@ -669,6 +673,8 @@
669 673 "l3_drops"
670 674 #define DEVLINK_TRAP_GROUP_GENERIC_NAME_BUFFER_DROPS \
671 675 "buffer_drops"
  676 +#define DEVLINK_TRAP_GROUP_GENERIC_NAME_TUNNEL_DROPS \
  677 + "tunnel_drops"
672 678  
673 679 #define DEVLINK_TRAP_GENERIC(_type, _init_action, _id, _group, _metadata_cap) \
674 680 { \
... ... @@ -7707,6 +7707,7 @@
7707 7707 DEVLINK_TRAP(IPV4_LPM_UNICAST_MISS, EXCEPTION),
7708 7708 DEVLINK_TRAP(IPV6_LPM_UNICAST_MISS, EXCEPTION),
7709 7709 DEVLINK_TRAP(NON_ROUTABLE, DROP),
  7710 + DEVLINK_TRAP(DECAP_ERROR, EXCEPTION),
7710 7711 };
7711 7712  
7712 7713 #define DEVLINK_TRAP_GROUP(_id) \
... ... @@ -7719,6 +7720,7 @@
7719 7720 DEVLINK_TRAP_GROUP(L2_DROPS),
7720 7721 DEVLINK_TRAP_GROUP(L3_DROPS),
7721 7722 DEVLINK_TRAP_GROUP(BUFFER_DROPS),
  7723 + DEVLINK_TRAP_GROUP(TUNNEL_DROPS),
7722 7724 };
7723 7725  
7724 7726 static int devlink_trap_generic_verify(const struct devlink_trap *trap)