Re: [PATCH RESEND net-next v4 1/4] net: bonding: use workqueue to make sure peer notify updated in lacp mode
From: Tonghao Zhang <hidden>
Date: 2026-01-16 02:46:18
On Jan 15, 2026, at 18:46, Paolo Abeni [off-list ref] wrote: On 1/12/26 3:40 AM, Tonghao Zhang wrote:quoted
+static void bond_peer_notify_handler(struct work_struct *work) +{ + struct bonding *bond = container_of(work, struct bonding, + peer_notify_work.work); + + if (!rtnl_trylock()) { + bond_peer_notify_work_rearm(bond, 1); + return; + } + + bond_peer_notify_reset(bond); + + rtnl_unlock(); + return;I'm sorry for nit picking, but this is a bit ugly: please remove the `return;` statement above.
oops, ok, thanks.
quoted
@@ -1279,19 +1306,17 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)bond_do_fail_over_mac(bond, new_active, old_active); + call_netdevice_notifiers(NETDEV_BONDING_FAILOVER, bond->dev); + 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); - call_netdevice_notifiers(NETDEV_BONDING_FAILOVER, bond->dev); - if (should_notify_peers) { - bond->send_peer_notif--; - call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, - bond->dev); + if (bond_should_notify_peers(bond)) { + bond->send_peer_notif--; + call_netdevice_notifiers( + NETDEV_NOTIFY_PEERS, + bond->dev);Since a repost is needed, plase move this if block to a separate helper to reduce indentation and avoid bad formatting.
ok
Thanks, Paolo