From: Paolo Abeni <pabeni@redhat.com>
To: netdev@vger.kernel.org
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
David Ahern <dsahern@kernel.org>,
kuniyu@amazon.com
Subject: [PATCH v4 net-next 0/2] udp_tunnel: GRO optimizations
Date: Tue, 11 Mar 2025 21:42:27 +0100 [thread overview]
Message-ID: <cover.1741718157.git.pabeni@redhat.com> (raw)
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 ~5% performance improvement in TCP over UDP tunnel stream
tests on top of this series.
---
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/cover.1741632298.git.pabeni@redhat.com
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/cover.1741338765.git.pabeni@redhat.com/
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/cover.1741275846.git.pabeni@redhat.com/
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 | 22 +++++
net/ipv4/udp.c | 13 ++-
net/ipv4/udp_offload.c | 167 ++++++++++++++++++++++++++++++++++++-
net/ipv4/udp_tunnel_core.c | 14 ++++
net/ipv6/udp.c | 2 +
net/ipv6/udp_offload.c | 5 ++
9 files changed, 249 insertions(+), 2 deletions(-)
--
2.48.1
next reply other threads:[~2025-03-11 20:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 20:42 Paolo Abeni [this message]
2025-03-11 20:42 ` [PATCH v4 net-next 1/2] udp_tunnel: create a fastpath GRO lookup Paolo Abeni
2025-03-12 17:46 ` Willem de Bruijn
2025-03-11 20:42 ` [PATCH v4 net-next 2/2] udp_tunnel: use static call for GRO hooks when possible Paolo Abeni
2025-03-12 17:57 ` Willem de Bruijn
2025-03-21 4:16 ` Nathan Chancellor
2025-03-21 9:11 ` Paolo Abeni
2025-03-18 10:50 ` [PATCH v4 net-next 0/2] udp_tunnel: GRO optimizations patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1741718157.git.pabeni@redhat.com \
--to=pabeni@redhat.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@amazon.com \
--cc=netdev@vger.kernel.org \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.