Skip to content

mlxsw: Preparation for RTNL removal

Ido Schimmel netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest15 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15mlxsw: spectrum_kvdl: Protect allocations with a lockdrivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c+14 -20 replies
2/15mlxsw: spectrum: Protect counter pool with a lockdrivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c+20 -50 replies
3/15mlxsw: spectrum_span: Do no expose mirroring agents to entire driverdrivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c+46 -320 replies
4/15mlxsw: spectrum_span: Use struct_size() to simplify allocationdrivers/net/ethernet/mellanox/mlxsw/spectrum_span.c+5 -180 replies
5/15mlxsw: spectrum_span: Prepare work item to update mirroring agentsdrivers/net/ethernet/mellanox/mlxsw/spectrum_span.c+38 -00 replies
6/15mlxsw: spectrum: Convert callers to use new mirroring APIdrivers/net/ethernet/mellanox/mlxsw/spectrum_span.c drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c+7 -560 replies
7/15mlxsw: spectrum_span: Only update mirroring agents if presentdrivers/net/ethernet/mellanox/mlxsw/spectrum_span.c+10 -100 replies
8/15mlxsw: spectrum_router: Do not assume RTNL is taken during nexthop initdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+6 -20 replies
9/15mlxsw: spectrum_router: Do not assume RTNL is taken during RIF teardowndrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+3 -10 replies
10/15mlxsw: spectrum_router: Do not assume RTNL is taken when resolving underlay devicedrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+29 -100 replies
11/15mlxsw: spectrum_router: Prepare function for router lock introductiondrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+9 -30 replies
12/15mlxsw: spectrum_router: Prepare function for router lock introductiondrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+9 -30 replies
13/15mlxsw: spectrum: Prevent RIF access outside of routing codedrivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c+24 -120 replies
14/15mlxsw: spectrum: Export function to check if RIF existsdrivers/net/ethernet/mellanox/mlxsw/spectrum.c drivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+16 -70 replies
15/15mlxsw: spectrum_nve: Make tunnel initialization symmetricdrivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c+3 -20 replies

Reviews trailers per patch

All 15 patches have a Reviewed-by or Acked-by.

PatchJiri Pirko
1/15A-b
2/15A-b
3/15A-b
4/15A-b
5/15A-b
6/15A-b
7/15A-b
8/15A-b
9/15A-b
10/15A-b
11/15A-b
12/15A-b
13/15A-b
14/15A-b
15/15A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 00/15] mlxsw: Preparation for RTNL removal

From: Ido Schimmel <[email protected]>

The driver currently acquires RTNL in its route insertion path, which contributes to very large control plane latencies. This patch set prepares mlxsw for RTNL removal from its route insertion path in a follow-up patch set.

Patches #1-#2 protect shared resources - KVDL and counter pool - with their own locks. All allocations of these resources are currently performed under RTNL, so no locks were required.

Patches #3-#7 ensure that updates to mirroring sessions only take place in case there are active mirroring sessions. This allows us to avoid taking RTNL when it is unnecessary, as updating of the mirroring sessions must be performed under RTNL for the time being.

Patches #8-#10 replace the use of APIs that assume that RTNL is taken with their RCU counterparts. Specifically, patches #8 and #9 replace __in_dev_get_rtnl() with __in_dev_get_rcu() under RCU read-side critical section. Patch #10 replaces __dev_get_by_index() with dev_get_by_index_rcu().

Patches #11-#15 perform small adjustments in the code to make it easier to later introduce a router lock instead of relying on RTNL.

Ido Schimmel (15):
mlxsw: spectrum_kvdl: Protect allocations with a lock
mlxsw: spectrum: Protect counter pool with a lock
mlxsw: spectrum_span: Do no expose mirroring agents to entire driver
mlxsw: spectrum_span: Use struct_size() to simplify allocation
mlxsw: spectrum_span: Prepare work item to update mirroring agents
mlxsw: spectrum: Convert callers to use new mirroring API
mlxsw: spectrum_span: Only update mirroring agents if present
mlxsw: spectrum_router: Do not assume RTNL is taken during nexthop
init
mlxsw: spectrum_router: Do not assume RTNL is taken during RIF
teardown
mlxsw: spectrum_router: Do not assume RTNL is taken when resolving
underlay device
mlxsw: spectrum_router: Prepare function for router lock introduction
mlxsw: spectrum_router: Prepare function for router lock introduction
mlxsw: spectrum: Prevent RIF access outside of routing code
mlxsw: spectrum: Export function to check if RIF exists
mlxsw: spectrum_nve: Make tunnel initialization symmetric

 .../net/ethernet/mellanox/mlxsw/spectrum.c    |   8 +-
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |  12 +-
 .../ethernet/mellanox/mlxsw/spectrum_cnt.c    |  25 +++-
 .../ethernet/mellanox/mlxsw/spectrum_kvdl.c   |  16 ++-
 .../ethernet/mellanox/mlxsw/spectrum_nve.c    |   5 +-
 .../ethernet/mellanox/mlxsw/spectrum_router.c | 112 ++++++++++++++----
 .../ethernet/mellanox/mlxsw/spectrum_span.c   | 102 ++++++++++------
 .../mellanox/mlxsw/spectrum_switchdev.c       |  42 +------
 8 files changed, 199 insertions(+), 123 deletions(-)
Signature · 1 line
2.24.1