Skip to content

geneve: make geneve_fill_info() RTNL-less

Eric Dumazet netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyApplied 3/3
  2. v12 patches 3 repliesSuperseded

Patches in v2 All 3 applied

#Subject and filesSizeRepliesApplied
1/3geneve: pass geneve_config pointer to helper functionsdrivers/net/geneve.c+76 -641 replyApplied
2/3geneve: convert config to RCU-protected pointerdrivers/net/geneve.c+118 -950 repliesApplied
3/3geneve: make geneve_fill_info() RTNL independentdrivers/net/geneve.c+24 -110 repliesApplied

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchKuniyuki Iwashima
1/3
2/3
3/3R-b

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

Read the v2 thread

Cover letter [PATCH v2 net-next 0/3] geneve: make geneve_fill_info() RTNL-less

This series makes geneve_fill_info() independent of the RTNL lock by converting the device configuration to an RCU-protected pointer.

Historically, geneve_changelink() updated the device configuration by copying the new configuration over the old one using memcpy() under RTNL.

To prevent the transmit/receive data paths from reading torn values during the copy, geneve_quiesce() was used to pause the data path and wait for a synchronize_net(), causing packet loss and latency.

By converting the configuration to an RCU-protected pointer, we can perform atomic updates via RCU swap. This allows data path readers to safely access the configuration locklessly under RCU read lock, and removes the need to stop the data path during changelink.

With the RCU infrastructure in place, geneve_fill_info() is then updated to read the configuration under RCU read lock, removing its dependency on RTNL.

v2: addressed Kuniyuki, Paolo and sashiko feedback
v1: https://lore.kernel.org/netdev/[email protected]/T/#m887804321856d9b5c7142107e81b52553e60e6ab

Eric Dumazet (3):
geneve: pass geneve_config pointer to helper functions
geneve: convert config to RCU-protected pointer
geneve: make geneve_fill_info() RTNL independent

 drivers/net/geneve.c | 370 ++++++++++++++++++++++++-------------------
 1 file changed, 209 insertions(+), 161 deletions(-)
Signature · 1 line
2.55.0.795.g602f6c329a-goog