mlxsw: spectrum: Protect counter pool with a lock
authorIdo Schimmel <idosch@mellanox.com>
Thu, 20 Feb 2020 07:07:47 +0000 (09:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Feb 2020 18:04:33 +0000 (10:04 -0800)
commit6c5a688e7544ff1355bd89097f93ec6013bf6492
tree283f9f140f8419f0ac024f8e5d731c471e9bc185
parent48fe78cebdf6592ef1750647253101f3526c5b7b
mlxsw: spectrum: Protect counter pool with a lock

The counter pool is a shared resource. It is used by both the ACL code
to allocate counters for actions and by the routing code to allocate
counters for adjacency entries (for example).

Currently, all allocations are protected by RTNL, but this is going to
change with the removal of RTNL from the routing code.

Therefore, protect counter allocations with a spin lock.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c