From f9f54392d2c88b34a2aaa6e51b202b3fd9c984b4 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Mon, 30 Mar 2020 22:38:21 +0300 Subject: 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 Reviewed-by: Jiri Pirko Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller --- drivers/net/netdevsim/dev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/net/netdevsim') diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c index 21341e592467..bda603cfe66a 100644 --- a/drivers/net/netdevsim/dev.c +++ b/drivers/net/netdevsim/dev.c @@ -452,10 +452,10 @@ static const struct devlink_trap_policer nsim_trap_policers_arr[] = { }; static const struct devlink_trap_group nsim_trap_groups_arr[] = { - DEVLINK_TRAP_GROUP_GENERIC(L2_DROPS), - DEVLINK_TRAP_GROUP_GENERIC(L3_DROPS), - DEVLINK_TRAP_GROUP_GENERIC(BUFFER_DROPS), - DEVLINK_TRAP_GROUP_GENERIC(ACL_DROPS), + DEVLINK_TRAP_GROUP_GENERIC(L2_DROPS, 0), + DEVLINK_TRAP_GROUP_GENERIC(L3_DROPS, 1), + DEVLINK_TRAP_GROUP_GENERIC(BUFFER_DROPS, 2), + DEVLINK_TRAP_GROUP_GENERIC(ACL_DROPS, 3), }; static const struct devlink_trap nsim_traps_arr[] = { -- cgit v1.2.3-59-g8ed1b