🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16059

Re: [PATCH net-next 1/5] net: don't safety-check device features for XDP uninstall

#16059
From: netdev-bot+sashiko
Date: Fri, 13 Nov 2026 23:53
82 lines
11122 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message of "net: don't safety-check device features
  for XDP uninstall" calls the change a "refactoring / consistency…

--

net: don't safety-check device features for XDP uninstall

This moves the tcp-data-split and memory provider checks in
dev_xdp_install() and netif_xdp_propagate() under "if (prog)", so they
only run when a program is being installed. netif_xdp_propagate() also
now hands commands other than XDP_SETUP_PROG straight to ndo_bpf.

> This way we don't have to worry about triggering WARN()s
> on cleanup paths mistakenly trying to un-install a program
> when there is none, and failing because device has a memory
> provider.
>
> This is a refactoring / consistency cleanup, later patches
> don't depend on this change.

[Severity: Low]
Is this really only a cleanup? It looks like it also fixes an XDP
uninstall failure that can be hit in the current tree.

Before this patch, netif_xdp_propagate() ran the memory provider check
unconditionally, so it also refused to propagate prog == NULL:

net/core/dev.c:netif_xdp_propagate() {
    ...
	if (dev_get_min_mp_channel_count(dev)) {
		NL_SET_ERR_MSG(bpf->extack, "unable to propagate XDP to device using memory provider");
		return -EBUSY;
	}
    ...
}

A lower device can run a program propagated from an upper device and
also have a memory provider bound. At this point in the tree,
netif_xdp_propagate() does not record the propagated program in the
lower device's xdp_state, so the reverse checks pass.
__netif_mp_open_rxq() only checks dev_xdp_prog_count(dev), and
ethnl_set_rings() only checks dev_xdp_sb_prog_count().

When a bond slave is in that state, removing XDP from the bond fails:

  bond_xdp_set(bond_dev, NULL)
    dev_xdp_propagate(slave_dev, &xdp)    /* xdp.prog == NULL */
      netif_xdp_propagate()
        dev_get_min_mp_channel_count(dev) != 0 -> -EBUSY

bond_xdp_set() then rolls back, so XDP cannot be removed from the bond.

In __bond_release_one() the same failure only prints a warning:

	if (dev_xdp_propagate(slave_dev, &xdp))
		slave_warn(bond_dev, slave_dev, "failed to unload XDP program\n");

The released slave keeps running the bond's program, and nothing about
it is in the slave's xdp_state. The program then cannot be seen or
removed through that device. netvsc_vf_setxdp(vf, NULL) fails the same
way.

The check being relaxed here came from commit 170aafe35cb9 ("netdev:
support binding dma-buf to netdevice"), which is in current LTS trees.

Should this patch have a Fixes: tag for that commit? Could the commit
message also describe the uninstall failure, rather than calling the
change a refactoring?

A later patch in this series, "net: record XDP programs propagated to
lower devices", fixes the root cause (a memory provider coexisting with
a propagated program). That patch has no Fixes: tag either.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112235027.4072149-1-kuba%40kernel.org
Technical Details
Message-ID: <179461399476.2199510.18058765948144630080@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362987-linux-kernel-netdev=dewy.ru
References: <20261112235027.4072149-2-kuba@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362987-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 1/5] net: don't safety-check device features for
 XDP uninstall
