Article View: linux.kernel.netdev
Article #2673Re: [PATCH net-next] veth: clear rx queue hint in veth_xmit
From: Toshiaki Makita
Date: Tue, 13 Oct 2026 08:14
Date: Tue, 13 Oct 2026 08:14
63 lines
10994 bytes
10994 bytes
On 2026/10/09 13:04, Jiayuan Chen wrote:
> With more tx queues on one end of a veth pair than rx queues on the
> other, and RPS or generic XDP enabled on the receiving end, we get:
>
> veth1 received packet on queue 2, but number of RX queues is 2
> WARNING: net/core/dev.c:5212 at get_rps_cpu+0x560/0x1360
> Call Trace:
> <TASK>
> netif_rx_internal+0x1af/0x4c0
> __netif_rx+0x99/0x350
> veth_xmit+0x713/0xca0
> dev_hard_start_xmit+0x166/0x5f0
> __dev_queue_xmit+0x1797/0x42d0
> ip_finish_output2+0xa34/0x1f40
> __ip_finish_output+0x510/0x7e0
> ip_finish_output+0x2f/0x320
> ip_output+0x17a/0x3f0
> ip_send_skb+0x1bc/0x220
> ......
>
> Easy to hit with "ethtool -L veth0 tx 4", "ethtool -L veth1 rx 2",
> rps_cpus set on veth1 and a few flows sent over the pair [1].
>
> veth_xmit() uses skb->queue_mapping to pick the peer rq, but never
> clears it before veth_forward_skb(), so the rx side still sees the tx
> queue index. Everything on the rx side that goes through
> skb_get_rx_queue(), like get_rps_cpu() and netif_get_rxqueue() for
> generic XDP, takes it as a recorded rx queue and warns once it is out
> of range.
>
> Clear it before handing the skb to the peer:
>
> - It is the tx queue index of this device, it says nothing about the
> rx queue of the peer.
>
> - The two sides don't even agree on the encoding. The tx side stores
> the index as is, the rx side stores index + 1 so that 0 can mean
> "not recorded". So tx queue k is read back as rx queue k - 1, and
> tx queue 0 as "not recorded".
>
> - Commit 710ad98c363a ("veth: Do not record rx queue hint in
> veth_xmit") already decided that veth should not pass any queue
> hint to the peer. There is no tx->rx queue mapping to preserve, so
> nothing is lost by clearing it.
>
> On NETDEV_TX_BUSY the skb goes back to the qdisc, which looks up the
> txq from skb->queue_mapping to decide when to retry, so restore it
> there, next to the existing __skb_push().
>
> [1]: https://lore.kernel.org/netdev/156834bb-8e40-496e-9443-9d515fa18eab@linux.dev/
>
> Fixes: 710ad98c363a ("veth: Do not record rx queue hint in veth_xmit")
I guess the splat can happen before this commit.
I'm not very sure but probably it has been possible since after 76ff5cc91935
(with ip link add numtxqueues & numrxqueues, instead of ethtool -L)
> Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
I agree with the patch itself.
Reviewed-by: Toshiaki Makita <toshiaki.makita1@gmail.com>
Technical Details
Message-ID:
<65a3e29a-24e0-47b3-a189-903b1a33c336@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-345445-linux-kernel-netdev=dewy.ruReferences:
<20261009040412.14571-1-jiayuan.chen@linux.dev>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-345445-linux-kernel-netdev=dewy.ru
From: toshiaki.makita1@gmail.com (Toshiaki Makita)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next] veth: clear rx queue hint in veth_xmit
Date: Tue, 13 Oct 2026 17:14:00 +0900
Organization: Usenet Network
Message-ID: <65a3e29a-24e0-47b3-a189-903b1a33c336@gmail.com>
References: <20261009040412.14571-1-jiayuan.chen@linux.dev>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="1997528"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:7/PnZp9Du8AiSVE4Za/fRKV+Acc= sha256:cScKn94UanP1rdLjmXw7QC+ffY3Q/mQ+pNyTXiI09HE=
sha1:OR3REc1n2JOfP71DRPSgt/uzR1g= sha256:D6aagK8k1Z22imizgPppLOobRoQ+R2NkR+UID3ZDt7o=
Content-Language: en-US
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 195D810FDB2; Tue, 13 Oct 2026 11:17:41 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.749
X-Spam-Status: No, score=-0.749 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
MAILING_LIST_MULTI=-1, 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=gmail.com
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 ABZnngyICntR;
Tue, 13 Oct 2026 11:17:37 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-345445-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
by mail.dewy.ru (Postfix) with ESMTPS id D54F710FDAE; Tue, 13 Oct 2026 11:17:27 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by sin.lore.kernel.org (Postfix) with ESMTP id 03FC32837C; Tue, 13 Oct 2026 08:14:38 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 7BF0E3BFE50;
Tue, 13 Oct 2026 08:14:07 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LD/Q0JS1"
X-Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77B453B05A2
for <netdev@vger.kernel.org>; Tue, 13 Oct 2026 08:14:05 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1791879247; cv=none; b=hpFPpw7yONx2ez1VOdL9X+bGZVgqwHAyQB+KkxlmyRyLhuPwPx5HlggryBJbRQ1Y7aG12jyqMYDSF3arJVL5lwePhQCQvubzuuMhi89Q1O2G74gnrvZ2LC38LNtvi0zpO1ucAilXV8e7wONpArD20IF/qwYA+ViK5bbQhT1U+uw=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1791879247; c=relaxed/simple;
bh=kIJgnr/8fmPQEMfTYzL5uGySgGwig8u7nUKJCpef/Lc=;
h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
In-Reply-To:Content-Type; b=iu/m3Xm7ayg76dtbO09v9oed7AVXyQP9JWHcHsNHllLHQlfeumhY198SpC+C3fOdkk7A8H20L6XL6OIfkuufySk9XTuFauYTb9E0yvGZcGTbKQWw01P7edYcA+/gTS47373Flw97vDgTvGL5Gkrdb4koS64LbIMx8tGfxIVdqfY=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LD/Q0JS1; arc=none smtp.client-ip=209.85.210.174
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-887fb6c0ad1so640328b3a.0
for <netdev@vger.kernel.org>; Tue, 13 Oct 2026 01:14:05 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1791879245; x=1792484045; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:in-reply-to:from
:content-language:references:cc:to:subject:user-agent:mime-version
:date:message-id:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=oAUohNgu9SSrZDroQ9BQ1lUYsCyK2OM4/OMeA6X2nw8=;
b=LD/Q0JS1KfAH9ozBu8mmRbkdFBOPqXFmyhukUxecCJP/bfjVeDdpmNmMH13KgBeVte
+qee5k7IMopgj4vo9keawScXOWIww6fYUmM/HjTZNl6pG0MWu8AVzJg1FBqreEKdp50b
3r6yZczIKNFjs176qaRLUOVkBN+IeSW9GyR8a7a5ie3byMG2IFhHLdC7ZouiviX8a2qB
hREDri3o8ab90o+cfkfCBQ8iIK1MOIsEtVaSLn/CH0v2To7PUEsexYkQTYJj/NA0FyrT
Ro3uIQ/nnpw324mWVJgbjwDS+DE+qwvOyKTr9ezc2u6wKZVgXAU+ypDZV0eMREq/Z1Vo
EXuA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1791879245; x=1792484045;
h=content-transfer-encoding:content-type:in-reply-to:from
:content-language:references:cc:to:subject:user-agent:mime-version
:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=oAUohNgu9SSrZDroQ9BQ1lUYsCyK2OM4/OMeA6X2nw8=;
b=FiubB5m8HQG2dBkjFzZ4BIGL2ekit+bvzpP4tIXYEp0nAqPlq0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dEdbRd8W0DMrovmLSHmy6971uP0cTRht7c34GJ8w==
X-Received: by 2002:a05:6a00:4185:b0:890:a3ed:8a49 with SMTP id d2e1a72fcca58-897c7cd481emr10083173b3a.51.1791879244700;
Tue, 13 Oct 2026 01:14:04 -0700 (PDT)
X-Received: from [192.168.99.4] (i114-183-29-19.s41.a013.ap.plala.or.jp. [114.183.29.19])
by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-896c469d2a8sm4606502b3a.52.2026.10.13.01.14.01
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Tue, 13 Oct 2026 01:14:04 -0700 (PDT)
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-User-Agent: Mozilla Thunderbird
X-Cc: Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller"
<davem@davemloft.net>, Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
John Fastabend <john.fastabend@gmail.com>,
Daniel Borkmann <daniel@iogearbox.net>, linux-kernel@vger.kernel.org
X-In-Reply-To: <20261009040412.14571-1-jiayuan.chen@linux.dev>