From: Ido Schimmel <[email protected]>

Register with devlink the blackhole_nexthop trap so that mlxsw will be
able to report packets dropped due to a blackhole nexthop.

The internal trap identifier is "DISCARD_ROUTER3", which traps packets
dropped in the adjacency table.

Signed-off-by: Ido Schimmel <[email protected]>
Reviewed-by: Jiri Pirko <[email protected]>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c 
b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c
index 8fd7d858f3c8..4ef12e3e021a 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c
@@ -1007,6 +1007,12 @@ static const struct mlxsw_sp_trap_item 
mlxsw_sp_trap_items_arr[] = {
                                             false),
                },
        },
+       {
+               .trap = MLXSW_SP_TRAP_DROP(BLACKHOLE_NEXTHOP, L3_DROPS),
+               .listeners_arr = {
+                       MLXSW_SP_RXL_DISCARD(ROUTER3, L3_DISCARDS),
+               },
+       },
 };
 
 static struct mlxsw_sp_trap_policer_item *
-- 
2.28.0

Reply via email to