[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <174412623473.3702169.4235683143719614624.stgit@firesoul>
Date: Tue, 08 Apr 2025 17:31:13 +0200
From: Jesper Dangaard Brouer <hawk@...nel.org>
To: netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>
Cc: Jesper Dangaard Brouer <hawk@...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: [PATCH net-next V2 0/2] veth: qdisc backpressure and qdisc check
refactor
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(-)
--
Powered by blists - more mailing lists