[dpdk-stable] patch 'net/mlx5: fix switch port id when representor in bonding' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue Nov 17 12:13:49 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.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 11/19/20. 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/b056b956bb62564d08f8451664bbc47932865f8f

Thanks.

Luca Boccassi

---
>From b056b956bb62564d08f8451664bbc47932865f8f Mon Sep 17 00:00:00 2001
From: Dong Zhou <dongzhou at nvidia.com>
Date: Wed, 4 Nov 2020 08:04:55 +0200
Subject: [PATCH] net/mlx5: fix switch port id when representor in bonding

[ upstream commit cdbdcd46a2b915c0781ecb2f48f412237daf03da ]

In the bonding configurations the port switch id for representors was
composed of pf index in bonding as the 1 MSB and the representor's index
as the remaining 15 LSBs. The special corner case for the host PF
representor on BF setups with representor id 0xFFFF was missed as well.

The new switch port id consists of 4 MSBs for the pf bonding index and
the remaining 12 LSBs for the representor index. The switch port id
ranges for each type of representors are as follows:

Uplink representor(AKA master): 0xFFFF
Host PF representor: 0x<pf_bond>FFF
VF representor: 0x<pf_bond>[0-FFE]

Fixes: bee57a0a3565 ("net/mlx5: update switch port id in bonding configuration")

Signed-off-by: Dong Zhou <dongzhou at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/net/mlx5/mlx5_defs.h   |  2 +-
 drivers/net/mlx5/mlx5_ethdev.c | 12 ++++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h
index 418e744d65..2836099b75 100644
--- a/drivers/net/mlx5/mlx5_defs.h
+++ b/drivers/net/mlx5/mlx5_defs.h
@@ -61,7 +61,7 @@
 
 /* Switch port ID parameters for bonding configurations. */
 #define MLX5_PORT_ID_BONDING_PF_MASK 0xf
-#define MLX5_PORT_ID_BONDING_PF_SHIFT 0xf
+#define MLX5_PORT_ID_BONDING_PF_SHIFT 12
 
 /* Alarm timeout. */
 #define MLX5_ALARM_TIMEOUT_US 100000
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index a6a091259e..efcc69ca44 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -646,14 +646,22 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 			 * representors (more than 4K) or PFs (more than 15)
 			 * this approach must be reconsidered.
 			 */
-			if ((info->switch_info.port_id >>
-				MLX5_PORT_ID_BONDING_PF_SHIFT) ||
+			/* Switch port ID for VF representors: 0 - 0xFFE */
+			if ((info->switch_info.port_id != 0xffff &&
+				info->switch_info.port_id >=
+				((1 << MLX5_PORT_ID_BONDING_PF_SHIFT) - 1)) ||
 			    priv->pf_bond > MLX5_PORT_ID_BONDING_PF_MASK) {
 				DRV_LOG(ERR, "can't update switch port ID"
 					     " for bonding device");
 				assert(false);
 				return -ENODEV;
 			}
+			/*
+			 * Switch port ID for Host PF representor
+			 * (representor_id is -1) , set to 0xFFF
+			 */
+			if (info->switch_info.port_id == 0xffff)
+				info->switch_info.port_id = 0xfff;
 			info->switch_info.port_id |=
 				priv->pf_bond << MLX5_PORT_ID_BONDING_PF_SHIFT;
 		}
-- 
2.27.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-11-17 11:13:13.606868936 +0000
+++ 0015-net-mlx5-fix-switch-port-id-when-representor-in-bond.patch	2020-11-17 11:13:12.885115884 +0000
@@ -1 +1 @@
-From cdbdcd46a2b915c0781ecb2f48f412237daf03da Mon Sep 17 00:00:00 2001
+From b056b956bb62564d08f8451664bbc47932865f8f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit cdbdcd46a2b915c0781ecb2f48f412237daf03da ]
+
@@ -20 +21,0 @@
-Cc: stable at dpdk.org
@@ -30 +31 @@
-index 3c34234152..aa55db3750 100644
+index 418e744d65..2836099b75 100644
@@ -33 +34 @@
-@@ -50,7 +50,7 @@
+@@ -61,7 +61,7 @@
@@ -43 +44 @@
-index ee97480dcb..a3910cf922 100644
+index a6a091259e..efcc69ca44 100644
@@ -46 +47 @@
-@@ -338,14 +338,22 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
+@@ -646,14 +646,22 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
@@ -59 +60 @@
- 				MLX5_ASSERT(false);
+ 				assert(false);


More information about the stable mailing list