Article View: linux.kernel.netdev
Article #13647Re: [PATCH bpf-next 10/15] xdp: warn on XDP_PASS with stored values when XDP runs on an skb
From: bot+bpf-ci
Date: Tue, 10 Nov 2026 04:53
Date: Tue, 10 Nov 2026 04:53
67 lines
11269 bytes
11269 bytes
--===============6368028081372406392==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
> xdp: warn on XDP_PASS with stored values when XDP runs on an skb
TL;DR: Comment nit in xdp_skb_ext_warn_pass(): the new
generic-XDP/BPF_PROG_RUN comment is inaccurate for BPF_F_TEST_XDP_LIVE_FRAMES,
which uses a separate rxq, and the next comment is now stale. Not a bug.
> diff --git a/net/core/xdp.c b/net/core/xdp.c
> --- a/net/core/xdp.c
> +++ b/net/core/xdp.c
[ ... ]
> @@ -1124,12 +1125,17 @@ void xdp_skb_ext_to_skb(struct sk_buff *skb, const struct xdp_skb_ext *ext)
> void xdp_skb_ext_warn_pass(const struct bpf_prog *prog,
> const struct xdp_buff *xdp)
> {
> - const struct net_device *dev = xdp->rxq->dev;
> + const struct xdp_rxq_info *rxq = xdp->rxq;
> + const struct net_device *dev = rxq->dev;
>
> /* The skb is built later from the xdp_frame */
> if (prog->expected_attach_type == BPF_XDP_CPUMAP ||
> prog->expected_attach_type == BPF_XDP_DEVMAP)
> return;
> + /* Generic XDP and BPF_PROG_RUN use the netdev_rx_queue xdp_rxq */
> + if (rxq->queue_index < dev->num_rx_queues &&
> + rxq == &dev->_rx[rxq->queue_index].xdp_rxq)
> + return;
> /* No native XDP, so only generic XDP or BPF_PROG_RUN runs on dev */
> if (!(dev->xdp_features & NETDEV_XDP_ACT_BASIC))
> return;
This isn't a bug, but is the new comment accurate for BPF_PROG_RUN?
With BPF_F_TEST_XDP_LIVE_FRAMES, xdp_test_run_setup() registers a separate
rxq embedded in struct xdp_test_data:
xdp_rxq_info_reg(&xdp->rxq, orig_ctx->rxq->dev, 0, 0)
and xdp_test_run_init_page() then does:
xdp_init_buff(new_ctx, TEST_XDP_FRAME_SIZE, &xdp->rxq);
so in live-frames mode rxq != &dev->_rx[rxq->queue_index].xdp_rxq and the
early return is not taken.
That also makes the following comment stale: generic XDP and non-live
BPF_PROG_RUN now return at the new check, so only the live-frames
BPF_PROG_RUN can reach the NETDEV_XDP_ACT_BASIC test.
Would something like "Generic XDP and BPF_PROG_RUN without
BPF_F_TEST_XDP_LIVE_FRAMES use the netdev_rx_queue xdp_rxq" match the code
better?
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/42755842687
--===============6368028081372406392==--
Technical Details
Message-ID:
<debeafe053a315dc6c0634d019ea48075d9f9f0c68b4395deed84a9630dc77ab@mail.kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359876-linux-kernel-netdev=dewy.ruReferences:
<15f830924c4d06d3d8c7e41fb8a9f8c29b63d9a7.1794281983.git.tianyi@cloudflare.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359876-linux-kernel-netdev=dewy.ru From: bot+bpf-ci@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH bpf-next 10/15] xdp: warn on XDP_PASS with stored values when XDP runs on an skb Date: Tue, 10 Nov 2026 04:53:09 +0000 (UTC) Organization: Usenet Network Message-ID: <debeafe053a315dc6c0634d019ea48075d9f9f0c68b4395deed84a9630dc77ab@mail.kernel.org> References: <15f830924c4d06d3d8c7e41fb8a9f8c29b63d9a7.1794281983.git.tianyi@cloudflare.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6368028081372406392==" Injection-Info: usenet.network; logging-data="524146"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:jyX70hAJ1CLXJvgWXQuPn80eIp4= sha256:3aSwozV3LDL3fd+IS6eHp9HJB7SeLuERCdJ1GP4a/v8= sha1:WIIcZj+bxfgrr1YygZvJ5mM/Z50= sha256:KDnoU8oZ30s5XqBOab6wwVT8HI43kzAT6QHnIYlXjlA= 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 042A9113A38; Tue, 10 Nov 2026 07:53:54 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3 X-Spam-Status: No, score=-3 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_INVALID=0.1, DKIM_SIGNED=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=fail (2048-bit key) reason="fail (message has been altered)" 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 XGWC4Y5X_W_I; Tue, 10 Nov 2026 07:53:49 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-359876-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 71620113A2D; Tue, 10 Nov 2026 07:53:40 +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 E0AA430EF6; Tue, 10 Nov 2026 04:53:17 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1794286392; b=4ibe3zJd2ZHzm1Cluhn6d1yELkTtq1MmoHDE4wk4Q+5pFdgaPW5vsiFpkWmA2URI1Ce0 93TmH5A/yivonvKe3yGw2DpMiCdti+UJ5Z3ye2LNINzJwgrXkK0o80l/Epq8xyYxO8Rpm 705j1UF//czeBoF8fhlwLSPMLukJVuGkuMw3vhBPJ0VyuGCg8ysDvxZMYtzk0FDy4B89G EVsfC+WulEfzfnpGtoi7VaJu/jcPCZp1C2KbbjSureVo+3Mq5aNkLXIqYJ2ujcCSbjmIp SELQaGmdlf/iEQdNYTLxUnejeN4c+SfQD0p44l+GEQmKtwQ96woRXcB4otfvZtczD2g== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794286392; h=X-Original-To:Received:Received:DKIM-Signature:Content-Type: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Message-Id: In-Reply-To:References:Subject:From:To:Cc:Date; bh=USevh6myHxF9emjydPOskkqmK7kqM8+0knzfuWzYf2E=; b=LlBdKQ4cMHc+I/4B6lsxUWIFv7iwVymLAjeJwYJHTquMTvYJ3e5LWw093JJQdimWkFOD RBeUKTdfgCAmTf3poOCLaNH1R9uuUcUKfDucBTeo54oDNNXtIsJmsLCOvtLtM3xoJIejA b7ocpKrsu0xlWAU4v5TnIYQ+dqMRoGmCQNZVYgEmGxMlDwrf9cULTovHHMsd2j/xpIEBZ /2tu62/6MZh3YZSBz1LcjnlKZP7XuZA0U8ycvQZqhLs4p6nemRdU1H8owQRZ1Mut3HZxh rNKFfJ/xM+0rhG7w7IHqfH2SgyicahttUEn43ilBZuxj/c2tQdH7iz5GksXJArZDh7A== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bS8QK0uX; arc=fail 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 5BB4960A2608; Tue, 10 Nov 2026 04:53:12 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bS8QK0uX 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=1794286391; b=hPnsXt+yrw3jlTiJoyaHnCooCXlFjsMKCq47uKqpXTLE1rbNanyEnKiIGoKr9/Uq0oB6 MrKWl7WiN3GJ94xtw0T9ZmVnq0J8+R99fMoXe0f6vsZoV11BxWyuAbtu7iBwuBYWVOoqC KiMz0g3FQC+ttruRU3lpPG5zJYDR0Mh/R9qQqdNRx8fT+aeU3Ke9o5EXHaxr+oaOiERsC U1w7HGIa195gLnVuH+9FtGH4qbJWtCQbiolvbm1zZKs/jKQ62Tahe+IBk2SP8IoN/xdLK BStNjdZPDjyIoLXVxhWs5i2CowS0dbd+AbQYmg1fE/oRAuF7laFxPpaOB/5NG5V6fvQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794286391; h=Received:DKIM-Signature:Content-Type:MIME-Version:Message-Id: In-Reply-To:References:Subject:From:To:Cc:Date; bh=USevh6myHxF9emjydPOskkqmK7kqM8+0knzfuWzYf2E=; b=UdbQNvq+AhNQllKRfthI7cCVIN5kWaDmoIjPhYdr4zdr/6EViUlBv9OaBn+7y7KOl3/h HQprTnPL8lC5WIXb4Ogd7ZF2jSCn4JvHWBEr/Yj5fRuy3iF4a2KzP6wGb650mSRSclx3r lsaih7NgTxgzqfN06Ed/XsY/vX77Idhw6BdTOEyVYIMrdc7e494ZqwoM5luei8r4RmCul fwdmIx+4PLqAr3hOiHrMdU8dpaB+2YiHR9xWMlSMaKS0JJR5ff+qaQIRVY5NPPUxXQXeB qxzhD6BcHsqVG6AlV7HkYaGVFiESXmBjBFIJUHDDiWHzM10cejw0E0GsfAlOdZ45mYQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bS8QK0uX; 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 31F06606A31C; Tue, 10 Nov 2026 04:53:10 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE1361F008A5; Tue, 10 Nov 2026 04:53:09 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794286390; bh=USevh6myHxF9emjydPOskkqmK7kqM8+0knzfuWzYf2E=; h=In-Reply-To:References:Subject:From:To:Cc:Date; b=bS8QK0uXH4CiE/pecLjA47r/58HoMdCcVoCr2Aj5ZbqYX8FUfQZw+zR3zouV2mNmK P0Ggop74FtzZ/noDXpDOmBsU8LuIgDwsRcOwIQBKYfTvnSFlvYyQp6mhCsrJj19i4E 8AtFDqwQo6XuCCnMThbj3A/mquKdc778AaGUdSGFxFPfR9Cu+cvr37erupKdTLZRUZ slkziQBQN18Ol9bonmpQusu/LLhK4gYdx+hgOYyYs6truDVcFXoA9KNDzIfFgeEexk mh+SsRfu9Yhsgls4oSul1YEhpSfuBnkutavrJtXalAsKNTjUPk5VxJ5Nr9VxAgQYoD qETaCtYdWvXGA== 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: <15f830924c4d06d3d8c7e41fb8a9f8c29b63d9a7.1794281983.git.tianyi@cloudflare.com> X-Cc: john.fastabend@gmail.com, sdf@fomichev.me, lorenzo@kernel.org, deliran@verdict.gg, davem@davemloft.net, edumazet@kernel.org, pabeni@redhat.com, horms@kernel.org, andrew+netdev@lunn.ch, donald.hunter@gmail.com, eddyz87@gmail.com, memxor@gmail.com, song@kernel.org, yonghong.song@linux.dev, jolsa@kernel.org, emil@etsalapatis.com, ihor.solodrai@linux.dev, anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, maciej.fijalkowski@intel.com, aleksander.lobakin@intel.com, magnus.karlsson@intel.com, tushar.vyavahare@intel.com, kerneljasonxing@gmail.com, razor@blackwall.org, madalin.bucur@nxp.com, ioana.ciornei@nxp.com, corbet@lwn.net, skhan@linuxfoundation.org, shuah@kernel.org, rdunlap@infradead.org, nathan@kernel.org, ndesaulniers@google.com, morbo@google.com, justinstitt@google.com, carges@cloudflare.com, jakub@cloudflare.com, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, intel-wired-lan@lists.osuosl.org, llvm@lists.linux.dev, kernel-team@cloudflare.com, tianyi@cloudflare.com, ast@kernel.org, andrii@kernel.org, d@smtp.subspace.kernel.org, aniel@iogearbox.net, martin.lau@kernel.org, eddyz87@gmail.com, yonghong.song@linux.dev, mason@kernel.org, ihor.solodrai@linux.dev