๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #7827

Re: [PATCH net] net/sched: fix packet reordering on requeue

#7827
From: Eric Dumazet
Date: Tue, 27 Oct 2026 09:31
59 lines
11409 bytes
Le mar. 27 oct. 2026 ร  10:28, Jesper Dangaard Brouer <hawk@kernel.org> a รฉcrit :
>
>
>
> On 10/26/26 16:31, Antonio Quartulli wrote:
> > dev_requeue_skb() appends requeued skbs to the tail of q->gso_skb, while
> > dequeue_skb() takes them back one at a time from the head. If the driver
> > returns NETDEV_TX_BUSY again for the first of them, it moves behind the
> > skbs still parked there and is sent after them.
> >
> > This showed up as heavy TCP reordering while benchmarking over veth,
> > which returns NETDEV_TX_BUSY whenever its ring is full since
> > commit dc82a33297fc ("veth: apply qdisc backpressure on full ptr_ring to reduce TX drops").
> >
> > Requeue the skbs at the head of gso_skb, keeping their order. With 4 TCP
> > streams over a veth pair with a pfifo qdisc, this removes about 1.3M
> > out-of-order segments and 15-37k retransmits per 15 seconds, and raises
> > throughput from about 40 to 76 Gbit/s.
> >
> > Fixes: a53851e2c321 ("net: sched: explicit locking in gso_cpu fallback")
> > Fixes: 9540d977618c ("net: sched: fix skb leak in dev_requeue_skb()")
> > Cc: stable@vger.kernel.org
> > Assisted-by: Claude:claude-opus-5-5
> > Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
> > ---
>
> Thanks for finding and fixing this!
>
> Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
>
> > Notes:
> >
> > - Setup: 8-vCPU VM, veth pair; sender with a pfifo qdisc and TSO off,
> >    receiver with GRO and threaded NAPI; iperf3, 15 s runs.
> >
>
> For others, notice threaded NAPI an important setup parameter here.
> This makes it more likely and reliable for ptr_ring producer and
> consumer to run on different CPUs.  This situation can still occur
> without threaded NAPI, when multiple localhost userspace applications
> run producing packets into veth, as they will likely get be schedules on
> different CPUs.
>
> FYI, we also run veth with threaded NAPI in production, but used in a
> routing setup (no "localhost" apps).  We have configured veth to have
> many queues (64), and we use qdisc MQ on top to avoid serialization on
> the qdisc root-lock.  Thus, we should be less affected, as we spread
> flows more across qdisc.

And presumably you use TSO.

With TSO, chances of hitting the bug is probably quite small.
Technical Details
Message-ID: <CAL4Wiipicgwk47pDVtxcuRY=QRWM4tbpf9jsBJ3YPhOo-emhXg@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352328-linux-kernel-netdev=dewy.ru
References: <20261026153113.3275494-1-antonio@mandelbit.com> <2812b71c-cd0c-4d87-a57c-427ef40d078b@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352328-linux-kernel-netdev=dewy.ru
From: edumazet@kernel.org (Eric Dumazet)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] net/sched: fix packet reordering on requeue
Date: Tue, 27 Oct 2026 10:31:12 +0100
Organization: Usenet Network
Message-ID: <CAL4Wiipicgwk47pDVtxcuRY=QRWM4tbpf9jsBJ3YPhOo-emhXg@mail.gmail.com>
References: <20261026153113.3275494-1-antonio@mandelbit.com> <2812b71c-cd0c-4d87-a57c-427ef40d078b@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="1503878"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:VV7k6n5JzrXupZn3ezG4ZcisiRU= sha256:qn2WNEKmW2gaxBS7T6Bg6gGA9JUa7XLjKbuQJQIhaow=
	sha1:iqeW2i0JpaFBMP/KyEmwgrTdcCs= sha256:4gqjiW2m7EvPzZ0mSWyrNUVNn/nSVlXsPZK/+PGYh+k=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 45537125BE6; Tue, 27 Oct 2026 12:36:25 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.739
