mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <hawk@kernel.org>
To: "Simon Schippers" <simon@schippers-hamm.de>,
	"Jonas Köppeler" <j.koeppeler@tu-berlin.de>,
	"Jakub Kicinski" <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, kernel-team@cloudflare.com,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	John Fastabend <john.fastabend@gmail.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH net-next v5 3/5] veth: implement Byte Queue Limits (BQL) for latency reduction
Date: Wed, 27 May 2026 09:38:44 +0200	[thread overview]
Message-ID: <80dc574b-f2da-4f04-8bc8-1b0793b1f296@kernel.org> (raw)
In-Reply-To: <e8be86b4-052f-4f4f-9cb9-2fb12d1e8922@schippers-hamm.de>



On 26/05/2026 17.07, Simon Schippers wrote:
> On 5/26/26 16:55, Jonas Köppeler wrote:
>> On 5/26/26 4:35 PM, Simon Schippers wrote:
>>> On 5/26/26 11:54, Jonas Köppeler wrote:
>>>> On 5/23/26 6:09 PM, Simon Schippers wrote:
>>>>> On 5/22/26 18:26, Jonas Köppeler wrote:
>>>>>> On 5/22/26 10:41, Simon Schippers wrote:
>>>>>>> On 5/22/26 09:14, Jonas Köppeler wrote:
>>>>>>>> On 5/19/26 10:51 PM, Simon Schippers wrote:
>>>>>>>>> On 5/12/26 23:55, Simon Schippers wrote:
>>>>>>>>>> On 5/12/26 15:54, Jesper Dangaard Brouer wrote:
>>>>>>>>>>>>> Nope, I'm using a bpftrace program to keep track of the inflight/limit
>>>>>>>>>>>>> in a BPF hashmap.  Reading from /sys will not be accurate.
>>>>>>>>>>>> Ah nice.
>>>>>>>>>>> Add the option --hist to have both NAPI and BQL histograms printed when
>>>>>>>>>>> script ends.  This will give you an accurate pattern of how inflight and
>>>>>>>>>>> limit evolves.
>>>>>>>>>>>
>>>>>>>>>>>>> I moved the selftests into a github repo [1] to allow us to collaborate
>>>>>>>>>>>>> and evaluate the changes more easily.  I explicitly kept the new BPF
>>>>>>>>>>>>> based BQL tracking as a commit[2] for your benefit.
>>>>>>>>>>>>>
>>>>>>>>>>>>>        [1] https://github.com/netoptimizer/veth-backpressure-performance-testing/tree/main/selftests

[... cut ...]

>>>
>>> I will wait for your new measurements, but there is no argument
>>> against a default tx-usecs of ~100us for now, right?
>> Yes, I think 100us is perfectly fine. I guess most of it was
>> just my curiosity why the latency values are as they are 🙂
> Which is great, because I was wondering the same 🙂
> 

Thank you Jonas and Simon for testing this via[1] on your systems.

One performance concern from my side is if/when BQL limit goes below 8
packets. This will cause cache-line bouncing and many qdisc requeues
between the two CPUs.  Notice that 8 packets for the ptr_ring is one
cache-line. This is why I suggested defaulting BQL min_limit to be 8.
This would work in combination with the tx-usecs coalesce tuning as a
lower bound.


>> But it feels like this will need some documentation, because
>> as we have seen, some values are a little different
>> from what you expect from bql. Inflight > veth_ring_size,
>> tx-usecs not necessarily achieving the configured value,
>> inflight can get stuck > 0. Wdyt?
>> But I think it works nicely overall.
>>
> Exactly, we should get ready for a v6 soon.
>

