🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #18196

Re: [PATCH bpf-next 00/15] xdp: add SKB core extensions to keep RX metadata until skb creation

#18196
From: Jakub Kicinski
Date: Wed, 18 Nov 2026 00:18
57 lines
12513 bytes
On Mon, 16 Nov 2026 23:55:42 +0000 Tianyi Gao wrote:
> On Mon, 16 Nov 2026 14:27:10 -0800 Jakub Kicinski wrote:
> > The question is _why_ you use it. Let's leave the cpumap case aside,
> > you provided no legitimate reason why having an XDP prog in that case
> > is a problem. With veth - you are right that attaching XDP causes
> > problems for pure skb traffic. For veth cases, however, there's no
> > strong reason to delay the skb allocation. Hence my question.
> > Why not let the driver allocate the skb if we know that the
> > redirect target will need to allocate one, anyway.  
> 
> Sorry for not being clear enough.
> 
> On the setup we want to build: an XDP program on the NIC does the
> decap for all traffic. The services run in namespaces, so the packets
> must be delivered into them. Some services attach their own XDP
> program to the veth, and some do not. The host does not control the
> service's program.

The host doesn't have to control the program, just know whether the
program will be attached, and therefore whether to use TC or XDP.

> For a veth with a program, the skb path has the problems you mention,
> so the host uses XDP_REDIRECT. For a veth without a program, we want
> to use XDP_REDIRECT too, so that the host delivers to every namespace
> in the same way.
> 
> In a minimal benchmark, pktgen sends UDP, and perf stat counts the
> cycles on the RX CPU. bpf_redirect_peer() from tc costs 3% more
> cycles per packet than XDP_REDIRECT with the checksum status kept
> (mlx5, one extra __netif_receive_skb_core()). So one XDP_REDIRECT path
> for all namespaces is both simpler and cheaper.

That's noise.

> > Since your patches are not a natural / clean extension of the existing
> > infrastructure - we should step back and make sure the use case is
> > practically justified.  
> 
> Maybe I am missing something here. XDP_REDIRECT into a veth works
> without an XDP program on the veth. To me, it is natural that the RX
> metadata also reaches the skb on that path, without attaching an extra
> XDP program.

Sure, nobody is arguing whether in an ideal world the metadata would 
be magically available everywhere.

Inventing a new way of storing metadata (either in this set or Alexei's
simpler proposal) doesn't integrate naturally with HW drivers.
And duplicates the information. Fast packet processing at HW drivers is
the primary use case for XDP, we should keep that front of mind when
designing.

You want to cross from XDP realm to skb realm, after frame left the
scope of the original driver, and with no BPF involvement.
These constraints are unreasonable, and leave only clumsy and
inflexible solution on the table.
Technical Details
Message-ID: <20261117161856.6f6c2ce9@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365733-linux-kernel-netdev=dewy.ru
References: <cover.1794281983.git.tianyi@cloudflare.com> <avOvI8xrHI0dwyHj@devvm16445.scu0.facebook.com> <CAG4wq-egD55NZDw+OKVKTKN2tQJ9oKEC504wFv=xoMXyJ-0z4g@mail.gmail.com> <20261115113902.4834dda6@kernel.org> <CAG4wq-dhd5a5zxQcSShaKifYd2z+pMpHaCYtZJRX1QCxEH4dfg@mail.gmail.com> <20261116142710.347e8571@kernel.org> <CAG4wq-cDYa2GkpWSYeOLwEPv45BtucZk+r=N2b1Srd=gUUO4MQ@mail.gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365733-linux-kernel-netdev=dewy.ru
From: kuba@kernel.org (Jakub Kicinski)
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, 17 Nov 2026 16:18:56 -0800
Organization: Usenet Network
Message-ID: <20261117161856.6f6c2ce9@kernel.org>
References: <cover.1794281983.git.tianyi@cloudflare.com>
	<avOvI8xrHI0dwyHj@devvm16445.scu0.facebook.com>
	<CAG4wq-egD55NZDw+OKVKTKN2tQJ9oKEC504wFv=xoMXyJ-0z4g@mail.gmail.com>
	<20261115113902.4834dda6@kernel.org>
	<CAG4wq-dhd5a5zxQcSShaKifYd2z+pMpHaCYtZJRX1QCxEH4dfg@mail.gmail.com>
	<20261116142710.347e8571@kernel.org>
	<CAG4wq-cDYa2GkpWSYeOLwEPv45BtucZk+r=N2b1Srd=gUUO4MQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2461911"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:mEhP80FbMEuntFxqEMy/wY6PgL8= sha256:+dlrvMfBYbQnkiDyNeeWkLTrGgqxaJ7aD5ZI9S/e804=
	sha1:EGFsobxl4Y2ymsF30HPMO9Mj0Es= sha256:u/uPinGCpp6ztuGTaXKAWxBksIJ61RqoBeLlWhWr4Xc=
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 AE46A115111; Wed, 18 Nov 2026 03:19:25 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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 OU9hMvY_znqE;
	Wed, 18 Nov 2026 03:19:20 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-365733-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 EE4BE1150BC; Wed, 18 Nov 2026 03:19:09 +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 200293D95B; Wed, 18 Nov 2026 00:19: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=1794961145;
	b=BT9eK4OHQyHhjtMJKKIB+V4XdAS78HTp9g1IZ45OTlgXm3RNJ0Yp1p8gncVVIMhWXhYM
	 DGOu0fF9ydJg7HcNENA/B163PVok83096TKRSkHGusTOPcS53TAQa7/HDAJERPY/JYSIl
	 qVsFHGsJKCS3r+ZMd79nYH73ugJVZCkjwAg0pF5CftKrGtnLkrPj+7Ft8lAjysFeljzAm
	 /m5kTWGK4oH6orwIKlhjxy5AX+WEOMxZ9mrMlKUOTZps+20Do7DfaC8V+cNTu3BwCwAh2
	 3COxfn6Ah6StQbDE9A6vwHABo7fG6/EBUwkHttwR897RmHc2xwSZj9j29vord1syLxw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794961145;
	h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc:
	 Subject:Message-ID:In-Reply-To:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding;
	bh=CiaEOlN3DliPTegWH/OxBrR4pZjxHdFZsot9BUcRetk=;
	b=IeXfD18puScRo7AANsTmufKFUSEEXVNYnAfT3uJcKiBptiU7RWjay6jozcOI5e6LzmyJ
	 YYpxtW4wsJLsizpGStWFfIRNT21FmYLialWmcP+WMZHoWyh0gVNcgbecCjbbGtQ+4MKzi
	 MLCcs/oshRtoXZf18RJwd3bqto/BuPZ4kDqYF0OP7vlkHhtdslHmpuwpR8iEQIOTrFt6M
	 BmuZyTKiq+4AYztFGlF2xeBQfVcyk65xJk6ktr1OnNMQxLYAn2jCXwAcHfp8lt9kMRa//
	 2HHKrCI4xDCm/kcsZ5xOLX8jAxrJU6pOMBffS7xUPgRUM0EkBIfKW6/+QH2665fpIlA==
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=H8Z8uMXb;
	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 EAFA8606A32C;
	Wed, 18 Nov 2026 00:19: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=H8Z8uMXb
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=1794961139;
	b=ycetRm9mOKvVWIkbNAKlQcPJalOhohwBanQt/vT96KaGbaQbPggryirZjI7KRybcTR72
	 nZOeJeW0uw8c+iZnyqhMW6gsHRmgkgyFSs/wcCVnX80uG7HUOfVASBU0vEj9rh+PEm5WW
	 LiWHjuAjY61KOm5EWMtPmxPYdjvKGFK3He8FmxXDuKu69XyO2UpboGllBoKK33luwV6t9
	 QfMfq1cPhW0SE8vxW1RreeAXtLTcjNwpx4fnzNOxSl8I1cd9PbnnwjhDESEnBKlNSnKio
	 daWuVC/+xacEJVpdbv2FarTtA3w8lJ2ddMp4LPWdlYN4lqAY3GqFz5lXIEoWpjHktgQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794961139;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 In-Reply-To:References:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=CiaEOlN3DliPTegWH/OxBrR4pZjxHdFZsot9BUcRetk=;
	b=XKENBPHq0z4ErIxwmA29C4NrvQSsaNd6NOT6B9z1WPgmAw8DEkPrYft1JuCAxZ9yE+7U
	 NadVtN5EErxZ0fwg8NXPKnsiso0jX6S429tdjFMvfEe+cjLTyKcr3IeRL74UMd+7ii4w7
	 BCCxhoWlQhwqXoIUJ6oZyxkpH6Oj0MA4hjPYz97+7+UskHuEiblkbI9uaOkFNF2kEJqra
	 1AtT/ey2mBj6u446TSrnhStUa/bdmrbGecbpvMHAMyqXiGSIQH9b6/NqtWcB/hcZf8VPI
	 VpBZ8jx4sHxjVRmdwIxcUBZTHbGdgsqdVCTH8qq+3/lkPG01jB6LygAidfIKZ4UDXng==
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=H8Z8uMXb;
	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 10D79606A31C;
	Wed, 18 Nov 2026 00:18:58 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 117E81F000C4;
	Wed, 18 Nov 2026 00:18:57 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794961138;
	bh=CiaEOlN3DliPTegWH/OxBrR4pZjxHdFZsot9BUcRetk=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References;
	b=H8Z8uMXbbN46/Dz3D2RrmXrHgVu5ybahMNNXc49qnRx6z5esm+e9cQXQNXAkFRcrN
	 XjmuwGX7gj9Rh1y79PoI4NaK0mLI3lCX73yjdRDoB+D1y1WklzIy2e8f9mS3q4u+l/
	 dLFiO9fYL3E7KTmVPPiOfWsjTNhS0YMv7GMyaIDCQ+pKEm8Lgacu/lrndDp8B7MNLx
	 YwMbpf7AFMyuj1PqggDvwly759kt51eULOFCZw2i7JDZG6WT+TRtdZa0B7IB2fTULb
	 hB4c/bZDmJWQPPjQJHU2uC878bQxQs4xyl6w8kaik3Dq8UI1RItPx7q2mDRwt/utdd
	 +sV71LPdCs9XQ==
X-Cc: Stanislav Fomichev <sdf.kernel@gmail.com>, 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>, Jesper Dangaard Brouer
 <hawk@kernel.org>, 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, Tianyi Gao <tianyi.gao@linux.dev>
X-In-Reply-To: <CAG4wq-cDYa2GkpWSYeOLwEPv45BtucZk+r=N2b1Srd=gUUO4MQ@mail.gmail.com>
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