[dpdk-stable] patch 'net/bonding: fix selection logic' has been queued to LTS release 17.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Dec 19 15:34:35 CET 2019


Hi,

FYI, your patch has been queued to LTS release 17.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/21/19. 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.

Thanks.

Luca Boccassi

---
>From 7e0491c6cedd771c89ddc5bb5d5cb63f21eb41b4 Mon Sep 17 00:00:00 2001
From: Krzysztof Kanas <kkanas at marvell.com>
Date: Wed, 13 Nov 2019 09:22:24 +0100
Subject: [PATCH] net/bonding: fix selection logic

[ upstream commit 8d75f49e61c11bff2ecf48818f7acf4520329848 ]

Arrays agg_count and agg_bandwidth should be indexed by slave_id not by
aggregator port_id.

The new_agg_id should be chosen as slave_id from slaves table in
different selection modes.

Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")

Signed-off-by: Krzysztof Kanas <kkanas at marvell.com>
Acked-by: Chas Williams <chas3 at att.com>
Acked-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 4b98730bd7..d369576c6a 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -693,9 +693,8 @@ selection_logic(struct bond_dev_private *internals, uint8_t slave_id)
 	uint64_t agg_bandwidth[RTE_MAX_ETHPORTS] = {0};
 	uint64_t agg_count[RTE_MAX_ETHPORTS] = {0};
 	uint16_t default_slave = 0;
-	uint16_t mode_count_id;
-	uint16_t mode_band_id;
 	struct rte_eth_link link_info;
+	uint16_t agg_new_idx = 0;
 
 	slaves = internals->active_slaves;
 	slaves_count = internals->active_slave_count;
@@ -708,9 +707,9 @@ selection_logic(struct bond_dev_private *internals, uint8_t slave_id)
 		if (agg->aggregator_port_id != slaves[i])
 			continue;
 
-		agg_count[agg->aggregator_port_id] += 1;
+		agg_count[i] += 1;
 		rte_eth_link_get_nowait(slaves[i], &link_info);
-		agg_bandwidth[agg->aggregator_port_id] += link_info.link_speed;
+		agg_bandwidth[i] += link_info.link_speed;
 
 		/* Actors system ID is not checked since all slave device have the same
 		 * ID (MAC address). */
@@ -730,22 +729,22 @@ selection_logic(struct bond_dev_private *internals, uint8_t slave_id)
 
 	switch (internals->mode4.agg_selection) {
 	case AGG_COUNT:
-		mode_count_id = max_index(agg_count, slaves_count);
-		new_agg_id = mode_count_id;
+		agg_new_idx = max_index(agg_count, slaves_count);
+		new_agg_id = slaves[agg_new_idx];
 		break;
 	case AGG_BANDWIDTH:
-		mode_band_id = max_index(agg_bandwidth, slaves_count);
-		new_agg_id = mode_band_id;
+		agg_new_idx = max_index(agg_bandwidth, slaves_count);
+		new_agg_id = slaves[agg_new_idx];
 		break;
 	case AGG_STABLE:
 		if (default_slave == slaves_count)
-			new_agg_id = slave_id;
+			new_agg_id = slaves[slave_id];
 		else
 			new_agg_id = slaves[default_slave];
 		break;
 	default:
 		if (default_slave == slaves_count)
-			new_agg_id = slave_id;
+			new_agg_id = slaves[slave_id];
 		else
 			new_agg_id = slaves[default_slave];
 		break;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-19 14:32:31.421525867 +0000
+++ 0128-net-bonding-fix-selection-logic.patch	2019-12-19 14:32:26.333302346 +0000
@@ -1,8 +1,10 @@
-From 8d75f49e61c11bff2ecf48818f7acf4520329848 Mon Sep 17 00:00:00 2001
+From 7e0491c6cedd771c89ddc5bb5d5cb63f21eb41b4 Mon Sep 17 00:00:00 2001
 From: Krzysztof Kanas <kkanas at marvell.com>
 Date: Wed, 13 Nov 2019 09:22:24 +0100
 Subject: [PATCH] net/bonding: fix selection logic
 
+[ upstream commit 8d75f49e61c11bff2ecf48818f7acf4520329848 ]
+
 Arrays agg_count and agg_bandwidth should be indexed by slave_id not by
 aggregator port_id.
 
@@ -10,7 +12,6 @@
 different selection modes.
 
 Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")
-Cc: stable at dpdk.org
 
 Signed-off-by: Krzysztof Kanas <kkanas at marvell.com>
 Acked-by: Chas Williams <chas3 at att.com>
@@ -20,10 +21,10 @@
  1 file changed, 9 insertions(+), 10 deletions(-)
 
 diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
-index 05b3004c4c..b77a37ddb3 100644
+index 4b98730bd7..d369576c6a 100644
 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c
 +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
-@@ -673,9 +673,8 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id)
+@@ -693,9 +693,8 @@ selection_logic(struct bond_dev_private *internals, uint8_t slave_id)
  	uint64_t agg_bandwidth[RTE_MAX_ETHPORTS] = {0};
  	uint64_t agg_count[RTE_MAX_ETHPORTS] = {0};
  	uint16_t default_slave = 0;
@@ -31,21 +32,22 @@
 -	uint16_t mode_band_id;
  	struct rte_eth_link link_info;
 +	uint16_t agg_new_idx = 0;
- 	int ret;
  
  	slaves = internals->active_slaves;
-@@ -696,8 +695,8 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id)
- 				slaves[i], rte_strerror(-ret));
+ 	slaves_count = internals->active_slave_count;
+@@ -708,9 +707,9 @@ selection_logic(struct bond_dev_private *internals, uint8_t slave_id)
+ 		if (agg->aggregator_port_id != slaves[i])
  			continue;
- 		}
+ 
 -		agg_count[agg->aggregator_port_id] += 1;
--		agg_bandwidth[agg->aggregator_port_id] += link_info.link_speed;
 +		agg_count[i] += 1;
+ 		rte_eth_link_get_nowait(slaves[i], &link_info);
+-		agg_bandwidth[agg->aggregator_port_id] += link_info.link_speed;
 +		agg_bandwidth[i] += link_info.link_speed;
  
  		/* Actors system ID is not checked since all slave device have the same
  		 * ID (MAC address). */
-@@ -718,22 +717,22 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id)
+@@ -730,22 +729,22 @@ selection_logic(struct bond_dev_private *internals, uint8_t slave_id)
  
  	switch (internals->mode4.agg_selection) {
  	case AGG_COUNT:


More information about the stable mailing list