diff options
author | Ido Schimmel <idosch@mellanox.com> | 2020-03-30 21:38:22 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-31 02:54:58 +0200 |
commit | c064875a63528e8ebcefc0ae450ed0fd904d08c4 (patch) | |
tree | f9f197e37ce69b891895002bb5e209d1135f4c04 /include/net | |
parent | devlink: Add packet trap group parameters support (diff) | |
download | linux-c064875a63528e8ebcefc0ae450ed0fd904d08c4.tar.xz linux-c064875a63528e8ebcefc0ae450ed0fd904d08c4.zip |
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')
-rw-r--r-- | include/net/devlink.h | 9 |
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 |