Article View: linux.kernel.netdev
Article #25312Re: [PATCH bpf-next 00/15] xdp: add SKB core extensions to keep RX metadata until skb creation
From: Jesper Dangaard Brouer
Date: Tue, 01 Dec 2026 13:57
Date: Tue, 01 Dec 2026 13:57
58 lines
12256 bytes
12256 bytes
On 11/12/26 00:46, Tianyi Gao wrote:
>
> On 11/11, Stanislav Fomichev wrote:
[...]
>
>> and slowly creeping more features into xdp making it
>> more and more like skb.
>
> I will leave this to Jesper.
>
Stanislav, you made the key point yourself: an XDP prog that changes
the packet needs a way to correct the HW offload info [3]. After a
decap, the outer csum status no longer holds, and today BPF cannot
flip it to NONE. The prog also cannot change a stripped VLAN tag.
So this is not a new feature. It fixes what Jakub called "a known bug"
[6]: after XDP changes the packet, the HW offload info is stale, and
XDP has no way to tell the kernel which part it changed.
And it is not another metadata area. It is part of the xdp_frame. In
Alexei's sketch, struct xdp_rx_meta sits right after struct xdp_frame,
in the same cache line, and flag bits in xdp->flags say which fields
are valid. It also has the same life as the xdp_frame. The prog writes
only the values it changed. In my proposal [7], the driver fills the
rest after the prog has run, and only for a frame that survives XDP.
So XDP_DROP does not touch it, and XDP_DROP performance stays the same.
data_meta and this area have different owners and different readers:
- data_meta belongs to the BPF progs. They define the format, and
BPF progs (XDP, TC) or AF_XDP read it.
- This area belongs to the kernel. The kernel defines the format, and
the kernel reads it when it builds the skb.
So they do not overlap. The kernel cannot use data_meta, because it
does not know the format.
A driver-local setter would also work, but only while the driver
builds the skb itself, on XDP_PASS. It does not work after
XDP_REDIRECT: the descriptor is recycled, and cpumap or veth builds
the skb on another CPU. And it cannot support the mini-SKB direction
[7], where the driver hands the xdp_frame to core code, and core code
builds the skb. Core code cannot read driver-local state. A
kernel-known area works in all three cases.
On feature creep: yes, the xdp_frame grows towards a mini-SKB. But it
only gets the fields that the skb needs from the HW offloads: hash,
VLAN and csum, and later maybe RX timestamp and RX queue index. These
are core skb fields, and they rarely change. So the list is short, and
it stays short.
--Jesper
[3]
https://lore.kernel.org/all/amEojEGsIGkUjIWn@devvm7509.cco0.facebook.com/
[6] https://lore.kernel.org/all/20260722113525.34092660@kernel.org/
[7]
https://lore.kernel.org/all/b3e67ffc-5610-4598-9291-ee0264983a4a@kernel.org/
Technical Details
Message-ID:
<d58cc9d7-e07f-4fef-aaa4-4faa9f5f6531@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375135-linux-kernel-netdev=dewy.ruReferences:
<cover.1794281983.git.tianyi@cloudflare.com> <avOvI8xrHI0dwyHj@devvm16445.scu0.facebook.com> <CAG4wq-egD55NZDw+OKVKTKN2tQJ9oKEC504wFv=xoMXyJ-0z4g@mail.gmail.com> <avTqb--WfUNBcEyN@devvm16445.scu0.facebook.com> <CAG4wq-dw8VqiVTbi-fSJTnwj+amkfE_56ndKCYk4v31z2ppcTA@mail.gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375135-linux-kernel-netdev=dewy.ru From: hawk@kernel.org (Jesper Dangaard Brouer) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH bpf-next 00/15] xdp: add SKB core extensions to keep RX metadata until skb creation Date: Tue, 1 Dec 2026 14:57:51 +0100 Organization: Usenet Network Message-ID: <d58cc9d7-e07f-4fef-aaa4-4faa9f5f6531@kernel.org> References: <cover.1794281983.git.tianyi@cloudflare.com> <avOvI8xrHI0dwyHj@devvm16445.scu0.facebook.com> <CAG4wq-egD55NZDw+OKVKTKN2tQJ9oKEC504wFv=xoMXyJ-0z4g@mail.gmail.com> <avTqb--WfUNBcEyN@devvm16445.scu0.facebook.com> <CAG4wq-dw8VqiVTbi-fSJTnwj+amkfE_56ndKCYk4v31z2ppcTA@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="1728016"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:00lxSBvXE14wAI9Z+P/Rrx5RGlA= sha256:TyV4P0z0fjxJ/RcaLWDD2rHtl4zQRH9JHAObj2eRnM0= sha1:TbEOsOdzRrHpm1l4qBEyNBFOnY8= sha256:PCEegKwtCFfwc5lI1onsADt5oHiDJceO/KM3BixEJNg= 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 CB4161173CC; Tue, 1 Dec 2026 16:58:18 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, 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 0Lion_lCe7Wa; Tue, 1 Dec 2026 16:58:15 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-375135-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 389DF1173C3; Tue, 1 Dec 2026 16:58:06 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 8FECC6021FE; Tue, 1 Dec 2026 13:58:05 +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=1796133484; b=G5L6uXLvCCj5TPErssB/aQOBrR/T0QiV/nepL7wefixbmEBAkivEMp3P7mvlja3tpaOl U/y7fWykS1laM/xZv+YCaMfHlHgGrFI9E9yZ2adxZz/2JQWfJXclwrwSCmd4ERKj9UnD7 ZzhbXURfY3IIdJbHQLJt3WiYq/INEngbGk+ZS+wzA/4tnLUj6OQVEDoDidNTEhmvTyRfd rks7o0vcET30oQr5WwzgfOJb16ju6ypuss6wkBaE8+g2HgrJ/ogLCf4ppzaFFIp/i+uKH dRB4o5ws2zG3u9PiCq5AdrJe3YVcm0DqOWRFEycjLfDLwjYu7kt3yOV7mcl4FaBgaAg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796133484; h=X-Original-To:Received:Received:DKIM-Signature:Message-ID:Date: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=b6BcLorqh6FnBWb/McwVoCB6fyYHx4Px5fdpq17GoKw=; b=qJQIl1zAEpxWTcB9nuZ6JPHUlqwrLdb+leQJqDV8wm6wdvsVIVr+eM/tF508qnpMsN5w NRErW4V6/DmwyaXn1Yu3CYyaa6U71bK9Bq0i8cnAk40rkKSauAvUOVPEZDclBN3VsQkkR GOHz/+o3NHSchkkL5FrPkXjfaMvKW3I7GCmSUzwtGoqAO6bW3HQve9zZR32vW0kK2Q17B 0VbLkpr2d3Ticw0o66pSPUKHcg8nQ6FKouVXiCYhnL9cP7w9xlM7hToWVqyeYjfVSrIs7 eaI1CxTyEGbuMuU75uFqOrnGLUaiLE2K3KoAbhQ94Ue2+31gNnyTkGr0mineDCvhksA== 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=mpsucTkt; 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 B82ED606A334; Tue, 1 Dec 2026 13:58:04 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mpsucTkt 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=1796133483; b=1nRE4buYbJPClurmDk96k1UiYhVtyYWyjokECzXAwvGh/VMM9RA//1ByUiy8TlEo2TMu KDsx2w8qndpGx/0YjvCfMb31tu897LSv3svG8FlUwM+tPkwXV9+hsR0adNC7lyqtyYBrg I5Qtr1PMMNWWLvFTyauDa3+o619NN2t2LaIsL1b6pI2pQ6ClO7re93er2QYkKREXnAZML vC5AX5MfKooo53VxLCs5rVn7JC7NWX3LHn24KtTmnPkkD0ustW9jWdymVL8L8JFV8OlrU cSt3E7Oksjwz3/6oJ4+o0jWtYAl/bh9QEyQMm0SQQ6sESXrv9WK9hyupNw9/yalc5PQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796133483; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=b6BcLorqh6FnBWb/McwVoCB6fyYHx4Px5fdpq17GoKw=; b=lvy8JBbHpb944Koq/rHnl6YgIMFVz3FNXZmQEkcdXojVW/JdLFif94xDYRq/r6mbEERe TlkP4UpH3+skI0Zk+l+9H/23P8PxT/eNwuTJZZ64Xtw699diUuUDs8ZGOIv9HC/ZmXwEk jZuNfnb6/GB5zL8khOuAP8ont0hVTf7CDDoNpGHoEuu3mmaAPy6cqND4Rvnnpipkxzo7X jyP4T7GWqb6joGqNXRAFPCJHkS1Yn+5/APe3bvggDuOG5q+WxHeJ2EPRAKEbyC8IEzFXr Ou9fl+PAdw+uiTyMizFG6ZpuSlNMehsWICHBxlLr8R9iItDLoAKBz8fiP5arwI9cw/g== 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=mpsucTkt; 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 D4351606A31A; Tue, 1 Dec 2026 13:58:03 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CCD31F008A0; Tue, 1 Dec 2026 13:57:53 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796133482; bh=b6BcLorqh6FnBWb/McwVoCB6fyYHx4Px5fdpq17GoKw=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=mpsucTktj6mO8MvWP6aSCL9FAuQu1cZnYAIIGlHR5BYv/+xtP9Y6SEBbCkyGpoIlr WGEFjaMu9WJT7F8VhdchPxb8PrbBCYEcXQ0kxpfFqMwpv1t2DnvWGaaeAotzCFT+0c +JTBvfD7Cx5AKTlaN2o6kQRRWjiXMPhANc9BlQpnjkRATPUHBvHUIqkQULhSUbjwMO CBYPGZqH3tfjGrTLfiMi9wkfXKvn2VQNza6Yc0Ri5frS0SQNqHLih2RlTzqQ5IPhfX OLx3iHQzwo/CeSD2b5IbjzmwlPpkR3yjPazJWEpH1Lwnl3KDmXOuZkRIQi9ZVzHrz8 EFxamiOnrZ58g== 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-User-Agent: Mozilla Thunderbird X-Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>, Martin KaFai Lau <martin.lau@linux.dev>, John Fastabend <john.fastabend@gmail.com>, Stanislav Fomichev <sdf@fomichev.me>, Lorenzo Bianconi <lorenzo@kernel.org>, Vladimir Vdovin <deliran@verdict.gg>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, Andrew Lunn <andrew+netdev@lunn.ch>, Donald Hunter <donald.hunter@gmail.com>, Eduard Zingerman <eddyz87@gmail.com>, Kumar Kartikeya Dwivedi <memxor@gmail.com>, Song Liu <song@kernel.org>, Yonghong Song <yonghong.song@linux.dev>, Jiri Olsa <jolsa@kernel.org>, Emil Tsalapatis <emil@etsalapatis.com>, Ihor Solodrai <ihor.solodrai@linux.dev>, Tony Nguyen <anthony.l.nguyen@intel.com>, Przemek Kitszel <przemyslaw.kitszel@intel.com>, Maciej Fijalkowski <maciej.fijalkowski@intel.com>, Alexander Lobakin <aleksander.lobakin@intel.com>, Magnus Karlsson <magnus.karlsson@intel.com>, Tushar Vyavahare <tushar.vyavahare@intel.com>, Jason Xing <kerneljasonxing@gmail.com>, Nikolay Aleksandrov <razor@blackwall.org>, Madalin Bucur <madalin.bucur@nxp.com>, Ioana Ciornei <ioana.ciornei@nxp.com>, Jonathan Corbet <corbet@lwn.net>, Shuah Khan <skhan@linuxfoundation.org>, Shuah Khan <shuah@kernel.org>, Randy Dunlap <rdunlap@infradead.org>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Bill Wendling <morbo@google.com>, Justin Stitt <justinstitt@google.com>, Chris J Arges <carges@cloudflare.com>, Jakub Sitnicki <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 X-In-Reply-To: <CAG4wq-dw8VqiVTbi-fSJTnwj+amkfE_56ndKCYk4v31z2ppcTA@mail.gmail.com>