netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: Tonghao Zhang <tonghao@bamaicloud.com>
Cc: netdev@vger.kernel.org, Jay Vosburgh <jv@jvosburgh.net>,
	"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>,
	Jason Xing <kerneljasonxing@gmail.com>
Subject: Re: [PATCH net-next v3 1/4] net: bonding: use workqueue to make sure peer notify updated in lacp mode
Date: Mon, 1 Dec 2025 06:57:59 +0000	[thread overview]
Message-ID: <aS08d1dOC2EOvz-U@fedora> (raw)
In-Reply-To: <20251130074846.36787-2-tonghao@bamaicloud.com>

Hi Tonghao,
On Sun, Nov 30, 2025 at 03:48:43PM +0800, Tonghao Zhang wrote:
> ---
> v1:
> - This patch is actually version v3, https://patchwork.kernel.org/project/netdevbpf/patch/20251118090305.35558-1-tonghao@bamaicloud.com/
> - add a comment why we use the trylock.
> - add this patch to series
> ---

I think you can move the change logs to cover letter.

>  /**
>   * 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?

Thanks
Hangbin

  reply	other threads:[~2025-12-01  6:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-30  7:48 [PATCH net-next v3 0/4] A series of minor optimizations of the bonding module Tonghao Zhang
2025-11-30  7:48 ` [PATCH net-next v3 1/4] net: bonding: use workqueue to make sure peer notify updated in lacp mode Tonghao Zhang
2025-12-01  6:57   ` Hangbin Liu [this message]
2025-12-01  9:45     ` Tonghao Zhang
2025-12-01 10:05       ` Hangbin Liu
2025-12-01 11:01         ` Tonghao Zhang
2025-12-01 13:56           ` Hangbin Liu
2025-12-22 13:53             ` Tonghao Zhang
2025-11-30  7:48 ` [PATCH net-next v3 2/4] net: bonding: move bond_should_notify_peers, e.g. into rtnl lock block Tonghao Zhang
2025-12-01  7:23   ` Hangbin Liu
2025-12-02  1:54   ` Jason Xing
2025-12-22 14:24     ` Tonghao Zhang
2025-11-30  7:48 ` [PATCH net-next v3 3/4] net: bonding: skip the 2nd trylock when first one fail Tonghao Zhang
2025-12-01  7:35   ` Hangbin Liu
2025-12-22 14:15     ` Tonghao Zhang
2025-12-24  6:00       ` Hangbin Liu
2025-11-30  7:48 ` [PATCH net-next v3 4/4] net: bonding: add the READ_ONCE/WRITE_ONCE for outside lock accessing Tonghao Zhang
2025-12-01  7:43   ` Hangbin Liu
2025-12-01  7:24 ` [PATCH net-next v3 0/4] A series of minor optimizations of the bonding module Hangbin Liu

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=aS08d1dOC2EOvz-U@fedora \
    --to=liuhangbin@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jv@jvosburgh.net \
    --cc=kerneljasonxing@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).