Skip to content

udp_tunnel: GRO optimizations

Paolo Abeni netdev 5 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. v5 Latest2 patches 2 repliesApplied 2/2
  2. v42 patches 4 repliesApplied 2/2
  3. v32 patches 9 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches7 repliesSuperseded
v12 patches7 repliesSuperseded

Changes in v5 from the cover letter

- incorporated the follow-up fixes:
https://lore.kernel.org/netdev/[email protected]/
- more accurate benchmarking
v4: https://lore.kernel.org/netdev/[email protected]/

Patches in v5 All 2 applied

#Subject and filesSizeRepliesApplied
1/2udp_tunnel: create a fastpath GRO lookup.include/linux/udp.h include/net/netns/ipv4.h include/net/udp.h +6 more+109 -11 replyApplied
2/2udp_tunnel: use static call for GRO hooks when possibleinclude/net/udp_tunnel.h net/ipv4/udp_offload.c+138 -11 replyApplied

Reviews trailers per patch

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

PatchWillem de Bruijn
1/2R-b
2/2R-b

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

Read the v5 thread

Cover letter [PATCH net-next v5 0/2] udp_tunnel: GRO optimizations

The UDP tunnel GRO stage is source of measurable overhead for workload based on UDP-encapsulated traffic: each incoming packets requires a full UDP socket lookup and an indirect call.

In the most common setups a single UDP tunnel device is used. In such case we can optimize both the lookup and the indirect call.

Patch 1 tracks per netns the active UDP tunnels and replaces the socket lookup with a single destination port comparison when possible.

Patch 2 tracks the different types of UDP tunnels and replaces the indirect call with a static one when there is a single UDP tunnel type active.

I measure ~10% performance improvement in TCP over UDP tunnel stream tests on top of this series.
---
v4 -> v5:
- incorporated the follow-up fixes:
https://lore.kernel.org/netdev/[email protected]/
- more accurate benchmarking
v4: https://lore.kernel.org/netdev/[email protected]/

v3 -> v4:
- cleanup lookup in patch 2
- more RCU_INIT_POINTER usage in patch 1
(see the individual patches changelog for more details)
v3: https://lore.kernel.org/netdev/[email protected]

v2 -> v3:
- avoid unneeded checks in udp_tunnel_update_gro_rcv()
- use RCU_INIT_POINTER() when possible
- drop 'inline' from c file
v2: https://lore.kernel.org/netdev/[email protected]/

v1 -> v2:
- fixed a couple of typos
- fixed UDP_TUNNEL=n build
- clarified design choices
(see the individual patches changelog for more details)
v1: https://lore.kernel.org/netdev/[email protected]/

Paolo Abeni (2):
udp_tunnel: create a fastpath GRO lookup.
udp_tunnel: use static call for GRO hooks when possible

 include/linux/udp.h        |  16 ++++
 include/net/netns/ipv4.h   |  11 +++
 include/net/udp.h          |   1 +
 include/net/udp_tunnel.h   |  16 ++++
 net/ipv4/udp.c             |  13 ++-
 net/ipv4/udp_offload.c     | 172 ++++++++++++++++++++++++++++++++++++-
 net/ipv4/udp_tunnel_core.c |  13 +++
 net/ipv6/udp.c             |   2 +
 net/ipv6/udp_offload.c     |   5 ++
 9 files changed, 247 insertions(+), 2 deletions(-)
Signature · 1 line
2.49.0