[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <7FEDE75E-551D-4B29-86A2-526AA3556CDC@bamaicloud.com>
Date: Mon, 1 Dec 2025 19:01:23 +0800
From: Tonghao Zhang <tonghao@...aicloud.com>
To: Hangbin Liu <liuhangbin@...il.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 Dec 1, 2025, at 18:05, Hangbin Liu <liuhangbin@...il.com> wrote:
>
> 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.
Is there a dependency relationship between NETDEV_NOTIFY_PEERS and NETDEV_BONDING_FAILOVER?
In vlan, macvlan, ipvlan netdev, NETDEV_NOTIFY_PEERS and NETDEV_BONDING_FAILOVER use the same action.
net/8021q/vlan.c
drivers/net/macvlan.c
drivers/net/ipvlan/ipvlan_main.c
>
> Thanks
> Hangbin
>
>
Powered by blists - more mailing lists