mlxsw: spectrum_kvdl: Protect allocations with a lock
authorIdo Schimmel <idosch@mellanox.com>
Thu, 20 Feb 2020 07:07:46 +0000 (09:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Feb 2020 18:04:33 +0000 (10:04 -0800)
commit48fe78cebdf6592ef1750647253101f3526c5b7b
tree5972d732cac364ea2dfac1fa249bb03a06014d85
parent807ea87032c491260bbf5fe6f5c62ec9187d2e8f
mlxsw: spectrum_kvdl: Protect allocations with a lock

The KVDL is used to store objects allocated throughout various places
in the driver. For example, both nexthops (adjacency entries) and ACL
actions are stored in the KVDL.

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

Therefore, protect KVDL allocations with a lock. A mutex is used since
the free operation can block in Spectrum-2.

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_kvdl.c