X-Spam-Status: No, score=-3.739 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.339, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id PL0-MTlbXYrH;
	Tue, 27 Oct 2026 12:36:19 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-352328-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 9A3F3125BE0; Tue, 27 Oct 2026 12:36:10 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 895F32EE21; Tue, 27 Oct 2026 09:31:31 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793093490;
	b=ua88ag14QM36ws28Mi5b60OcP/lSccnFd46rHRtOxk+9B5pLYPgMAk2vLshiF14SoJdE
	 p2m8WRPeDDFebCN0JaijuIIGexRMGVLkxrl7dgwi7gmOZU4JHeuKnBPqg/MnVtVErHvGS
	 WuOb+W93r77OabzlYwxUXc3KdzyfEZUqfl4P+/kC8jBlmglOmFhJ/lic51lZsBn1QNA8s
	 3GKoBFnntWU+pKo8juNrtFL1etBVGpUOzAXlD7EXmM1auZZw3xJN9fegBW/iUHCmkGZ3C
	 xBdtMh7aYx0aazjFVwTJFRZpmMc2HEcl98gBRV/0r95bOkMjo3wo4kpEYcIhf2asEKQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793093490;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:References:In-Reply-To:From:Date:
	 X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
	 Content-Type:Content-Transfer-Encoding;
	bh=kvtdwU0KO2BtXBt6y/IVBzHQ0xmBFBGF6XhQxh8VEFk=;
	b=sj/5qyz1SAXOvB+OeUNfp5iURcCxzLdJZ2ZZJ2l+VJOWlOMHvyERbL+MJXtlIJBf1r6M
	 OHG0YSx2UXVYql/PV0QKYmBwJAHEPQxIcvtsp+CqIzCvmk8vCq3kH+dLEE20FUbGu5NM/
	 0TRCdtFcRhQzNDfweBtOHzfnGdoWPoVBbcSI/P00qzyue2TJa7LmsmkHpYOMPjYaUeP6B
	 3dWdcZifBxjo3NpSR+o/zYIHLdl6wpEGgi21LXos4pLIaTQm0hzGFoUF7OEiR0BgL+gj0
	 M9LIP4qES6WIUKAircLsPprNrXI8diCzAfVSfRX/9XG/xpzRWVe6/FuctVUKu5FklhQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VTuFsuZl;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 876D8606A32E;
	Tue, 27 Oct 2026 09:31:30 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VTuFsuZl
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793093489;
	b=vI+9bL1f5bqSpcXRvsifF13NWAK4D3ePSBKt37c6p44nEVo7wIJ6uOafOr3O94E/IliW
	 U5e63sXb2a28HZKcCNKfd//MCWjCXzsa4huixT0gEolkrB5ND/G2iHlLp2J9SsfpsF8cm
	 XaKXGukaPJKjpN3QQbriiC6jRYHYIMfXczq2CeFV4iOW6aEnAuwrjrr6vQhhe6Ub5DvdZ
	 ZT5vJMu5IyG4AInWZaTW7rwyw0K7pn05kQQys2UR5tDmcaKdPE9uoIvuvlxLsGPIaHs71
	 hqh8ZaEUDoBULl83vgs5WkXkTt/T2I6OEo5ponPWWIA/+DtImMnd7b1KRu46rCRXTlA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793093489;
	h=Received:DKIM-Signature:Received:X-Forwarded-Encrypted:
	 X-Gm-Message-State:X-Received:MIME-Version:References:In-Reply-To:
	 From:Date:X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:
	 Subject:To:Cc:Content-Type:Content-Transfer-Encoding;
	bh=kvtdwU0KO2BtXBt6y/IVBzHQ0xmBFBGF6XhQxh8VEFk=;
	b=TUV2BubTupju03m68T5e0Fdnj9CyzUnTSeECNi+c82bXpHQpjfoQaHjm39oMm9Zfs7NL
	 yP2BbeIRipWTzhKiy3JWskxJToAbhDApndb4/nh0X5d3Ztu5K/wFMgce1C9XB6/7Mq8BR
	 t4XWHK4TVg2nBLPmIsY9VfP5dSB92N9bKfLCy/JPH/jibUDx9qByx/TBlTp0eRB+XMkZu
	 QqNEcJGMFOBR8FKjMCmZAMedtFMfZ1pAKOD6TpuShlWFHf6E3kzRdj3kF41TmwbRee9mh
	 JrSyNPC62xhRuj3ShXH27D+64dE+sHzWA5nrVrDLBmvhkf4xK3MrHSgCM9LV00vJepw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VTuFsuZl;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67EEC606A325
	for <netdev@vger.kernel.org>; Tue, 27 Oct 2026 09:31:29 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24D481F031E5
	for <netdev@vger.kernel.org>; Tue, 27 Oct 2026 09:31:29 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793093489;
	bh=kvtdwU0KO2BtXBt6y/IVBzHQ0xmBFBGF6XhQxh8VEFk=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=VTuFsuZlVlYXSXEfBa06AjAr4dvqbmTCvoiiH7lZI1NKPWXSSahEY/KcRNGOOED6U
	 WbKHmI20D8IpJz+Xg3J+lJy9KUEV6p/hA/YW8h2nN1Em9a2R860IjhQcmpuEh8Hfqw
	 q0sp6MzIVN+9cA6od3AofVS64c2uBl1HMhY1VzV6VESYBhVKsE5QnZdPCjlxaJGVZ2
	 eJ7sHAiVBtQk1XqyQJ5c0Hpoqrlynsa37MNYiD6hfUzGALjNkhiGbxmWX+2Yy4X++w
	 z3mcvYx9Fay6HAhzzgflObM0jAOqBSe2W2/78twpBdpKk7oahxj55TwNHqG29RX0cH
	 ZDmD5snh9yzug==
