netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: kuba@kernel.org
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
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	[thread overview]
Message-ID: <179461399476.2199510.18058765948144630080@kernel.org> (raw)
In-Reply-To: <20261112235027.4072149-2-kuba@kernel.org>

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

  reply	other threads:[~2026-11-13 23:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 23:50 [PATCH net-next 0/5] net: make xdp config checks effective vs netif_xdp_propagate() Jakub Kicinski
2026-11-12 23:50 ` [PATCH net-next 1/5] net: don't safety-check device features for XDP uninstall Jakub Kicinski
2026-11-13 23:53   ` netdev-bot+sashiko [this message]
2026-11-12 23:50 ` [PATCH net-next 2/5] net: move dev_xdp_set_link() and dev_xdp_set_prog() up Jakub Kicinski
2026-11-12 23:50 ` [PATCH net-next 3/5] net: record XDP programs propagated to lower devices Jakub Kicinski
2026-11-13 23:53   ` netdev-bot+sashiko
2026-11-12 23:50 ` [PATCH net-next 4/5] selftests/bpf: check XDP attach on a nested bond slave Jakub Kicinski
2026-11-12 23:50 ` [PATCH net-next 5/5] selftests/bpf: check replacing and detaching XDP on a bond through a link Jakub Kicinski
2026-11-13 23:53   ` netdev-bot+sashiko
2026-11-13 22:22 ` [PATCH net-next 0/5] net: make xdp config checks effective vs netif_xdp_propagate() Stanislav Fomichev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179461399476.2199510.18058765948144630080@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=haiyangz@microsoft.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).