Article View: linux.kernel.netdev
Article #16738Re: [PATCH net-next v1 11/11] eth: fbnic: Support AF_XDP page pool zero copy
From: Björn Töpel
Date: Sun, 15 Nov 2026 18:59
Date: Sun, 15 Nov 2026 18:59
70 lines
12449 bytes
12449 bytes
Maciej Fijalkowski <maciej.fijalkowski@intel.com> writes:
> On Fri, Nov 13, 2026 at 12:40:09PM +0100, Björn Töpel wrote:
>> Björn Töpel <bjorn@kernel.org> writes:
>>
>> > Maciej Fijalkowski <maciej.fijalkowski@intel.com> writes:
>> >
>> >> On Tue, Nov 10, 2026 at 11:20:32AM +0100, Björn Töpel wrote:
>> >
>> >>> @@ -538,6 +547,13 @@ static int fbnic_bpf(struct net_device *netdev, struct netdev_bpf *bpf)
>> >>> {
>> >>> struct bpf_prog *prog = bpf->prog, *prev_prog;
>> >>> struct fbnic_net *fbn = netdev_priv(netdev);
>> >>> + const struct xsk_rx_check *check;
>> >>> +
>> >>> + if (bpf->command == XDP_VALIDATE_XSK_POOL) {
>> >>
>> >> do you really need a separate command here? why not rely on existing
>> >> XDP_SETUP_XSK_POOL ?
>> >>
>> >> here it doesn't look like things being validated are something unique that
>> >> you could not check during XDP_SETUP_XSK_POOL and XDP_SETUP_PROG.
>> >
>> > I'd like to keep it. XDP_SETUP_XSK_POOL means "set up driver ZC for this
>> > pool": the driver maps the UMEM and restarts its queue, and the core
>> > WARNs if it didn't map. A provider driver does neither; it only says yes
>> > or no, before the core maps and installs anything. The same question
>> > comes up on MTU and program changes of a bound device, with the new MTU
>> > or program, which XDP_SETUP_XSK_POOL can't carry. One command keeps that
>> > in one place, and v2 runs it from the core MTU path too, so a driver
>> > can't forget that case. This is only a burden for the core.
>>
>> Thinking more about it, maybe I can drop the callback altogether, by
>> doing what devmem, io_uring zcrx and tcp-data-split already do: the core
>> refuses a setup that can't work, instead of asking the driver.
>>
>> The driver only judges the chunk size and headroom, in
>> ndo_validate_qcfg, which the queue API already calls when it installs
>> the provider, with a new bit saying the buffers can't be split. A frame
>> of up to the chunk size (minus headroom), then lands in one buffer, so
>> the core checks the MTU itself, at bind and on MTU changes. And like
>> tcp-data-split, a socket bound with XDP_USE_SG needs a frags XDP
>> program: attaching a single-buffer program fails while one is bound, and
>> the bind fails while one is attached.
>>
>> That drops XDP_VALIDATE_XSK_POOL and struct xsk_rx_check, and fbnic's
>> MTU and program hooks with them. Not fully cooked in my head, but maybe?
>> Wdyt?
>
> Would be nice, what I meant mostly was that a single driver can't do both
> 'legacy' ZC and new-age provider based xsk at the same time, so let us
> have a single vehicle down to drivers, adjusted to both needs?
With the callback gone, a provider driver doesn't get an XSK command at
all. It sees a queue restart with the provider's parameters, the vehicle
devmem and io_uring zcrx already use, and opts in with xsk_page_pool in
its queue ops. Driver ZC keeps XDP_SETUP_XSK_POOL. So each driver has
one vehicle, and the provider's isn't XSK-specific. What's left of XSK
in a provider driver is TX, which finds the pool with xsk_rxq_pool().
Does that cover it? I'll try to get that working in v2.
Björn
Technical Details
Message-ID:
<87ik1xj4yo.fsf@all.your.base.are.belong.to.us>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-363808-linux-kernel-netdev=dewy.ruReferences:
<20261110102039.1002605-1-bjorn@kernel.org> <20261110102039.1002605-12-bjorn@kernel.org> <avWk5as19fvZoEJA@boxer> <87wlqhq0kb.fsf@all.your.base.are.belong.to.us> <87jymhot7q.fsf@all.your.base.are.belong.to.us> <avc6tIIQ9uDQB4IM@boxer>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-363808-linux-kernel-netdev=dewy.ru From: bjorn@kernel.org (Björn Töpel) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v1 11/11] eth: fbnic: Support AF_XDP page pool zero copy Date: Sun, 15 Nov 2026 19:59:43 +0100 Organization: Usenet Network Message-ID: <87ik1xj4yo.fsf@all.your.base.are.belong.to.us> References: <20261110102039.1002605-1-bjorn@kernel.org> <20261110102039.1002605-12-bjorn@kernel.org> <avWk5as19fvZoEJA@boxer> <87wlqhq0kb.fsf@all.your.base.are.belong.to.us> <87jymhot7q.fsf@all.your.base.are.belong.to.us> <avc6tIIQ9uDQB4IM@boxer> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: usenet.network; logging-data="1878861"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:48a9+qegEOiIGO/RPMnA6/LU0AA= sha256:OaRkYho502SKssqQscav6ynD8ZLT6wA5p2eDK9WF5FQ= sha1:e9jgSeTZSdft4317xhiaDVl5X+0= sha256:Ff3rsgUOK39eoVKA2q5eojPNubcODPiP8py1LwEHlMA= 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 349B7114A2B; Sun, 15 Nov 2026 22:00:06 +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 h2ZSu6bujX17; Sun, 15 Nov 2026 22:00:01 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-363808-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id EF409114A2E; Sun, 15 Nov 2026 21:59:52 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 204F827598; Sun, 15 Nov 2026 18:59:48 +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=1794769187; b=Rr4merAabIWj8JUyLaxU6PeZdlGL6PTOXTWyVNzT7NOwRTFago/VlmD6KEUYRbZlBXIN H3NSqlG7IZxDCfsvfj4fk0X3R+JFFvjMcFgZaENuWB4m2GwGmpDssZ/+XO1JpBvAdplXn SCiHCbj6Xp3v+AwruUfYWa/Fct135n/uR+N9R8U5yaOj90dytDbYuSa/y6rmx2y8jneEK GLxidgSR+mT8c45jHP25Wib3YTca1LjwPGmLsinhgZMdKQToew1wi8ZbBHZlqJUo4n0RI 3KjysRsuKwF0b9kYBIovyx4kFPyJGoekYp2c8ZrwYIej9VJz2HRXrTBVGEGE1oh9qzA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794769187; h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject: In-Reply-To:References:Date:Message-ID:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=DuWRw0pm3e+98SOmXelKpHIJTHYXZWbeemqNai35EO8=; b=NekJHC3jX+E9xqXm0CG5TH2W/lE1c19/TYeaDElSeVmAWNnXuLOBeRujbxoDF+wXlWMb y+L4Nv9Kk8tkKJc5YCCKuZrr0X8+L7l0jQLGILQRV4fXGfisuTPT1TTUZTeyaaXLM+upB lxg61upyxjTuaQUrEejCDPJW1WxtAeMKMmG7sz49lxR0W1uQd1ZHDjFuX6/f5Ufe4Avky gXIaSxhCjUFxu92bJqyLjfUyglu8hXIJw7MF3LyRvhdotYQMDb6N7yTpRhposy0QxmzvL 2faSwuT3umRdGQnVAt8FNFurIcGeANHJoBuVM5gt+5wRj2N9sJWnGRzBiqL1PNhS/5g== 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=MsyhObEQ; 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 4035C606A338; Sun, 15 Nov 2026 18:59:47 +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=MsyhObEQ 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=1794769186; b=S8FOPymONIQPnxP7cyE/2vm6TKl+ztTOA3WSXq7vYN/rCflt4ZWaI81xp7nsRSr0OXYI cGp3u6/ru3xQRJhZ1RqaH/QP8/NAc9Bso0KdchbWTJsiUhYIasm0xy84pcOBcUFKoudcZ do+W+FbBs0R36y+gy4yKONKzXhvttuk8mRcxJqYNEadK4vkyEDD7zGppsLBITzU2XreuX WqFxxuWJ6uuiBtNa08Lh4eH2EzWM27nvjxbV2CGCu3jizPTcaYV3yGyyBQjHqKmuMA4R0 8gG3fHZO5A1rK3HK7ZE+QXzQQWs2GsJNdEcNXKxfHiHuyV2RYmFWuPcGq4rINJNbgTQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794769186; h=Received:DKIM-Signature:From:To:Cc:Subject:In-Reply-To:References: Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=DuWRw0pm3e+98SOmXelKpHIJTHYXZWbeemqNai35EO8=; b=fIIRGXCCf+X4QRnAz6GAwGaBN21/GatY1JRKhaySzmgDj4aldMHX3+MWfcQLR+RLk2NJ 4LpcVI79M29cpTgdSdELX2xJdlQpofCVD2KjFNEv96JDzPXJNhACH1rX+eX+1s4JgFovq eyCI6aE8mWNG/tWxYLItSzeK3sX9ZcquzCEfovdAzctY19J8u7seL7f2UbIUR/fzpq2t9 jvYuvc7ZsdaQrKOhed2y3S9pR2BNAl2v6YsH3/Cqs6RezwrtlpIS1FU+fv1/UoKzA0X9i Rrn6i427E7SF+37or4w5mS5os+S20gscvQzWzZw0NDjGy/VpEB1Gro2vfbIL/E6N9gg== 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=MsyhObEQ; 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 5C675606A31D; Sun, 15 Nov 2026 18:59:46 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2123E1F000C5; Sun, 15 Nov 2026 18:59:45 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794769186; bh=DuWRw0pm3e+98SOmXelKpHIJTHYXZWbeemqNai35EO8=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=MsyhObEQa4B12hLDfSbk8mlrv4CVjmCz3ZmtdmX2YYT6ni7g7/qGJWhdVdzMp+FWE YJvJ3aj4/JKmM+k9dzfyypDSu91SnK606oF2vl+G1triU3BT6PE65zomazzLMnpkjx amXXAQM2hWbkXav0F+pGFelvi3OUVOXyw/leAL1n1hYG20DF097d7Z1bW0IYItwrX6 XGuyBCyDQa9Q/Lmmo91HvfXmWqXh0KKolLCwCk/0wgli66Kxywa6gUTUk+fiVoU/Ck XFJA86TebLDgveonC5DjFQHbibe6wf7xqBqR5/eJ7nGMpEy4LIr4rKsh/IJrTvFdGX 80fL3/Reefegw== X-Cc: Magnus Karlsson <magnus.karlsson@intel.com>, Stanislav Fomichev <sdf@fomichev.me>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>, Shuah Khan <skhan@linuxfoundation.org>, Randy Dunlap <rdunlap@infradead.org>, Alexander Duyck <alexanderduyck@fb.com>, kernel-team@meta.com, Andrew Lunn <andrew+netdev@lunn.ch>, Jesper Dangaard Brouer <hawk@kernel.org>, Ilias Apalodimas <ilias.apalodimas@linaro.org>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, John Fastabend <john.fastabend@gmail.com>, Pavel Begunkov <asml.silence@gmail.com>, Jens Axboe <axboe@kernel.dk>, Andrii Nakryiko <andrii@kernel.org>, Eduard Zingerman <eddyz87@gmail.com>, Kumar Kartikeya Dwivedi <memxor@gmail.com>, Martin KaFai Lau <martin.lau@linux.dev>, 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>, netdev@vger.kernel.org, bpf@vger.kernel.org, io-uring@vger.kernel.org, Mina Almasry <almasrymina@google.com>, "Mike Marciniszyn (Meta)" <mike.marciniszyn@gmail.com>, Weiming Shi <bestswngs@gmail.com>, Nikolay Aleksandrov <razor@blackwall.org>, David Wei <dw@davidwei.uk>, Alexander Lobakin <aleksander.lobakin@intel.com>, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Stuart Clark <stuclar@meta.com> X-In-Reply-To: <avc6tIIQ9uDQB4IM@boxer> 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