OSDN Git Service

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)
commit03484e49e7ccc407f4d27c3233956c364591961f
treeaae47657c9bc8797f53cb9a2b5e6495bd3df639b
parent2b84d7c3f6ccbb77021f36129ff59cc38896b226
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]