Skip to content

net: tunnel: introduce noref xmit flows for tunnels

Marek Mietus openvpn-devel 2 versions – In review

Get series with b4
b4 am [email protected]...

Versions newest first · linked by author and title

  1. v3 Latest3 patches 1 replyIn review
  2. v23 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- Added implementation for ip6
- Updated cover letter and commit messages

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net: dst_cache: implement RCU variants for dst_cache helpersinclude/net/dst_cache.h net/core/dst_cache.c+163 -100 replies
2/3net: tunnel: implement noref flows in udp_tunnel{, 6}_xmit_skbinclude/net/ip_tunnels.h include/net/udp_tunnel.h net/ipv4/ip_tunnel_core.c +2 more+109 -210 replies
3/3net: ovpn: use new noref xmit flow in ovpn_udp{4, 6}_outputdrivers/net/ovpn/udp.c+11 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [Openvpn-devel] [PATCH net-next v3 0/3] net: tunnel: introduce noref xmit flows for tunnels

Currently, all xmit flows use dst_cache in a way that references its dst_entry for each xmitted packet. These atomic operations are redundant in some flows.

This patchset introduces new noref xmit helpers and incorporates them in the OpenVPN driver. A similar improvement can also be applied to other tunnel code in the future. The implementation for OpenVPN is a good starting point as it doesn't use the udp_tunnel_dst_lookup helper which adds some complexity.

There are already noref optimizations in both ipv4 and ip6 (See __ip_queue_xmit, inet6_csk_xmit). This patchset allows for similar optimizations in udp tunnels. Referencing the dst_entry is now redundant, as the entire flow is protected under RCU, so it is removed.

With this patchset, I was able to observe a 4% decrease in the total time for ovpn_udp_send_skb using perf.

Changes in v3:
- Added implementation for ip6
- Updated cover letter and commit messages

Link to v2: https://lore.kernel.org/netdev/[email protected].../

Signature · 1 line
2.51.0