๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22532

Re: [PATCH net-next 03/15] net: Add memory providers that only feed XDP

#22532
From: netdev-bot+sashiko
Date: Wed, 25 Nov 2026 14:08
109 lines
12371 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] This patch adds MP_XDP_ONLY providers, which by design sit
  next to native XDP and AF_XDP.

--

net: Add memory providers that only feed XDP

This patch lets a memory provider mark itself XDP-only with MP_XDP_ONLY.
Such a provider needs no header split and does not block native XDP. A page
pool takes it only when the driver sets PP_FLAG_ALLOW_XDP_ONLY_NETMEM. The
XDP install, XDP propagate and ethtool rings checks move from
dev_get_min_mp_channel_count() to the new dev_mp_blocks_xdp().

> diff --git a/net/core/dev.c b/net/core/dev.c
> index 4ca8a9f5a7a5c..8a1d5a284e53c 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c

[ ... ]

> @@ -11146,6 +11146,23 @@ int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack,
>  	return err;
>  }
>  
> +/* Native XDP runs next to XDP-only providers only, see %MP_XDP_ONLY */
> +bool dev_mp_blocks_xdp(const struct net_device *dev)
> +{
> +	const struct memory_provider_ops *ops;
> +	unsigned int i;
> +
> +	netdev_assert_locked_ops_compat(dev);
> +
> +	for (i = 0; i < dev->real_num_rx_queues; i++) {
> +		ops = dev->_rx[i].mp_params.mp_ops;
> +		if (ops && !(ops->flags & MP_XDP_ONLY))
> +			return true;
> +	}
> +
> +	return false;
> +}
> +

[Severity: Medium]
Should the AF_XDP zero-copy setup paths use this helper too?

Two callers still use dev_get_min_mp_channel_count(). It counts every
provider by mp_priv, including XDP-only ones:

net/xdp/xsk_buff_pool.c:xp_assign_dev() {
    ...
	if (dev_get_min_mp_channel_count(netdev)) {
		err = -EBUSY;
		goto err_unreg_pool;
	}
    ...
err_unreg_pool:
	if (!force_zc)
		err = 0; /* fallback to copy mode */
    ...
}

drivers/net/netkit.c:netkit_xsk() {
    ...
	if (!create || !dev_get_min_mp_channel_count(phys))
		ret = phys->netdev_ops->ndo_bpf(phys, &xdp_lower);
    ...
}

Later in the series, xsk_sink_bind() installs an MP_XDP_ONLY provider
(xsk_sink_ops) on q0. After that, a classic AF_XDP socket that binds q1 on
the same device would see this:

  bind with XDP_ZEROCOPY fails with -EBUSY
  bind without a mode flag falls back to copy mode and does not report it
  XSK pool creation through a netkit leased queue returns -EBUSY

The result also seems to depend on bind order. Suppose the classic
zero-copy socket binds q1 first. The sink can then still be installed on
q0, because __netif_mp_open_rxq() only checks the pool of its own queue:

