netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Marek Mietus <mmietus97@yahoo.com>
Cc: netdev@vger.kernel.org, sd@queasysnail.net, antonio@openvpn.net,
	openvpn-devel@lists.sourceforge.net
Subject: Re: [PATCH net-next v3 0/3] net: tunnel: introduce noref xmit flows for tunnels
Date: Wed, 24 Sep 2025 16:31:14 -0700	[thread overview]
Message-ID: <20250924163114.2adc671b@kernel.org> (raw)
In-Reply-To: <3f9e0aa5-1628-4ad7-8078-86a55b09b216@yahoo.com>

On Wed, 24 Sep 2025 18:27:46 +0200 Marek Mietus wrote:
> > On Mon, 22 Sep 2025 13:06:19 +0200 Marek Mietus wrote:  
> >> 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.  
> > 
> > You're basically refactoring an API, it's fairly unusual to leave both
> > APIs in place upstream. Unless the number of callers is really huge,
> > say >100, or complexity very high. Not sure how others feel but IMHO
> > you should try to convert all the tunnels.
> >   
> 
> I'm introducing an opt-in API, which is useful in some cases, but not
> always as it optimizes flows that follow a specific pattern.
> 
> Since this API is opt-in, there is no need to over-complicate code
> to integrate the new API. The current API is still retained and is not 
> made redundant by the new API. Some tunnels may benefit from the new
> API with only minor complications, and should be modified in separate
> patchsets after this one.

My objection stands. Unless you have a reason why some tunnels need 
to ref the dst you should just convert all. Otherwise this is just
technical debt you're pushing on posterity.

> >> 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.  
> > 
> > Please provide more meaningful perf wins. Relative change of perf in
> > one function doesn't tell use.. well.. anything.
> 
> Okay. Currently, I'm getting a consistent 2% increase in throughput on a VM,
> using iperf. Is this what I should mention in the next cover-letter?

Yes, that's much better! Some kind of average over multiple runs and/or
stddev would be ideal.

      reply	other threads:[~2025-09-24 23:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250922110622.10368-1-mmietus97.ref@yahoo.com>
2025-09-22 11:06 ` [PATCH net-next v3 0/3] net: tunnel: introduce noref xmit flows for tunnels Marek Mietus
2025-09-22 11:06   ` [PATCH net-next v3 1/3] net: dst_cache: implement RCU variants for dst_cache helpers Marek Mietus
2025-09-22 11:06   ` [PATCH net-next v3 2/3] net: tunnel: implement noref flows in udp_tunnel{,6}_xmit_skb Marek Mietus
2025-09-22 11:06   ` [PATCH net-next v3 3/3] net: ovpn: use new noref xmit flow in ovpn_udp{4,6}_output Marek Mietus
2025-09-24  1:48   ` [PATCH net-next v3 0/3] net: tunnel: introduce noref xmit flows for tunnels Jakub Kicinski
2025-09-24 16:27     ` Marek Mietus
2025-09-24 23:31       ` Jakub Kicinski [this message]

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=20250924163114.2adc671b@kernel.org \
    --to=kuba@kernel.org \
    --cc=antonio@openvpn.net \
    --cc=mmietus97@yahoo.com \
    --cc=netdev@vger.kernel.org \
    --cc=openvpn-devel@lists.sourceforge.net \
    --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;
as well as URLs for NNTP newsgroup(s).