All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <hangbin.liu@linux.dev>
To: Jay Vosburgh <jv@jvosburgh.net>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Nikolay Aleksandrov <razor@blackwall.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org
Subject: Re: [PATCH net-next v2] bonding: check XDP support before enslaving changes state
Date: Mon, 30 Nov 2026 12:34:27 +0800	[thread overview]
Message-ID: <awz80xvZeZK1PQpN@fedora> (raw)
In-Reply-To: <20261127-bond_xdp_fix-v2-1-1e05818a41ef@kylinos.cn>

On Fri, Nov 27, 2026 at 02:37:28PM +0800, Hangbin Liu wrote:
> From: Hangbin Liu <liuhangbin@kylinos.cn>
> 
> The XDP capability checks in bond_enslave() - ndo_bpf/ndo_xdp_xmit
> presence and whether the slave already runs an XDP program - run only
> after the slave has been opened, linked and published to the
> datapath. On failure the slave may already be bond->curr_active_slave
> or reachable through bond->slave_cnt and the upper device list, so a
> lot of state has to be undone, and bond_xdp_xmit() can observe the
> slave before its capability was ever verified.
> 
> Move both checks into the validation section at the top of
> bond_enslave(), before the first state change, so a rejected slave
> returns directly with nothing mutated. bond_xdp_set() repeats the
> same two checks for every slave, so factor them into a common
> bond_slave_xdp_check() helper used by both paths.
> 
> Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
> ---
> For Sashiko:
> 
> please ignore the bond's promiscuity/allmulti/ns maddrs leak issue
> when xdp setup failed. It will be addressed in another patch.
> 
> please ignore the no unwind for bond_3ad_bind_slave if
> dev_xdp_propagate failed. It will be addressed in another patch.
> ---
> Changes in v2:
> - move the duplicate checking in bond_xdp_set to the new check function.
> - Move the bond_xdp_xmit() fix in another patch and target to net (sashiko)
> - Link to v1: https://patch.msgid.link/20261124-bond_xdp_fix-v1-1-e67983924324@kylinos.cn
> ---

Patch doesn't apply to latest net-next due to recent 802.3ad update.
I will rebase the code and repost a new version.
---
pw-bot: cr

      reply	other threads:[~2026-11-30  4:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  6:37 [PATCH net-next v2] bonding: check XDP support before enslaving changes state Hangbin Liu
2026-11-30  4:34 ` Hangbin Liu [this message]

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=awz80xvZeZK1PQpN@fedora \
    --to=hangbin.liu@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.