I want to send out a V6 today (and I'm busy rest of week).
I'm simply going to include Simon's patch[2]. Then we can iterate on
that email thread, making it easier for people to reply inline to the
code changes.

[2] 
https://lore.kernel.org/all/9a57bb41-114e-492b-9eaa-52237675bb7c@schippers-hamm.de/

> And I think we should move the BQL logic into a seperate .h file
> as a library. Then it is also usable for TUN/TAP in the future.
> 

I like the idea, but refactoring into a library seems out-of-scope for
this patchset.  As a first step, let us see if this works for veth
driver use-case.  I do encourage Simon to refactor when doing the work
for TUN/TAP in the future.

Alternatively netdev maintainers can choose to apply V5 patchset and we
can iterate on finding the right ethtool coalesce parameters for veth
and create a .h "library" file for this.


> Let's amend the commits. Should we do this on Github?

Kernel development for netdev [3] happens on the mailing list with 
patches via email.

--Jesper

[3] https://kernel.org/doc/html/latest/process/maintainer-netdev.html


  reply	other threads:[~2026-05-27  7:38 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260505132159.241305-1-hawk@kernel.org>
2026-05-05 13:21 ` [PATCH net-next v5 1/5] veth: fix OOB txq access in veth_poll() with asymmetric queue counts hawk
2026-05-07 14:25   ` Paolo Abeni
2026-05-05 13:21 ` [PATCH net-next v5 2/5] net: add dev->bql flag to allow BQL sysfs for IFF_NO_QUEUE devices hawk
2026-05-05 13:21 ` [PATCH net-next v5 3/5] veth: implement Byte Queue Limits (BQL) for latency reduction hawk
2026-05-07  6:54   ` Simon Schippers
2026-05-07 13:21     ` Paolo Abeni
2026-05-07 14:34     ` Paolo Abeni
2026-05-07 14:46       ` Simon Schippers
2026-05-07 19:09         ` Jesper Dangaard Brouer
2026-05-07 20:12           ` Simon Schippers
2026-05-07 20:45             ` Jesper Dangaard Brouer
2026-05-08  8:01               ` Simon Schippers
2026-05-08  9:20                 ` Simon Schippers
2026-05-09  2:06           ` Jakub Kicinski
2026-05-09  9:09             ` Jesper Dangaard Brouer
2026-05-10 15:56               ` Jakub Kicinski
2026-05-11  8:11                 ` Jesper Dangaard Brouer
2026-05-11  9:55                   ` Simon Schippers
2026-05-11 18:08                     ` Jesper Dangaard Brouer
2026-05-11 20:37                       ` Simon Schippers
2026-05-12 13:54                         ` Jesper Dangaard Brouer
2026-05-12 21:55                           ` Simon Schippers
2026-05-19 20:51                             ` Simon Schippers
2026-05-22  7:17                               ` Jonas Köppeler
     [not found]                               ` <4ae9400a-8919-4ffc-8db3-0c334e2aa462@tu-berlin.de>
2026-05-22  8:41                                 ` Simon Schippers
2026-05-22 16:26                                   ` Jonas Köppeler
2026-05-23 16:09                                     ` Simon Schippers
2026-05-26  9:54                                       ` Jonas Köppeler
2026-05-26 14:35                                         ` Simon Schippers
2026-05-26 14:55                                           ` Jonas Köppeler
2026-05-26 15:07                                             ` Simon Schippers
2026-05-27  7:38                                               ` Jesper Dangaard Brouer [this message]
2026-05-27  7:59                                                 ` Simon Schippers
2026-05-27  8:38                                                 ` Simon Schippers
2026-05-05 13:21 ` [PATCH net-next v5 4/5] veth: add tx_timeout watchdog as BQL safety net hawk
2026-05-05 13:21 ` [PATCH net-next v5 5/5] net: sched: add timeout count to NETDEV WATCHDOG message hawk

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=80dc574b-f2da-4f04-8bc8-1b0793b1f296@kernel.org \
    --to=hawk@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=j.koeppeler@tu-berlin.de \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-team@cloudflare.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=simon@schippers-hamm.de \
    /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

Powered by JetHome