]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Track used packet trap policer IDs
authorIdo Schimmel <idosch@mellanox.com>
Mon, 30 Mar 2020 19:38:26 +0000 (22:38 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Mar 2020 00:54:59 +0000 (17:54 -0700)
commit595014e2c7b4b1b3ebf7c74e2c15b351ec22210b
treeaae47657c9bc8797f53cb9a2b5e6495bd3df639b
parentd2f8c437b4fd18ecb8f59281c4891039c839cb21
mlxsw: spectrum: Track used packet trap policer IDs

During initialization the driver configures various packet trap groups
and binds policers to them.

Currently, most of these groups are not exposed to user space and
therefore their policers should not be exposed as well. Otherwise, user
space will be able to alter policer parameters without knowing which
packet traps are policed by the policer.

Use a bitmap to track the used policer IDs so that these policers will
not be registered with devlink in a subsequent patch.

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