]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit0fe802fd8fec3d9eda0d61f31e143ce106b958c4
tree5972d732cac364ea2dfac1fa249bb03a06014d85
parenteef5f3ca47becfd89ed5bf548ce4cd095f5e5992
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