net/core/netdev_rx_queue.c:__netif_mp_open_rxq() {
    ...
	if (rxq->pool && !xdp_only) {
    ...
}

So the same end state (sink on q0, zero copy on q1) is accepted in one
order and refused in the other. Is that intended?

Nothing can hit this at this commit, since no provider sets MP_XDP_ONLY
yet. It becomes reachable with "xsk: Receive in the device's buffer
layout". At the end of the series, both call sites still use
dev_get_min_mp_channel_count(). Documentation/networking/af_xdp.rst does
not describe the restriction either.

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124112707.118678-1-bjorn%40kernel.org
Technical Details
Message-ID: <179561568417.3135.7506567631056689365@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-371367-linux-kernel-netdev=dewy.ru
References: <20261124125654.183091-3-bjorn@kernel.org>

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-371367-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 03/15] net: Add memory providers that only feed XDP
Date: Wed, 25 Nov 2026 14:08:04 +0000
Organization: Usenet Network
Message-ID: <179561568417.3135.7506567631056689365@kernel.org>
References: <20261124125654.183091-3-bjorn@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="222970"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:B/IcM5sKp+e10QFnKbrDr7BhgXI= sha256:cut5/0urnNoTIxGBG4NzpSiBLV5JWqp71yD9p2WMCU4=
	sha1:6YTKRL6JQyKTfJkjmJgsZD31kZI= sha256:0EtrU7beqxGB39WKoKz6MdcptLe4vX68oSZ1pS8p9OM=
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 7F264125E6D; Wed, 25 Nov 2026 17:08:53 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 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,
	URIBL_BLOCKED=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 rFVg0DrXnU7d;
	Wed, 25 Nov 2026 17:08:50 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-371367-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 0B2B2125E6B; Wed, 25 Nov 2026 17:08:36 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id AC21A3CE53; Wed, 25 Nov 2026 14:08:23 +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=1795615694;
	b=X/nx10h140TfjpIcLwUXaIH3ICQQQVyKh9NXrEGC2K3DkKUUzOj8gyb9Ky81+vr2Mwu4
	 JZZN8CcEtRJ8SfX0xAg8KL27wV18F4JKKPpvRCYGQegeApnk6QSkhaddcsvVg2vejIbYd
	 YfDxeynQZrr8KoJUaZ6ZFydFPpxuFtvnxZa94Yg3lwIGj79zAt4G7DIEqJK/wCRCFG7vp
	 pyKXlgzIEegUpiHPBp5eI3ElLdVuCTvUrInfopxgUeVrYgmZn49YybsSAsderlviOZ4nd
	 GA95ZMtl3AGY1W1ZPFlJmlAmKs7KkKYedipMbsycUtpvHMYTGg5kqbjqa+iq3hN2krg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795615694;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=DbX3kn/Ze5xIjQfpzp+2KyS5qm64xHA6hXYjOn6Tc1U=;
	b=XSgCzMoGUZVdxcjQPZwvED+UY+NnzjYaO8eHhiYnrRZeTKm9sOZrbbfNNjVklOXbaxjw
	 VPxZg22MuT4YdMy6CPUT24H+RWI9oU7qYo+K9wUIZGpc3ARi40x3czaIhwoHW/sqFN7S4
	 PNXULb0fDGDuVaNquhHLfKyTLv2rF+9uXtLBhw51XHVjYs952zFp24yl79TX8tMSemrEV
	 OA3Z4RE4775yqL3LEXCc8uLzKGAIiZoyh4eLiqQLYtIKK5h3TD6mBdaUXB6ewpsIzzBhz
	 JCZMw21TB9+wuS3da7u5oIa2Yt/NtB/4wvO1l6VrLOYbnM9MiAXcXpwY4kKfdIWEOjQ==
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=Jp2w8Kru;
	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 2AF5460A2603;
	Wed, 25 Nov 2026 14:08:14 +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=Jp2w8Kru
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=1795615688;
	b=zA5xj6ZrNAqc1ygUusVmz/zDcDUkfAWZ4omf7fa9ceRA2QW6l6+M/01LYOTNhdIp8LTE
	 I1wulqrLjmQxKlUmkM/DVsRm0HEoMNbUlnUc1+KpSJUkv2PazzBInrZ4dVRExBbwsqFuw
	 oyePnx9FfU22PHYhoNwrBYyBcdUZO/ujuCDRdzLt7FflwkDmqeUpdqUwU0Yulz5Fv4G2n
	 O8wfx5H82gkHlrx/WX3d6P/WIl/3jVSVB/tCAKGYcTqkCBMMCJDm9Ly5Yp/5/gzEf4WNg
	 dsxp/OyXiw6AW/w8GeeNY3gZw6831v7IXhGWLg/B1DD6+SysmxsLxnMy5MX9aHnf0KA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795615688;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=DbX3kn/Ze5xIjQfpzp+2KyS5qm64xHA6hXYjOn6Tc1U=;
	b=BQgAXynK3MFcHDkUXrtprwnLwJdDVMjtZ89Qi+ApsDjZPkXiR0GsNKDnogimAtJz38ki
	 QG1roHedPgIfiNWQlMe1hBQkuJRQQ3lpVQHHpUaKTOsa1bTTbBtjQ5mFGpumShuCeaF8n
	 CMF8vzoilDzmYJ3OZq579967fwV5161HQQJDxqFHBFEbDvcZdMWVKzYUaRpHR4mbcJ4u3
	 hsdu+J16berFCead404uFyTzkA+b/rKBeGju4yDd47p224QLET09eBQts0BxMAWu+6IXB
	 IlJuUIz+qgJKTV5muzRq4eJNfpDIq06iJU0x8LZg72gB/DH86VLAt4aY1bmWy7fYP7g==
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=Jp2w8Kru;
	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 4A38C606A337;
	Wed, 25 Nov 2026 14:08:08 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9ABCD1F000E6;
	Wed, 25 Nov 2026 14:08:04 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795615687;
	bh=DbX3kn/Ze5xIjQfpzp+2KyS5qm64xHA6hXYjOn6Tc1U=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=Jp2w8KrunVgtxiDH4wXbOA+u4JFNrwblxiDUSqbJ4Ow8rnq41Oy/JXrWLab4eW/xj
	 iSwEShRFrLY/HwaC9fEcbltSpK1zj6lcA3y5g50YdemMbCoNiQt8G6qCUAERDvQgk+
	 gV0KdQh9qlBOWwrLmSf7wzAbl0WJtxy/oSqS/q4CKgRk7S32tRccB0HioFudZXdCAM
	 aEps6jbm50ozKx4v1EtRiOWrYxXAAlQsbw+75lutFHA9HIt5qMo+7RV8UKPBAsC/Xu
	 5vnRZhaJZB/rI/0x2kmy3SVRTQcOOxmWsLdwmQ6zDWrbHy9ByOYaqdORA3LFZuCh7W
	 tYwBNuNgs2mwg==
