]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit49e46597bc6444f48f892418bc7da7c6defc92bd
tree283f9f140f8419f0ac024f8e5d731c471e9bc185
parent0fe802fd8fec3d9eda0d61f31e143ce106b958c4
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