[PATCH net-next V2 0/2] veth: qdisc backpressure and qdisc check refactor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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(-)

--





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux