public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Marek Mietus <mmietus97@yahoo.com>
To: netdev@vger.kernel.org, sd@queasysnail.net, kuba@kernel.org,
	pabeni@redhat.com
Cc: Jason@zx2c4.com, Marek Mietus <mmietus97@yahoo.com>
Subject: [PATCH net-next v8 00/11] net: tunnel: introduce noref xmit flows for tunnels
Date: Thu, 12 Mar 2026 16:56:46 +0100	[thread overview]
Message-ID: <20260312155657.25676-1-mmietus97@yahoo.com> (raw)
In-Reply-To: 20260312155657.25676-1-mmietus97.ref@yahoo.com

Currently, tunnel xmit flows always take a reference on the dst_entry
for each xmitted packet. These atomic operations are redundant in some
flows.

This patchset introduces the infrastructure required for converting
the tunnel xmit flows to noref, and converts them where possible.

These changes improve tunnel performance, since less atomic operations
are used.

There are already noref optimizations in both ipv4 and ip6.
(See __ip_queue_xmit, inet6_csk_xmit)
This patchset implements similar optimizations in ip and udp tunnels.

Benchmarks:
I used a vxlan tunnel over a pair of veth peers and measured the average
throughput over multiple samples.

I ran 100 samples on a clean build, and another 100 on a patched
build. Each sample ran for 120 seconds. These were my results:

clean:      72.52 gb/sec, stddev = 1.39
patched:    75.39 gb/sec, stddev = 0.94

TL;DR - This patchset results in a 4% improvement in throughput for
vxlan. It's safe to assume that we might see similar results when testing
other tunnels.

Changes in v8:
 - Removed repetitive "if (!noref) dst_release()" flows by updating the
output routing lookup flow to decrement the refcount for the dst, essentially
making all dsts noref.

Link to v7: https://lore.kernel.org/netdev/20260127070452.6581-1-mmietus97@yahoo.com/

Marek Mietus (11):
  net: dst_cache: add noref versions for dst_cache
  net: tunnel: convert iptunnel_xmit to noref
  net: tunnel: convert udp_tunnel{6,}_xmit_skb to noref
  net: tunnel: return noref dsts in udp_tunnel{,6}_dst_lookup
  net: ovpn: convert ovpn_udp{4,6}_output to use a noref dst
  wireguard: socket: convert send{4,6} to use a noref dst when possible
  net: tunnel: convert ip_md_tunnel_xmit to use noref dsts
  net: tunnel: convert ip_tunnel_xmit to use a noref dst when possible
  net: sctp: convert sctp_v{4,6}_xmit to use a noref dst when possible
  net: sit: convert ipip6_tunnel_xmit to use a noref dst
  net: tipc: convert tipc_udp_xmit to use a noref dst

 drivers/net/amt.c              |   3 +
 drivers/net/bareudp.c          |   4 -
 drivers/net/geneve.c           |  11 ---
 drivers/net/gtp.c              |   7 ++
 drivers/net/ovpn/udp.c         |   8 +-
 drivers/net/vxlan/vxlan_core.c |   6 --
 drivers/net/wireguard/socket.c |  12 ++-
 include/net/dst_cache.h        |  71 ++++++++++++++++++
 net/core/dst_cache.c           | 133 ++++++++++++++++++++++++++++++---
 net/ipv4/ip_tunnel.c           |  32 ++++----
 net/ipv4/ip_tunnel_core.c      |   2 +-
 net/ipv4/udp_tunnel_core.c     |   6 +-
 net/ipv6/ip6_udp_tunnel.c      |  10 ++-
 net/ipv6/sit.c                 |  14 +---
 net/sctp/ipv6.c                |   6 +-
 net/sctp/protocol.c            |   7 +-
 net/tipc/udp_media.c           |   6 +-
 17 files changed, 258 insertions(+), 80 deletions(-)

-- 
2.51.0


       reply	other threads:[~2026-03-12 16:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260312155657.25676-1-mmietus97.ref@yahoo.com>
2026-03-12 15:56 ` Marek Mietus [this message]
2026-03-12 15:56   ` [PATCH net-next v8 01/11] net: dst_cache: add noref versions for dst_cache Marek Mietus
2026-03-12 15:56   ` [PATCH net-next v8 02/11] net: tunnel: convert iptunnel_xmit to noref Marek Mietus
2026-03-12 15:56   ` [PATCH net-next v8 03/11] net: tunnel: convert udp_tunnel{6,}_xmit_skb " Marek Mietus
2026-03-12 15:56   ` [PATCH net-next v8 04/11] net: tunnel: return noref dsts in udp_tunnel{,6}_dst_lookup Marek Mietus
2026-03-12 15:56   ` [PATCH net-next v8 05/11] net: ovpn: convert ovpn_udp{4,6}_output to use a noref dst Marek Mietus
2026-03-12 15:56   ` [PATCH net-next v8 06/11] wireguard: socket: convert send{4,6} to use a noref dst when possible Marek Mietus
2026-03-12 15:56   ` [PATCH net-next v8 07/11] net: tunnel: convert ip_md_tunnel_xmit to use noref dsts Marek Mietus
2026-03-12 15:56   ` [PATCH net-next v8 08/11] net: tunnel: convert ip_tunnel_xmit to use a noref dst when possible Marek Mietus
2026-03-12 15:56   ` [PATCH net-next v8 09/11] net: sctp: convert sctp_v{4,6}_xmit " Marek Mietus
2026-03-12 15:56   ` [PATCH net-next v8 10/11] net: sit: convert ipip6_tunnel_xmit to use a noref dst Marek Mietus
2026-03-12 15:56   ` [PATCH net-next v8 11/11] net: tipc: convert tipc_udp_xmit " Marek Mietus
2026-03-17 11:37   ` [PATCH net-next v8 00/11] net: tunnel: introduce noref xmit flows for tunnels Paolo Abeni

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=20260312155657.25676-1-mmietus97@yahoo.com \
    --to=mmietus97@yahoo.com \
    --cc=Jason@zx2c4.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sd@queasysnail.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox