🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26410

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

#26410
From: Jesper Dangaard Brouer
Date: Thu, 03 Dec 2026 13:58
50 lines
12125 bytes

On 11/18/26 01:18, Jakub Kicinski wrote:
> On Mon, 16 Nov 2026 23:55:42 +0000 Tianyi Gao wrote:
[...]
>> 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.
True, the host can know. But TC does not fit our setup, because it
builds the skb on the isolated RX CPU. The reason why we avoid that is
in [1]. With bpf_redirect_peer() it is even more work: the RX CPU also
runs the whole receive path into the netns, up to the socket.

bpf_redirect_peer() is great in a micro-benchmark, where one CPU does
all the work. In production we handle much more concurrent traffic.
There we split the netstack processing into pipeline stages: XDP on
the RX CPUs, the skb and the netns stack on other CPUs. This scales to
more CPUs.

[...]
>> 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.
Agreed, but the test measured the wrong thing. veth runs its NAPI on
the sending CPU unless NAPI is threaded. So both paths did all the
work on the RX CPU, and the test compared two ways to do the same work
on one CPU.

The number that matters is the cost on the RX CPU, with veth NAPI
threaded on a CPU outside the RX set. I will work with Tianyi on a
better test that shows this.

I answered the rest of your mail in [2].

--Jesper

[1] 
https://lore.kernel.org/all/f4bc8388-e4b9-4451-bbd1-9f5d0a86256f@kernel.org/
[2] 
https://lore.kernel.org/all/b3e67ffc-5610-4598-9291-ee0264983a4a@kernel.org/
Technical Details
Message-ID: <c3fb44fb-e2f6-44f8-a8a5-706bcf0796c6@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376644-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> <20261117161856.6f6c2ce9@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376644-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: Thu, 3 Dec 2026 14:58:56 +0100
Organization: Usenet Network
Message-ID: <c3fb44fb-e2f6-44f8-a8a5-706bcf0796c6@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>
 <20261117161856.6f6c2ce9@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2507546"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:uemBI1KuyQWrGNDfu5arpT52bXM= sha256:5NUGsu4pJ8ltoSSLa6BkYgEz4PMLz66+Svy+Ajj7kgs=
	sha1:XKu2x1QvS92iGDYQjoyf74mXgu0= sha256:1g/7V7AgopMJBKIWmwK1Pw+qCHtXXd0SQBytTXHlbBA=
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 732B611796F; Thu,  3 Dec 2026 16:59:25 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.64
X-Spam-Status: No, score=-3.64 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, 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 VD7JYhbATzMf;
	Thu,  3 Dec 2026 16:59:22 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376644-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 8BF5D117960; Thu,  3 Dec 2026 16:59:12 +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 D6B942CF98; Thu,  3 Dec 2026 13:59:08 +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=1796306348;
	b=hZBNzOLoird/yUK7ionLNta6aS/0djP76y5+b8fUMwPx6z3tKo4C4lO5deuuW11jva5S
	 LPfWjNlkeWM/dq89pFSCpK/Vjgf+qSQQbuEiypi9gA5Wdbeeyoo6JJgOmvMqbk8R1NxPU
	 aw3JbB/iZMFQw2xUdebHrPlqH4SoYDkJEyFdL072Exi9gmvcAwAUcjrbQmqj4kP9Gm0VZ
	 8pq4Voq3w1KzLTsyCPIYeaUOo2lEr+Zxs/jLcI1Vceh+cuiO4FtcZ9MSVUE9MKMkQ434S
	 UJOFjaUGHg7QeoLhQ5oxLuFNAev89/aY5xPiv9cArBKTbqeiMXpxZQszjex6U4P4kXQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796306348;
	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=iTL0vO7EYdo9tosw/Thg7EKMpx6I6Vb5FgG9sWuxWq4=;
	b=iTkO/D7ANQy4qiGlFJ/DO5pNwPZXe+qsQEVoRUbWQuiOmkcM3CzspSgC7FiEX6ubEKvI
	 67lA4ZeldM99Vto9gxIKBckp8j7rVjp8OMRpaho9jApjTFzWcafk5B4y9dNb+D8LXj75r
	 Aoncqylwpvm6ywXW1sifbHsV5XUg/Sx54D7TvnBktHx9stGNKB1cwt4xHc1DpFOQA5xvB
	 AMBlsn4eUg1T5+NqUZF9/fH1L9DpSjRaUjdz+ey/bFO/AcsM1IGv5RDZAUPprFN3PIc+H
	 7LDpOB/p2V1Azsd5HnT5llzKX+dfsjc8JUNxthE4RtiRu7L1TyCtZKaI+lEvOVP8ukQ==
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=WcvGyWtR;
	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 AEE97606A32D;
	Thu,  3 Dec 2026 13:59:08 +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=WcvGyWtR
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=1796306347;
	b=MWsAss9dxuTRpM38WxpHbwszVUmeJqrpNBiX0yi68tfNxT7hf1NHDLCIDjZwodkljFOC
	 9S4e+N4WsPrwXmMpMBkbFhva8aDeKt7qzGrI8JYSMs3UlQcxNaoeebDEu/AdtWu//+CSm
	 1WnAV/J7WuYDpyMFh8G1rAHSJLpLr0cjeDvBBiaezNimYOrlSPLTI6/U3hUL2o5xfutLS
	 VFLHSB5/Z6teVvCDdZGWQao5NevZshRKB1M+OjWw63mjjG7MOj8ELzw6ehuCzxVXhiQsi
	 SBCk/bpvS9sMEvR2ZwG1mAoxt6J5HbaMIIz7PSxG2WqID8sWcgrXTnjGeh+CkPnf6tQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796306347;
	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=iTL0vO7EYdo9tosw/Thg7EKMpx6I6Vb5FgG9sWuxWq4=;
	b=WkJDgt39V7rVL/X+0bX47aqP20Y12muD4i9jU7LE4qu8gHMUHhp+31ejSEUkgU4HsUSj
	 J7SPjBg7YemRIW0fLCO7uw7/rxbusbRnrRKOeRpskXUte/7v3esgGCelUE++Ubu70VnkH
	 Y8ye8I+cGzvodg5Q9sZbcuZpwyv4yVILrc5rPfpbWslzQlV5t5shGXVBgvj9CLnsOYrjV
	 FE5erNKA9i6B9hAhCZC0biNXAc0OpE5TULFXFCDkedCJaCPcz+GTNhX8sBXsi+cuIXj0N
	 QM55Q21vFA2KowDoYuP+SKViByD1Ws9aTXiCCfVpAwU31wced6Kyfprk5lVNkIZStCg==
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=WcvGyWtR;
	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 CB644606A32C;
	Thu,  3 Dec 2026 13:59:07 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 963B21F00893;
	Thu,  3 Dec 2026 13:58:58 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796306347;
	bh=iTL0vO7EYdo9tosw/Thg7EKMpx6I6Vb5FgG9sWuxWq4=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=WcvGyWtRlWlvfkKmOgwrGsMneMseY/TQsYXYeAyXSFS3kUfU3yu5kYhAY/TYjmOj9
	 psbx6BM7OHYgh+WTtR/M3bwTktBTU0c/CmRbkzZMVA64iuHXFCDdOmiMgKLl6SDs3E
	 mRUj9IevN73fAFfoP2t066n+tXTeq/+o7voSFQXdBZcK6SvJ4MIB7YYrt16Z38COVB
	 PYQLOOALF0sbVxD+CxcK6VefutENHILtcFP7T28ffcsnAsfqtizo++RI9Sxd+EljxH
	 L0afSAeucsxnquS1BHehHQHFTh4a1HJ0sJx5iudwc0O46B28ertinsGBtBmpuCHm9k
	 YpABqcaQuXC+A==
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: 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>,
 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: <20261117161856.6f6c2ce9@kernel.org>