🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17989

[PATCH net-next 0/7] XDP with io_uring zero-copy RX and devmem

#17989
From: Björn Töpel
Date: Tue, 17 Nov 2026 16:46
86 lines
12224 bytes
Hi!

I had a long chat on page-pool providers with Magnus and Maciej
earlier this week, and the topic of "XDP on unreadable providers" came
up. Magnus suggested building on the xdp.frags mode, to support this.

Here goes...

Devmem and io_uring zero-copy RX place packet payload in memory that the
kernel cannot read through the normal packet APIs. Header split keeps
the headers in ordinary kernel memory. Today, the core rejects XDP and
these memory providers on the same device, in either attach order.

A program that checks headers should not need to copy the payload or
turn off zero-copy receive. Keep the payload in fragments and run a
native XDP program with frags support. Frags support means that the
program accepts a packet whose data_end does not cover the whole
packet. It does not give the program permission to read provider data.

Kuba added XDP_FLAGS_FRAGS_UNREADABLE, which already records this kind
of payload. xdp_buff_add_frag() sets it for net_iov fragments, and skb
construction copies it to skb->unreadable. Drivers use this path even
without an XDP program. The series uses the same flag to stop helpers
from reading or writing provider fragments. Header access still works.

XDP_PASS keeps the payload for the normal receive path. XDP_DROP frees
it without reading it. Frame redirects and AF_XDP copies reject a
buffer while the flag is set. The driver must also reject XDP_TX:
provider payload is mapped for receive, not transmit. Tail trimming
can remove the payload without reading it; after the last fragment is
removed, the remaining header buffer has no unreadable fragments.

Only drivers that declare xdp_unreadable support accept the combination.
fbnic is the real driver in this series. Its XDP_TX path drops packets
while unreadable fragments remain. netdevsim tests the attachment
rules, but it does not test packet access to provider memory.

Generic XDP remains rejected. Its receive path first copies or
linearizes nonlinear skbs, which fails when it reaches provider data.
Even if that step were skipped, skb-to-XDP conversion does not carry
the unreadable flag, and generic transmit and redirect use skb paths
outside the native driver's XDP_TX guard. Supporting generic XDP needs
separate handling; admitting it here would not be enough.


Björn

Björn Töpel (7):
  bpf: Keep XDP helpers within readable data
  xdp: Reject frames with unreadable fragments
  net: Admit native XDP on provider queues
  eth: fbnic: Run XDP on provider queues
  netdevsim: Run native XDP next to devmem
  selftests: net: Test XDP with devmem bindings
  selftests: net: Test XDP on io_uring RX

 Documentation/networking/netmem.rst           |   8 +
 MAINTAINERS                                   |   2 +
 drivers/net/ethernet/meta/fbnic/fbnic_txrx.c  |   4 +-
 drivers/net/netdevsim/netdev.c                |   2 +
 include/linux/filter.h                        |   9 +-
 include/net/netdev_queues.h                   |   6 +
 include/net/xdp.h                             |  20 +-
 kernel/bpf/helpers.c                          |   4 +-
 net/core/dev.c                                |  28 +-
 net/core/dev.h                                |   1 +
 net/core/filter.c                             |  37 ++-
 net/core/netdev_rx_queue.c                    |   2 +-
 net/xdp/xsk.c                                 |   5 +
 .../selftests/drivers/net/hw/.gitignore       |   1 +
 .../testing/selftests/drivers/net/hw/Makefile |  10 +-
 tools/testing/selftests/drivers/net/hw/config |   5 +
 .../selftests/drivers/net/hw/iou-zcrx.c       | 242 +++++++++++++++++-
 .../selftests/drivers/net/hw/iou-zcrx.py      | 108 +++++++-
 .../selftests/drivers/net/hw/iou_zcrx.bpf.c   | 111 ++++++++
 .../selftests/drivers/net/hw/iou_zcrx.h       |  34 +++
 tools/testing/selftests/net/nl_netdev.py      |  54 +++-
 21 files changed, 646 insertions(+), 47 deletions(-)
 create mode 100644 tools/testing/selftests/drivers/net/hw/iou_zcrx.bpf.c
 create mode 100644 tools/testing/selftests/drivers/net/hw/iou_zcrx.h


