devlink: Add blackhole_nexthop trap
authorIdo Schimmel <idosch@nvidia.com>
Mon, 23 Nov 2020 07:12:28 +0000 (09:12 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 24 Nov 2020 20:14:56 +0000 (12:14 -0800)
Add a packet trap to report packets that were dropped due to a
blackhole nexthop.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/networking/devlink/devlink-trap.rst
include/net/devlink.h
net/core/devlink.c

index ef719ce..d875f3e 100644 (file)
@@ -476,6 +476,10 @@ be added to the following table:
    * - ``esp_parsing``
      - ``drop``
      - Traps packets dropped due to an error in the ESP header parsing
+   * - ``blackhole_nexthop``
+     - ``drop``
+     - Traps packets that the device decided to drop in case they hit a
+       blackhole nexthop
 
 Driver-specific Packet Traps
 ============================
index 457c537..f466819 100644 (file)
@@ -835,6 +835,7 @@ enum devlink_trap_generic_id {
        DEVLINK_TRAP_GENERIC_ID_DCCP_PARSING,
        DEVLINK_TRAP_GENERIC_ID_GTP_PARSING,
        DEVLINK_TRAP_GENERIC_ID_ESP_PARSING,
+       DEVLINK_TRAP_GENERIC_ID_BLACKHOLE_NEXTHOP,
 
        /* Add new generic trap IDs above */
        __DEVLINK_TRAP_GENERIC_ID_MAX,
@@ -1058,7 +1059,8 @@ enum devlink_trap_group_generic_id {
        "gtp_parsing"
 #define DEVLINK_TRAP_GENERIC_NAME_ESP_PARSING \
        "esp_parsing"
-
+#define DEVLINK_TRAP_GENERIC_NAME_BLACKHOLE_NEXTHOP \
+       "blackhole_nexthop"
 
 #define DEVLINK_TRAP_GROUP_GENERIC_NAME_L2_DROPS \
        "l2_drops"
index e6fb1fd..7c05e86 100644 (file)
@@ -9490,6 +9490,7 @@ static const struct devlink_trap devlink_trap_generic[] = {
        DEVLINK_TRAP(DCCP_PARSING, DROP),
        DEVLINK_TRAP(GTP_PARSING, DROP),
        DEVLINK_TRAP(ESP_PARSING, DROP),
+       DEVLINK_TRAP(BLACKHOLE_NEXTHOP, DROP),
 };
 
 #define DEVLINK_TRAP_GROUP(_id)                                                      \