[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aS1ocogQc01owxSC@fedora>
Date: Mon, 1 Dec 2025 10:05:38 +0000
From: Hangbin Liu <liuhangbin@...il.com>
To: Tonghao Zhang <tonghao@...aicloud.com>
Cc: netdev@...r.kernel.org, Jay Vosburgh <jv@...sburgh.net>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>, Jonathan Corbet <corbet@....net>,
Andrew Lunn <andrew+netdev@...n.ch>,
Nikolay Aleksandrov <razor@...ckwall.org>,
Jason Xing <kerneljasonxing@...il.com>
Subject: Re: [PATCH net-next v3 1/4] net: bonding: use workqueue to make sure
peer notify updated in lacp mode
On Mon, Dec 01, 2025 at 05:45:49PM +0800, Tonghao Zhang wrote:
> >> * bond_change_active_slave - change the active slave into the specified one
> >> * @bond: our bonding struct
> >> @@ -1270,8 +1299,6 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
> >> BOND_SLAVE_NOTIFY_NOW);
> >>
> >> if (new_active) {
> >> - bool should_notify_peers = false;
> >> -
> >> bond_set_slave_active_flags(new_active,
> >> BOND_SLAVE_NOTIFY_NOW);
> >>
> >> @@ -1280,19 +1307,17 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
> >> old_active);
> >>
> >> if (netif_running(bond->dev)) {
> >> - bond->send_peer_notif =
> >> - bond->params.num_peer_notif *
> >> - max(1, bond->params.peer_notif_delay);
> >> - should_notify_peers =
> >> - bond_should_notify_peers(bond);
> >> + bond_peer_notify_reset(bond);
> >> +
> >> + if (bond_should_notify_peers(bond)) {
> >> + bond->send_peer_notif--;
> >> + call_netdevice_notifiers(
> >> + NETDEV_NOTIFY_PEERS,
> >> + bond->dev);
> >> + }
> >> }
> >>
> >> call_netdevice_notifiers(NETDEV_BONDING_FAILOVER, bond->dev);
> >> - if (should_notify_peers) {
> >> - bond->send_peer_notif--;
> >> - call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
> >> - bond->dev);
> >> - }
> >> }
> >> }
> >
> > I don’t see the benefit of moving NETDEV_NOTIFY_PEERS before NETDEV_BONDING_FAILOVER.
> > Is there a specific reason or scenario where this ordering change is required?
> No, to simplify the code, and use common peer notify reset function.
bond_change_active_slave() is called under RTNL lock. We can use
bond_peer_notify_reset() here. But I don't think there is a need to move
NETDEV_NOTIFY_PEERS before NETDEV_BONDING_FAILOVER.
Thanks
Hangbin
Powered by blists - more mailing lists