All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jay Vosburgh <jv@jvosburgh.net>
To: Tonghao Zhang <tonghao@bamaicloud.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Nikolay Aleksandrov <razor@blackwall.org>,
	Hangbin Liu <liuhangbin@gmail.com>,
	Jiri Slaby <jirislaby@kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH net v2] net: bonding: update the slave array for broadcast mode
Date: Fri, 17 Oct 2025 10:14:56 -0700	[thread overview]
Message-ID: <775230.1760721296@famine> (raw)
In-Reply-To: <20251016125136.16568-1-tonghao@bamaicloud.com>

Tonghao Zhang <tonghao@bamaicloud.com> wrote:

>This patch fixes ce7a381697cb ("net: bonding: add broadcast_neighbor option for 802.3ad").
>Before this commit, on the broadcast mode, all devices were traversed using the
>bond_for_each_slave_rcu. This patch supports traversing devices by using all_slaves.
>Therefore, we need to update the slave array when enslave or release slave.
>
>Fixes: ce7a381697cb ("net: bonding: add broadcast_neighbor option for 802.3ad")
>Cc: Jay Vosburgh <jv@jvosburgh.net>
>Cc: "David S. Miller" <davem@davemloft.net>
>Cc: Eric Dumazet <edumazet@google.com>
>Cc: Jakub Kicinski <kuba@kernel.org>
>Cc: Paolo Abeni <pabeni@redhat.com>
>Cc: Simon Horman <horms@kernel.org>
>Cc: Jonathan Corbet <corbet@lwn.net>
>Cc: Andrew Lunn <andrew+netdev@lunn.ch>
>Cc: Nikolay Aleksandrov <razor@blackwall.org>
>Cc: Hangbin Liu <liuhangbin@gmail.com>
>Cc: Jiri Slaby <jirislaby@kernel.org>
>Cc: <stable@vger.kernel.org>
>Reported-by: Jiri Slaby <jirislaby@kernel.org>
>Tested-by: Jiri Slaby <jirislaby@kernel.org>
>Link: https://lore.kernel.org/all/a97e6e1e-81bc-4a79-8352-9e4794b0d2ca@kernel.org/
>Signed-off-by: Tonghao Zhang <tonghao@bamaicloud.com>
>Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>

Acked-by: Jay Vosburgh <jv@jvosburgh.net>

>---
>v2:
>- fix the typo in the comments, salve -> slave
>- add the target repo in the subject
>---
> drivers/net/bonding/bond_main.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 17c7542be6a5..2d6883296e32 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -2384,7 +2384,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
> 		unblock_netpoll_tx();
> 	}
> 
>-	if (bond_mode_can_use_xmit_hash(bond))
>+	/* broadcast mode uses the all_slaves to loop through slaves. */
>+	if (bond_mode_can_use_xmit_hash(bond) ||
>+	    BOND_MODE(bond) == BOND_MODE_BROADCAST)
> 		bond_update_slave_arr(bond, NULL);
> 
> 	if (!slave_dev->netdev_ops->ndo_bpf ||
>@@ -2560,7 +2562,8 @@ static int __bond_release_one(struct net_device *bond_dev,
> 
> 	bond_upper_dev_unlink(bond, slave);
> 
>-	if (bond_mode_can_use_xmit_hash(bond))
>+	if (bond_mode_can_use_xmit_hash(bond) ||
>+	    BOND_MODE(bond) == BOND_MODE_BROADCAST)
> 		bond_update_slave_arr(bond, slave);
> 
> 	slave_info(bond_dev, slave_dev, "Releasing %s interface\n",
>-- 
>2.34.1
>

  parent reply	other threads:[~2025-10-17 17:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16 12:51 [PATCH net v2] net: bonding: update the slave array for broadcast mode Tonghao Zhang
2025-10-16 12:54 ` Nikolay Aleksandrov
2025-10-17 17:14 ` Jay Vosburgh [this message]
2025-10-18  0:00 ` patchwork-bot+netdevbpf

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=775230.1760721296@famine \
    --to=jv@jvosburgh.net \
    --cc=andrew+netdev@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jirislaby@kernel.org \
    --cc=kuba@kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=stable@vger.kernel.org \
    --cc=tonghao@bamaicloud.com \
    /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.