X-Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-3a98fc80925so40440311fa.0
        for <netdev@vger.kernel.org>; Tue, 27 Oct 2026 02:31:29 -0700 (PDT)
X-Forwarded-Encrypted: i=1; AKwUvByr42zUWFzvw/PF2/+aCqcj09WLTJ+AHshdyRE56DIrVkkOsSpP/TT6hbg0fpuOnEwF8aomkxI=@vger.kernel.org
X-Gm-Message-State: AFq9FYIxEEOG+3Nb0RsXIw06CCcyjRymVchqiOhXDkWOt3ChK8e5nW+j
	0P/myhXS6pUr0jkbJcwJ7mttku4grDHiiGCnhohhYnu3Qa+2OdgE9zP20ese7md0dwcWawfGzei
	+LKo+OKPWvA80ljqJvsfJx6VA40Y4JV0=
X-Received: by 2002:a05:651c:1612:b0:3a9:9b74:1ba1 with SMTP id
 38308e7fff4ca-3ac6fd15170mr24859951fa.8.1793093487766; Tue, 27 Oct 2026
 02:31:27 -0700 (PDT)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <2812b71c-cd0c-4d87-a57c-427ef40d078b@kernel.org>
X-Gmail-Original-Message-ID: <CAL4Wiipicgwk47pDVtxcuRY=QRWM4tbpf9jsBJ3YPhOo-emhXg@mail.gmail.com>
X-Gm-Features: AclHuK-I6ImiJ1FO1cFDbA969CprrieCj22Ga3zWI-G3lytVH7H4AAoLQ4_fFPM
X-Cc: Antonio Quartulli <antonio@mandelbit.com>, netdev@vger.kernel.org, 
	Jamal Hadi Salim <jhs@mojatatu.com>, Jiri Pirko <jiri@resnulli.us>, 
	"David S . Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, 
	Simon Horman <horms@kernel.org>, John Fastabend <john.fastabend@gmail.com>, 
	linux-kernel@vger.kernel.org, stable@vger.kernel.org, 
	kernel-team <kernel-team@cloudflare.com>, Chris Arges <carges@cloudflare.com>