netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Vosburgh <jv@jvosburgh.net>
To: tonghao@bamaicloud.com
Cc: netdev@vger.kernel.org, "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>
Subject: Re: [PATCH net-next 3/4] net: bonding: send peer notify when failure recovery
Date: Sat, 10 May 2025 15:01:21 +0200	[thread overview]
Message-ID: <1133780.1746882081@vermin> (raw)
In-Reply-To: <20250510044504.52618-4-tonghao@bamaicloud.com>

tonghao@bamaicloud.com wrote:

>From: Tonghao Zhang <tonghao@bamaicloud.com>
>
>While hardware failures in NICs, optical transceivers, or switches
>are unavoidable, rapid system recovery can be achieved post-restoration.
>For example, triggering immediate ARP/ND packet transmission upon
>LACP failure recovery enables the system to swiftly resume normal
>operations, thereby minimizing service downtime.

	I think this comment needs to be prefaced with something that
explains that this logic is for the "no stack" architecture.  It don't
need the entire blurb about what that is, though.

>Cc: Jay Vosburgh <jv@jvosburgh.net>
>Cc: "David S. Miller" <davem@davemloft.net>
>Cc: Eric Dumazet <edumazet@google.com>
>Cc: Jakub Kicinski <kuba@kernel.org>
>Cc: Paolo Abeni <pabeni@redhat.com>
>Cc: Simon Horman <horms@kernel.org>
>Cc: Jonathan Corbet <corbet@lwn.net>
>Cc: Andrew Lunn <andrew+netdev@lunn.ch>
>Signed-off-by: Tonghao Zhang <tonghao@bamaicloud.com>
>---
> drivers/net/bonding/bond_3ad.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
>diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>index c6807e473ab7..6577ce54d115 100644
>--- a/drivers/net/bonding/bond_3ad.c
>+++ b/drivers/net/bonding/bond_3ad.c
>@@ -982,6 +982,19 @@ static int ad_marker_send(struct port *port, struct bond_marker *marker)
> 	return 0;
> }
> 
>+static void ad_peer_notif_send(struct port *port)
>+{
>+	if (!port->aggregator->is_active)
>+		return;
>+
>+	struct bonding *bond = port->slave->bond;
>+	if (bond->params.broadcast_neighbor && rtnl_trylock()) {
>+		bond->send_peer_notif = bond->params.num_peer_notif *
>+			max(1, bond->params.peer_notif_delay);
>+		rtnl_unlock();
>+	}
>+}
>+

	I'm not a fan of the function name, as this doesn't actually
send any notifications.  Perhaps "ad_cond_set_peer_notif"?  I.e.,
conditionally set peer notifications on?

> /**
>  * ad_mux_machine - handle a port's mux state machine
>  * @port: the port we're looking at
>@@ -1164,6 +1177,7 @@ static void ad_mux_machine(struct port *port, bool *update_slave_arr)
> 			port->actor_oper_port_state |= LACP_STATE_COLLECTING;
> 			port->actor_oper_port_state |= LACP_STATE_DISTRIBUTING;
> 			port->actor_oper_port_state |= LACP_STATE_SYNCHRONIZATION;
>+			ad_peer_notif_send(port);
> 			ad_enable_collecting_distributing(port,
> 							  update_slave_arr);
> 			port->ntt = true;

	This is in the AD_MUX_COLLECTING_DISTRIBUTING case, I think you
need another one of these in the AD_MUX_DISTRIBUTING case a few lines
further down to handle the situation when coupled_control is disabled.

	-J

>-- 
>2.34.1
>

---
	-Jay Vosburgh, jv@jvosburgh.net

  reply	other threads:[~2025-05-10 13:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-10  4:45 [PATCH net-next 0/4] add broadcast_neighbor for no-stacking networking arch tonghao
2025-05-10  4:45 ` [PATCH net-next 1/4] net: bonding: add broadcast_neighbor option for 802.3ad tonghao
2025-05-10 12:44   ` Jay Vosburgh
2025-05-10 13:47     ` Andrew Lunn
2025-05-11 14:07     ` Tonghao Zhang
2025-05-11 15:53       ` Andrew Lunn
2025-05-12  2:25         ` Tonghao Zhang
2025-05-12  9:19           ` Jay Vosburgh
2025-05-12 14:55             ` Tonghao Zhang
2025-05-12  8:22   ` Hangbin Liu
2025-05-12  8:55     ` Tonghao Zhang
2025-05-10  4:45 ` [PATCH net-next 2/4] net: bonding: add broadcast_neighbor netlink option tonghao
2025-05-10  4:45 ` [PATCH net-next 3/4] net: bonding: send peer notify when failure recovery tonghao
2025-05-10 13:01   ` Jay Vosburgh [this message]
2025-05-11 14:34     ` Tonghao Zhang
2025-05-12  8:05   ` Hangbin Liu
2025-05-12  9:16     ` Tonghao Zhang
2025-05-10  4:45 ` [PATCH net-next 4/4] net: bonding: add tracepoint for 802.3ad tonghao

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=1133780.1746882081@vermin \
    --to=jv@jvosburgh.net \
    --cc=andrew+netdev@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --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).