From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: hawk@kernel.org, netdev@vger.kernel.org
Cc: hawk@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, jhs@mojatatu.com, jiri@resnulli.us,
j.koeppeler@tu-berlin.de, kernel-team@cloudflare.com,
Chris Arges <chris.arges@gmail.com>,
Mike Freemon <mike.freemon@cloudflare.com>
Subject: Re: [PATCH net-next 0/5] veth: add Byte Queue Limits (BQL) support
Date: Fri, 27 Mar 2026 10:50:34 +0100 [thread overview]
Message-ID: <87h5q1d2j9.fsf@toke.dk> (raw)
In-Reply-To: <20260324174719.1224337-1-hawk@kernel.org>
hawk@kernel.org writes:
> From: Jesper Dangaard Brouer <hawk@kernel.org>
>
> This series adds BQL (Byte Queue Limits) to the veth driver, reducing
> latency by dynamically limiting in-flight bytes in the ptr_ring and
> moving buffering into the qdisc where AQM algorithms can act on it.
>
> Problem:
> veth's 256-entry ptr_ring acts as a "dark buffer" -- packets queued
> there are invisible to the qdisc's AQM. Under load, the ring fills
> completely (DRV_XOFF backpressure), adding up to 256 packets of
> unmanaged latency before the qdisc even sees congestion.
>
> Solution:
> BQL (STACK_XOFF) dynamically limits in-flight bytes, stopping the
> queue before the ring fills. This keeps the ring shallow and pushes
> excess packets into the qdisc, where sojourn-based AQM can measure
> and drop them.
So one question here: Is *Byte* queue limits really the right thing for
veth? As you mention above, the ptr_ring is sized in a number of
packets. On a physical NIC, accounting bytes makes sense because there's
a fixed line rate, so bytes turn directly into latency.
But on a veth device, the stack processing is per packet, and most
processing takes the same amount of time regardless of the size of the
packet (e.g., netfilter rules that operate on the skb only).
So my worry would be that when you're accounting in bytes, if there's a
mix of big and small packets, you'd end up with the BQL algorithm
scaling to a "too large" value, which would allow a lot of small packets
to be queued up, adding extra latency (or even overflowing the ring
buffer if the ratio is large enough).
Have you run any such experiments? And have you tried just accounting
the queue in packets, so instead of:
+ netdev_tx_sent_queue(txq, skb->len);
you'd just do:
+ netdev_tx_sent_queue(txq, 1);
?
-Toke
next prev parent reply other threads:[~2026-03-27 9:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 17:46 [PATCH net-next 0/5] veth: add Byte Queue Limits (BQL) support hawk
2026-03-24 17:46 ` [PATCH " hawk
2026-03-24 17:56 ` Jesper Dangaard Brouer
2026-03-24 17:47 ` [PATCH net-next 1/5] net: add dev->bql flag to allow BQL sysfs for IFF_NO_QUEUE devices hawk
2026-03-24 17:47 ` [PATCH net-next 2/5] veth: implement Byte Queue Limits (BQL) for latency reduction hawk
2026-03-24 17:47 ` [PATCH net-next 3/5] veth: add tx_timeout watchdog as BQL safety net hawk
2026-03-24 17:47 ` [PATCH net-next 4/5] net: sched: add timeout count to NETDEV WATCHDOG message hawk
2026-03-24 17:47 ` [PATCH net-next 5/5] selftests: net: add veth BQL stress test hawk
2026-03-26 12:19 ` Jesper Dangaard Brouer
2026-03-26 19:55 ` Jakub Kicinski
2026-03-27 9:50 ` Toke Høiland-Jørgensen [this message]
2026-03-27 12:49 ` [PATCH net-next 0/5] veth: add Byte Queue Limits (BQL) support Jesper Dangaard Brouer
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=87h5q1d2j9.fsf@toke.dk \
--to=toke@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=chris.arges@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=j.koeppeler@tu-berlin.de \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kernel-team@cloudflare.com \
--cc=kuba@kernel.org \
--cc=mike.freemon@cloudflare.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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