mlxsw: spectrum: Add devlink-trap support
authorIdo Schimmel <idosch@mellanox.com>
Wed, 21 Aug 2019 07:19:35 +0000 (10:19 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Aug 2019 19:58:39 +0000 (12:58 -0700)
commitb5ce611fd96e18711d1b580170676fba9cafe258
treec2d509cd6028619e4660aeb4811f1e49c1df56d3
parent9e6290c75a5078d0a8fac89d908dc59db9c27a15
mlxsw: spectrum: Add devlink-trap support

Register supported packet traps (layer 2 drops only, currently) and
associated trap group with devlink during driver initialization.

The amount of traffic generated by these packet drop traps is capped at
10Kpps to ensure the CPU is not overwhelmed by incoming packets.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/Makefile
drivers/net/ethernet/mellanox/mlxsw/core.c
drivers/net/ethernet/mellanox/mlxsw/core.h
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c [new file with mode: 0644]