summaryrefslogtreecommitdiff
path: root/include/net/devlink.h
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2020-03-30 22:38:22 +0300
committerDavid S. Miller <davem@davemloft.net>2020-03-30 17:54:58 -0700
commitc064875a63528e8ebcefc0ae450ed0fd904d08c4 (patch)
treef9f197e37ce69b891895002bb5e209d1135f4c04 /include/net/devlink.h
parentf9f54392d2c88b34a2aaa6e51b202b3fd9c984b4 (diff)
devlink: Allow setting of packet trap group parameters
The previous patch allowed device drivers to publish their default binding between packet trap policers and packet trap groups. However, some users might not be content with this binding and would like to change it. In case user space passed a packet trap policer identifier when setting a packet trap group, invoke the appropriate device driver callback and pass the new policer identifier. v2: * Check for presence of 'DEVLINK_ATTR_TRAP_POLICER_ID' in devlink_trap_group_set() and bail if not present * Add extack error message in case trap group was partially modified Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/devlink.h')
-rw-r--r--include/net/devlink.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 63834686c8d3..8ffc1b5cd89b 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -878,6 +878,15 @@ struct devlink_ops {
int (*trap_group_init)(struct devlink *devlink,
const struct devlink_trap_group *group);
/**
+ * @trap_group_set: Trap group parameters set function.
+ *
+ * Note: @policer can be NULL when a policer is being unbound from
+ * @group.
+ */
+ int (*trap_group_set)(struct devlink *devlink,
+ const struct devlink_trap_group *group,
+ const struct devlink_trap_policer *policer);
+ /**
* @trap_policer_init: Trap policer initialization function.
*
* Should be used by device drivers to initialize the trap policer in