aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2020-03-30 22:38:21 +0300
committerDavid S. Miller <davem@davemloft.net>2020-03-30 17:54:58 -0700
commitf9f54392d2c88b34a2aaa6e51b202b3fd9c984b4 (patch)
tree03d51c26f0a1dd1b9265f1677fba4d9493376fe1 /drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c
parentnetdevsim: Add devlink-trap policer support (diff)
downloadwireguard-linux-f9f54392d2c88b34a2aaa6e51b202b3fd9c984b4.tar.xz
wireguard-linux-f9f54392d2c88b34a2aaa6e51b202b3fd9c984b4.zip
devlink: Add packet trap group parameters support
Packet trap groups are used to aggregate logically related packet traps. Currently, these groups allow user space to batch operations such as setting the trap action of all member traps. In order to prevent the CPU from being overwhelmed by too many trapped packets, it is desirable to bind a packet trap policer to these groups. For example, to limit all the packets that encountered an exception during routing to 10Kpps. Allow device drivers to bind default packet trap policers to packet trap groups when the latter are registered with devlink. The next patch will enable user space to change this default binding. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c
index 727f6ef243df..24f15345ba84 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c
@@ -166,10 +166,10 @@ static void mlxsw_sp_rx_exception_listener(struct sk_buff *skb, u8 local_port,
_action, false, SP_##_group_id, SET_FW_DEFAULT)
static const struct devlink_trap_group mlxsw_sp_trap_groups_arr[] = {
- DEVLINK_TRAP_GROUP_GENERIC(L2_DROPS),
- DEVLINK_TRAP_GROUP_GENERIC(L3_DROPS),
- DEVLINK_TRAP_GROUP_GENERIC(TUNNEL_DROPS),
- DEVLINK_TRAP_GROUP_GENERIC(ACL_DROPS),
+ DEVLINK_TRAP_GROUP_GENERIC(L2_DROPS, 0),
+ DEVLINK_TRAP_GROUP_GENERIC(L3_DROPS, 0),
+ DEVLINK_TRAP_GROUP_GENERIC(TUNNEL_DROPS, 0),
+ DEVLINK_TRAP_GROUP_GENERIC(ACL_DROPS, 0),
};
static const struct devlink_trap mlxsw_sp_traps_arr[] = {