X-Cc: magnus.karlsson@intel.com, maciej.fijalkowski@intel.com,
 davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 andrew+netdev@lunn.ch, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org,
 john.fastabend@gmail.com, andrii@kernel.org, eddyz87@gmail.com,
 memxor@gmail.com, ilias.apalodimas@linaro.org, alexanderduyck@fb.com,
 saeedm@nvidia.com, tariqt@nvidia.com, mbloch@nvidia.com, leon@kernel.org,
 michael.chan@broadcom.com, pavan.chebbi@broadcom.com, corbet@lwn.net,
 shuah@kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org,
 stuclar@meta.com, sdf@fomichev.me, horms@kernel.org, martin.lau@linux.dev,
 almasrymina@google.com, song@kernel.org, yonghong.song@linux.dev,
 jolsa@kernel.org, emil@etsalapatis.com, ihor.solodrai@linux.dev,
 rdunlap@infradead.org, kernel-team@meta.com, dimitri.daskalakis1@gmail.com,
 bobbyeshleman@meta.com, mohsin.bashr@gmail.com, kees@kernel.org,
 leitao@debian.org, maxime.chevallier@bootlin.com, cuitao@kylinos.cn,
 vadim.fedorenko@linux.dev, mike.marciniszyn@gmail.com, kuniyu@google.com,
 jiayuan.chen@linux.dev, mkarsten@uwaterloo.ca, razor@blackwall.org,
 dw@davidwei.uk, asml.silence@gmail.com, linux-rdma@vger.kernel.org,
 linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org,
 linux-kernel@vger.kernel.org
X-In-Reply-To: <20261124125654.183091-3-bjorn@kernel.org>
X-sashiko-severity: Medium
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