[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ecxyhn1h.fsf@cloudflare.com>
Date: Fri, 11 Apr 2025 14:59:06 +0200
From: Jakub Sitnicki <jakub@...udflare.com>
To: Jesper Dangaard Brouer <hawk@...nel.org>
Cc: netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
bpf@...r.kernel.org, tom@...bertland.com, Eric Dumazet
<eric.dumazet@...il.com>, "David S. Miller" <davem@...emloft.net>, Paolo
Abeni <pabeni@...hat.com>, Toke Høiland-Jørgensen
<toke@...e.dk>,
dsahern@...nel.org, makita.toshiaki@....ntt.co.jp,
kernel-team@...udflare.com
Subject: Re: [PATCH net-next V2 0/2] veth: qdisc backpressure and qdisc
check refactor
On Tue, Apr 08, 2025 at 05:31 PM +02, Jesper Dangaard Brouer wrote:
> This series addresses TX drops observed in production when using veth
> devices with threaded NAPI, and refactors a common qdisc check into a
> shared helper.
>
> In threaded NAPI mode, packet drops can occur when the ptr_ring backing
> the veth peer fills up. This is typically due to a combination of
> scheduling delays and the consumer (NAPI thread) being slower than the
> producer. When the ring overflows, packets are dropped in veth_xmit().
>
> Patch 1 introduces a backpressure mechanism: when the ring is full, the
> driver returns NETDEV_TX_BUSY, signaling the qdisc layer to requeue the
> packet. This allows Active Queue Management (AQM) - such as fq or sfq -
> to spread traffic more fairly across flows and reduce damage from
> elephant flows.
>
> To minimize invasiveness, this backpressure behavior is only enabled when
> a qdisc is attached. If no qdisc is present, the driver retains its
> original behavior (dropping packets on a full ring), avoiding behavior
> changes for configurations without a qdisc.
>
> Detecting the presence of a "real" qdisc relies on a check that is
> already duplicated across multiple drivers (e.g., veth, vrf). Patch-2
> consolidates this logic into a new helper, qdisc_txq_is_noop(), to avoid
> duplication and clarify intent.
>
> ---
>
> Jesper Dangaard Brouer (2):
> veth: apply qdisc backpressure on full ptr_ring to reduce TX drops
> net: sched: generalize check for no-op qdisc
>
>
> drivers/net/veth.c | 49 ++++++++++++++++++++++++++++++++-------
> drivers/net/vrf.c | 3 +--
> include/net/sch_generic.h | 7 +++++-
> 3 files changed, 48 insertions(+), 11 deletions(-)
This setup scenario is currently not covered by the veth selftest [1].
Would be great to extend it so the code gets exercised by the CI.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/tools/testing/selftests/net/veth.sh
Powered by blists - more mailing lists