patch 'net/bonding: fix failover time of LACP with mode 4' has been queued to stable release 22.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue Jun 25 01:57:55 CEST 2024


Hi,

FYI, your patch has been queued to stable release 22.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/6282bde96dc3f9d60c67eaaf4a340a20c3347829

Thanks.

Luca Boccassi

---
>From 6282bde96dc3f9d60c67eaaf4a340a20c3347829 Mon Sep 17 00:00:00 2001
From: Gaoxiang Liu <liugaoxiang at huawei.com>
Date: Mon, 6 Jun 2022 22:34:45 +0800
Subject: [PATCH] net/bonding: fix failover time of LACP with mode 4

[ upstream commit a78a1ed8ba6ae7666d13fee1895badb8eb2abf5f ]

When the primary port of bond member with bond mode 4 linked down,
the system id of the other member ports changed.
It may cause some switches to renegotiate, and the process takes a few
seconds. It is not acceptable for any Telcos.
We need sub-second switch-over time like in Linux.

Set the MAC of the bond port to the member port's system to solve the
problem.

Bugzilla ID: 551
Fixes: 46fb43683679 ("bond: add mode 4")

Signed-off-by: Gaoxiang Liu <liugaoxiang at huawei.com>
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 928dfca7af..2a81ab5bf3 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -865,7 +865,6 @@ bond_mode_8023ad_periodic_cb(void *arg)
 	struct bond_dev_private *internals = bond_dev->data->dev_private;
 	struct port *port;
 	struct rte_eth_link link_info;
-	struct rte_ether_addr slave_addr;
 	struct rte_mbuf *lacp_pkt = NULL;
 	uint16_t slave_id;
 	uint16_t i;
@@ -892,7 +891,6 @@ bond_mode_8023ad_periodic_cb(void *arg)
 			key = 0;
 		}
 
-		rte_eth_macaddr_get(slave_id, &slave_addr);
 		port = &bond_mode_8023ad_ports[slave_id];
 
 		key = rte_cpu_to_be_16(key);
@@ -904,8 +902,8 @@ bond_mode_8023ad_periodic_cb(void *arg)
 			SM_FLAG_SET(port, NTT);
 		}
 
-		if (!rte_is_same_ether_addr(&port->actor.system, &slave_addr)) {
-			rte_ether_addr_copy(&slave_addr, &port->actor.system);
+		if (!rte_is_same_ether_addr(&internals->mode4.mac_addr, &port->actor.system)) {
+			rte_ether_addr_copy(&internals->mode4.mac_addr, &port->actor.system);
 			if (port->aggregator_port_id == slave_id)
 				SM_FLAG_SET(port, NTT);
 		}
@@ -1171,21 +1169,20 @@ void
 bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev)
 {
 	struct bond_dev_private *internals = bond_dev->data->dev_private;
-	struct rte_ether_addr slave_addr;
 	struct port *slave, *agg_slave;
 	uint16_t slave_id, i, j;
 
 	bond_mode_8023ad_stop(bond_dev);
 
+	rte_eth_macaddr_get(internals->port_id, &internals->mode4.mac_addr);
 	for (i = 0; i < internals->active_slave_count; i++) {
 		slave_id = internals->active_slaves[i];
 		slave = &bond_mode_8023ad_ports[slave_id];
-		rte_eth_macaddr_get(slave_id, &slave_addr);
 
-		if (rte_is_same_ether_addr(&slave_addr, &slave->actor.system))
+		if (rte_is_same_ether_addr(&internals->mode4.mac_addr, &slave->actor.system))
 			continue;
 
-		rte_ether_addr_copy(&slave_addr, &slave->actor.system);
+		rte_ether_addr_copy(&internals->mode4.mac_addr, &slave->actor.system);
 		/* Do nothing if this port is not an aggregator. In other case
 		 * Set NTT flag on every port that use this aggregator. */
 		if (slave->aggregator_port_id != slave_id)
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:14.010325082 +0100
+++ 0009-net-bonding-fix-failover-time-of-LACP-with-mode-4.patch	2024-06-25 00:22:13.073183366 +0100
@@ -1 +1 @@
-From a78a1ed8ba6ae7666d13fee1895badb8eb2abf5f Mon Sep 17 00:00:00 2001
+From 6282bde96dc3f9d60c67eaaf4a340a20c3347829 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a78a1ed8ba6ae7666d13fee1895badb8eb2abf5f ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index 79f1b3f1a0..06c21ebe6d 100644
+index 928dfca7af..2a81ab5bf3 100644
@@ -32 +33 @@
--	struct rte_ether_addr member_addr;
+-	struct rte_ether_addr slave_addr;
@@ -34 +35 @@
- 	uint16_t member_id;
+ 	uint16_t slave_id;
@@ -40,2 +41,2 @@
--		rte_eth_macaddr_get(member_id, &member_addr);
- 		port = &bond_mode_8023ad_ports[member_id];
+-		rte_eth_macaddr_get(slave_id, &slave_addr);
+ 		port = &bond_mode_8023ad_ports[slave_id];
@@ -48,2 +49,2 @@
--		if (!rte_is_same_ether_addr(&port->actor.system, &member_addr)) {
--			rte_ether_addr_copy(&member_addr, &port->actor.system);
+-		if (!rte_is_same_ether_addr(&port->actor.system, &slave_addr)) {
+-			rte_ether_addr_copy(&slave_addr, &port->actor.system);
@@ -52 +53 @@
- 			if (port->aggregator_port_id == member_id)
+ 			if (port->aggregator_port_id == slave_id)
@@ -55 +56 @@
-@@ -1173,21 +1171,20 @@ void
+@@ -1171,21 +1169,20 @@ void
@@ -59,3 +60,3 @@
--	struct rte_ether_addr member_addr;
- 	struct port *member, *agg_member;
- 	uint16_t member_id, i, j;
+-	struct rte_ether_addr slave_addr;
+ 	struct port *slave, *agg_slave;
+ 	uint16_t slave_id, i, j;
@@ -66,4 +67,4 @@
- 	for (i = 0; i < internals->active_member_count; i++) {
- 		member_id = internals->active_members[i];
- 		member = &bond_mode_8023ad_ports[member_id];
--		rte_eth_macaddr_get(member_id, &member_addr);
+ 	for (i = 0; i < internals->active_slave_count; i++) {
+ 		slave_id = internals->active_slaves[i];
+ 		slave = &bond_mode_8023ad_ports[slave_id];
+-		rte_eth_macaddr_get(slave_id, &slave_addr);
@@ -71,2 +72,2 @@
--		if (rte_is_same_ether_addr(&member_addr, &member->actor.system))
-+		if (rte_is_same_ether_addr(&internals->mode4.mac_addr, &member->actor.system))
+-		if (rte_is_same_ether_addr(&slave_addr, &slave->actor.system))
++		if (rte_is_same_ether_addr(&internals->mode4.mac_addr, &slave->actor.system))
@@ -75,2 +76,2 @@
--		rte_ether_addr_copy(&member_addr, &member->actor.system);
-+		rte_ether_addr_copy(&internals->mode4.mac_addr, &member->actor.system);
+-		rte_ether_addr_copy(&slave_addr, &slave->actor.system);
++		rte_ether_addr_copy(&internals->mode4.mac_addr, &slave->actor.system);
@@ -79 +80 @@
- 		if (member->aggregator_port_id != member_id)
+ 		if (slave->aggregator_port_id != slave_id)


More information about the stable mailing list