Date: Fri, 13 Nov 2026 23:53:14 +0000
Organization: Usenet Network
Message-ID: <179461399476.2199510.18058765948144630080@kernel.org>
References: <20261112235027.4072149-2-kuba@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1470007"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:quCBX5Mb+83iLBoCDA/IXbMK5dI= sha256:Eiz/jxqxJRiAKcuXQU6Zv81fT9rM9KJr54BrGn377wo=
	sha1:F2iSXnYVFy83kGuYk2+AmibhRzU= sha256:sN5+ZL9aKmqI9+4ZWgPXRiHcCAQNr5iV8r86dU9qc2o=
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 3BF481146EF; Sat, 14 Nov 2026 02:53:41 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 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, 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 c6A2AydR5uMC;
	Sat, 14 Nov 2026 02:53:37 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-362987-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 B83FB1146EA; Sat, 14 Nov 2026 02:53:28 +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 D2AFF386FB; Fri, 13 Nov 2026 23:53:21 +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=1794613998;
	b=I4Ok8Iv9IlmneLlxViOgpZkRNAgfg8Lkp5Cv+SFc+ybjdcHHV8SOZQew1CorVT3kPRnM
	 qiKPSwoMhzhQw3gLr3dm5WQwBAUQam42XyBaPlum29ZMq09Hjdsl/2ylC2WaZW9wiD6cH
	 7Q/65YKm5jhK4YYDeB1ymaVCfeDe9t694fwqEDdsJfoe88QLyb/X113/jJINV++pkbHwH
	 F5HU+D1swYbL3JkXVnMx0ysmYUqYdkWFnyQFCbH2YPnb5nS8x/W4FFdHggiwb47eBXt7A
	 XR9jgXFw7rWYR3yzNUw8ATwsaFNU5O6ABOX6RHVYIYAo7avsbvBkcAs9eJOgKkVv69Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794613998;
	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=LJx81VRcAx9Lj2nt6V6VRg7S2qbY7x1uKPTabp9ywdo=;
	b=iiWRmyTBBbwDF+VZ5KbwY1R68knvMteuMkaYceLkbpFTRR0KWQPaIKP553h7Q7ObEaEd
	 I7qtvFEF15GX0kEdiTdbqNoyO7/eCqQDbevQzY4Xfo2cF3ScdidFB85FOJp9LL3COddYi
	 gdhL5dPB9+ZTW39/nA3/eYCH1AfDmxLLIQ1Ac6/eV/HWd3U28MZPTDg10DCu2gtTFh6Un
	 cMZOw2N11LLgowpdxtop/30sPuTwMHdPNpjrQlnfNMzBc69dRvDG7t1gkoeMDEkqRElRV
	 vu01m/GxUg3gHVQVYmKyqwfQUb6+1Hmmztwv1s9Cs4Vqt8AOuxxMTBs84eXzHrN0sSA==
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=H4um6IwA;
	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 728D5606A897;
	Fri, 13 Nov 2026 23:53: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=H4um6IwA
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=1794613996;
	b=W41uUUhTbziAqHt62G18fa7LPuKKQcWIEnKfbD2pB9QitG19gMiTqMCYSvcKsW+KNzSB
	 tRZsXTETz7LdFNPFeC5X8CKX8HaS/kSaO+oopo4FESEWVGGcW//OJCP7MLE0Sx7rXl51E
	 BTk444Bip5iI5izthaLyTR0ICN1gt+AmGjJw/0h7rFGZvHG6lY6VpPU4gPrijSqOdw5YW
	 wmEVjzowOWISrhohP79+NxAP27lGsu5z7wWhNBM/FPWd8LhCtPyitkFHaizMJhCBGqkP+
	 W6vKWT8zaeF0OfSkZiRFm9Fq/CCy63CmF4AtZv6p1AtbmKPnp7Px7+b9yko50wV+5lg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794613996;
	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=LJx81VRcAx9Lj2nt6V6VRg7S2qbY7x1uKPTabp9ywdo=;
	b=f5eVhW+wkMta4EEVAS9nQgFnWRidFYSaWvD4hJGIvaIV6hCAD9jXZtcOzLWaqEIxYBIW
	 S7PlO7Nah/IGbPt3aZ2/NwQm8Dmmu0Qahge6VXovbpgiMy/zFKFb/d/nP4BkpBCvQ3UUj
	 ZtsmIJlD5KFAuYB8pZWdAi8ieGswmMJKBF5km3+jGhiUYb0pFphn0/8i6mQ1PxkmrAZ6e
	 dDs/D1/RRLJNzfERlB59Ua5AFkfMhbKVA/MsK9l/aWqmFaH1G6db4kF+e7pXr1+6iBUEc
	 xZ/uWTK/dNZTNo2/nQFya4e1SN+0I4aIb7HE2+TzAojAJF3S8NUd4ZeK0HqRMuwvNdA==
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=H4um6IwA;
	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 611C7606A323;
	Fri, 13 Nov 2026 23:53:16 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33D8C1F000C4;
	Fri, 13 Nov 2026 23:53:15 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794613996;
	bh=LJx81VRcAx9Lj2nt6V6VRg7S2qbY7x1uKPTabp9ywdo=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=H4um6IwAktFEaVD+58UoC/IAWNYoTtQ1GAWIMXncgBSzfITMoFgirSqpK4tnXAPnc
	 gwK8NGVclh++0ooTpk2RzDhaD+J9kjsAg2/61O11fl16YpJxeY7F1amyEOk/ZnnL3U
	 YbyEUBbBBsA8r4uvg5vfR2eZ6FCtLsqqP5JmDvzOBvc7qFBzF7X+MYUaJJGJDTZLsx
	 fsmjs2wlDmhKIv9mbVyVMjYC1pTpRF6Np0H9MlkXKZlfkl2qAFzRLGgvbdBjatJ9jK
	 I0L/b9XSBGyj5dKAwQWTTsNb6ZO+0w4D1O69wXeQa5V6NDA+hwDZwHZ5dWnoOF1iTQ
	 4WhTuRpGVvoVg==
X-Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
 pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org, jv@jvosburgh.net,
 haiyangz@microsoft.com, ast@kernel.org, hawk@kernel.org,
 john.fastabend@gmail.com, sdf@fomichev.me, bpf@vger.kernel.org,
 linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org
X-In-Reply-To: <20261112235027.4072149-2-kuba@kernel.org>
X-sashiko-severity: Low
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