[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d3624dc9-848a-4c59-84d2-8663f0827937@redhat.com>
Date: Thu, 15 Jan 2026 11:46:41 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Tonghao Zhang <tonghao@...aicloud.com>, netdev@...r.kernel.org
Cc: Jay Vosburgh <jv@...sburgh.net>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Simon Horman <horms@...nel.org>, Jonathan Corbet <corbet@....net>,
Andrew Lunn <andrew+netdev@...n.ch>,
Nikolay Aleksandrov <razor@...ckwall.org>, Hangbin Liu
<liuhangbin@...il.com>, Jason Xing <kerneljasonxing@...il.com>
Subject: Re: [PATCH RESEND net-next v4 1/4] net: bonding: use workqueue to
make sure peer notify updated in lacp mode
On 1/12/26 3:40 AM, Tonghao Zhang wrote:
> +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.
> @@ -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.
Thanks,
Paolo
Powered by blists - more mailing lists