base-commit: f23dcd8055612eb37c666c67fe0cfe38b3c65021
-- 
2.56.1
Technical Details
Message-ID: <20261117164700.2157816-1-bjorn@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-365448-linux-kernel-netdev=dewy.ru

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-365448-linux-kernel-netdev=dewy.ru
From: bjorn@kernel.org (Björn Töpel)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next 0/7] XDP with io_uring zero-copy RX and devmem
Date: Tue, 17 Nov 2026 17:46:51 +0100
Organization: Usenet Network
Message-ID: <20261117164700.2157816-1-bjorn@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2379865"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:7/0BI1zQStZpdVoPOedMiELWXi8= sha256:PtOoQng7N+vJ4wiRs54t7CSw/bEjOKzptY3tmmq2qA4=
	sha1:wdDN8n+nLc6AOp4HALs6Dg51lCo= sha256:s7xA09zOqubPrpw0a70pslxC2O0DRndIorFlguO4Ias=
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 2CC1E114FFA; Tue, 17 Nov 2026 19:47:41 +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 z0YxYQqcq2Tu;
	Tue, 17 Nov 2026 19:47:37 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-365448-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 06F8F114FEE; Tue, 17 Nov 2026 19:47:27 +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 7C580359AA; Tue, 17 Nov 2026 16:47:19 +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=1794934038;
	b=s0murbaJs3NNIzWAy/v4OzcA7b7bEqbzlpNGTxFU5vUg0AdFIsltwkNd6BEFF09O1/5I
	 KZht8nYaSnduSHSRp0uNq3kz66Crx0a+J/LqOVS5F3RPNykz8efAZJX/htFtGpHrB/eN0
	 lwS8Y7l04G8GOb55idTiSH/wSPbbVdNwcryU0zmiqNtLLZ3T6v1NU9ddStvgWuQXYml3K
	 o0rgekR/TcfoSqlPicrOlbu7Dp+SCbY3gH5sKJuzl1lqYxgpdr5WJ2zJ+miXzUbgaW+fa
	 Ne4iZ+KQO5rhM25vnQnulUae/5/LxFwXKxNfaGkUgv05AzJ+tqvOkYasezkqY83cAfQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794934038;
	h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:Content-Transfer-Encoding;
	bh=Fco+UlnINs31RhLyhKfNSsZubf2jNgBWY6vfGvE0k4A=;
	b=FbZILDuK30JjqsqP+LCJv89eTtfVfHyk0WjeKZZXS5mgH8idEpXVlv+fPHW953F+o4iA
	 U14T1VZxpH+oU0hgCeMDUQ8piMbuwU85AIW46RrLIdU7ovW+R9TP7FVdX3kX7OUYNHF30
	 VZ2jCy/R4AbCMButp5aKl98kJpWglwDaTCVc4bL1j/PfIlZsmOE7rVGbp8X5SVIgxDkzw
	 yG3ftFXSqSkZCjx13bRW2gb7qIojoE4jj9bUgMX1OPM73LOkPuZXfmFS5YXO/Xu61fWwe
	 fKWhsLWzqoYfS1yGnbC5hvOGC/A9UOkqaWUXb1ZGgOiVsbzvaSKAKL+kZuTV6T4MeEA==
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=iDPwpT4H;
	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 41035606A881;
	Tue, 17 Nov 2026 16:47:18 +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=iDPwpT4H
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=1794934037;
	b=ptOxKPinqeyYJ1n81UZMEAYzV1gSv9Ijw8GqfzJJiaeH0StQphf3es1GcSn9Nj6T7bvk
	 gCnaw/CzrHLIRpVOtfoYMyu62Nt5lCV3pzpBkTzzxM1gZtA/SoqKfe+OKiWcphd/zy23d
	 AcNJ/BsN5VannXci95mrKqdqXiIMDuNKQwSmNQtpRHxy8K+zZ4lJ/y0XEZ3Dd880RcoLp
	 meUAVT/S+aQFp9tJ0cx+JCJEjlYZmIanQyKyNzu/mUdMcswfCC6tj1+DKYZRwcIyKc1bl
	 pOWuhCwFSQCnIbaXDkfNBSDJ8bLghFGqy82aJkTj3MQdfB3Fd4e/6DSHoXCmBqVaolg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794934037;
	h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 MIME-Version:Content-Type:Content-Transfer-Encoding;
	bh=Fco+UlnINs31RhLyhKfNSsZubf2jNgBWY6vfGvE0k4A=;
	b=e7zn3sEuiXisjbm5ozvwOtReeUigBYanjxC55AbhrJA1YsmdtZESClwTdE0EAlKZSpIi
	 f+UF7qDyH+DkQP376/zIVHZ5o6wgTWpCbKxMHj/qugEuMCllxbhkR82doJa4GO2Oq/5Zs
	 hwXo3V9Te9DLSl++ffbbUNIGIGxFdxKCirEUw+pCwctqZ9VTrAXSptzlPX0BZygO4YydO
	 vUfKfG4voe/tmBDINy84V8zjHV3ImCi4UVVySexKyHAZQM11fCFQ/gRcBNKP/Oq0TbMjj
	 0uKFUpeIwDyiUzlsYw9q3x0CwrvqAEL0Cw8Yizn1UJCh52mbWQnrtLCezXOKE6buKMw==
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=iDPwpT4H;
	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 5E223606A889;
	Tue, 17 Nov 2026 16:47:17 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E0541F000C5;
	Tue, 17 Nov 2026 16:47:09 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794934036;
	bh=Fco+UlnINs31RhLyhKfNSsZubf2jNgBWY6vfGvE0k4A=;
	h=From:To:Cc:Subject:Date;
	b=iDPwpT4HdexXsiGZ4nqwW9ju6XomdL9Mw3q2pwnUf3nGxM5O4Tv2DqZO4tmlmEaky
	 gQxkzAocgG1wTOARZLMae7SolEpZ4NV2F4bf73cN07EAeIvWbwidolW6/gk4BVgmbZ
	 66KCxVsQJYoaTz8GqfyMWu/przkFfgCIdiz99eDosesQ+Sz9DFh6IbnOLk3y+aJhxe
	 EmZdZC9K5Ixc35fHjPlGDBqsyY4g16Foc4tw++GdO4H7aSQfQcC6gcucJqy8RwIJBF
	 00SL4BEcgYQvBMAVfG1i4EIIQSmbaRIjvEI8H6XfpS3+bff9pHdrU7rd0zOwU0dZep
	 1n2Dod1G6s7dA==
X-Cc: Björn Töpel <bjorn@kernel.org>,
	Simon Horman <horms@kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	kernel-team@meta.com,
	John Fastabend <john.fastabend@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>,
	Weiming Shi <bestswngs@gmail.com>,
	Nikolay Aleksandrov <razor@blackwall.org>,
	David Wei <dw@davidwei.uk>,
	Bobby Eshleman <bobbyeshleman@meta.com>,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org,
	io-uring@vger.kernel.org,
	Mina Almasry <almasrymina@google.com>
X-Mailer: git-send-email 2.56.1
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