Netdev List
 help / color / mirror / Atom feed
From: Simon Schippers <simon.schippers@tu-dortmund.de>
To: Brett A C Sheffield <bacs@librecast.net>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	Jason Wang <jasowangio@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, Simon Horman <horms@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Tim Gebauer <tim.gebauer@tu-dortmund.de>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2] tun/tap & vhost-net: make qdisc backpressure opt-in via IFF_BACKPRESSURE
Date: Tue, 7 Jul 2026 08:56:07 +0200	[thread overview]
Message-ID: <527f81a7-05da-4c01-b4fa-aa090c6f57ce@tu-dortmund.de> (raw)
In-Reply-To: <0d28fdc4-3c03-48d6-bd59-e59f7a01f4b6@tu-dortmund.de>

[-- Attachment #1: Type: text/plain, Size: 568 bytes --]

On 7/7/26 08:52, Simon Schippers wrote:
> Brett, can you try the two attached patches here with iperf3?
> I think testing with 8 and 16 threads is enough, so where there is a
> regression.
> 
> The two patches are about time when to wake:
> Currently we wake after consuming half the internal ring buffer.
> One of the attached patches wakes after 2 cachelines (128 of 1000
> packets) and the other one just wakes once the ring buffer is empty.
> 
> This would really help :)

Whoops send you the wrong patch (the opt-in patch again), here
is the wake on empty patch.

[-- Attachment #2: 0001-tun-set-waking-threshold-to-ptr_ring_empty.patch --]
[-- Type: text/x-patch, Size: 917 bytes --]

From a4343922e635cb1cab017b2e85cdd2e606cb667a Mon Sep 17 00:00:00 2001
From: Simon Schippers <simon.schippers@tu-dortmund.de>
Date: Tue, 7 Jul 2026 08:38:31 +0200
Subject: [PATCH] tun: set waking threshold to ptr_ring_empty()

Only wake once the ptr_ring is empty, which results in later and less
calls of netif_tx_wake_queue().
---
 drivers/net/tun.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index ffbe6f13fb1f..acbafd39f3ae 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -2158,8 +2158,7 @@ static void __tun_wake_queue(struct tun_struct *tun,
 	smp_mb();
 	if (netif_tx_queue_stopped(txq)) {
 		tfile->cons_cnt += consumed;
-		if (tfile->cons_cnt >= tfile->tx_ring.size / 2 ||
-		    __ptr_ring_empty(&tfile->tx_ring)) {
+		if (__ptr_ring_empty(&tfile->tx_ring)) {
 			netif_tx_wake_queue(txq);
 			tfile->cons_cnt = 0;
 		}
-- 
2.43.0


      reply	other threads:[~2026-07-07  6:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06  9:42 [PATCH net v2] tun/tap & vhost-net: make qdisc backpressure opt-in via IFF_BACKPRESSURE Simon Schippers
2026-07-06 10:11 ` Brett A C Sheffield
2026-07-06 13:23   ` Michael S. Tsirkin
2026-07-06 15:33     ` Simon Schippers
2026-07-06 17:10       ` Brett A C Sheffield
2026-07-07  6:52         ` Simon Schippers
2026-07-07  6:56           ` Simon Schippers [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=527f81a7-05da-4c01-b4fa-aa090c6f57ce@tu-dortmund.de \
    --to=simon.schippers@tu-dortmund.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=bacs@librecast.net \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jasowangio@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=skhan@linuxfoundation.org \
    --cc=tim.gebauer@tu-dortmund.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox