[dpdk-stable] patch 'net/mlx5: fix switchdev mode recognition' has been queued to stable release 20.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Jul 12 15:04:33 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.3

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

Thanks.

Luca Boccassi

---
>From 2bff62754f101af9e7d60a8dc9ab5b2603c3daaa Mon Sep 17 00:00:00 2001
From: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
Date: Fri, 11 Jun 2021 18:37:19 +0300
Subject: [PATCH] net/mlx5: fix switchdev mode recognition

[ upstream commit 6b157f3bfa64b734a069772bdbb4a3d3a8d26b83 ]

The new kernels might add the switch_id attribute to the
Netlink replies and this caused the wrong recognition
of the E-Switch presence. The single uplink device was
erroneously recognized as master and it caused the
extending match for source vport index on all installed
flows, including the default ones, and adding extra hops
in the steering engine, that affected the maximal
throughput packet rate.

The extra check for the new device name format (it supposes
the new kernel) and the device is only one is added. If this
check succeeds the E-Switch presence is considered as wrongly
detected and overridden.

Fixes: 30a86157f6d5 ("net/mlx5: support PF representor")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_os.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 800df92997..71837e34fe 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -2114,6 +2114,18 @@ mlx5_os_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 			ret = -rte_errno;
 			goto exit;
 		}
+		/*
+		 * New kernels may add the switch_id attribute for the case
+		 * there is no E-Switch and we wrongly recognized the
+		 * only device as master. Override this if there is the
+		 * single device with single port and new device name
+		 * format present.
+		 */
+		if (nd == 1 &&
+		    list[0].info.name_type == MLX5_PHYS_PORT_NAME_TYPE_UPLINK) {
+			list[0].info.master = 0;
+			list[0].info.representor = 0;
+		}
 	}
 	MLX5_ASSERT(ns);
 	/*
-- 
2.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-07-12 13:41:38.655304661 +0100
+++ 0038-net-mlx5-fix-switchdev-mode-recognition.patch	2021-07-12 13:41:36.314118944 +0100
@@ -1 +1 @@
-From 6b157f3bfa64b734a069772bdbb4a3d3a8d26b83 Mon Sep 17 00:00:00 2001
+From 2bff62754f101af9e7d60a8dc9ab5b2603c3daaa Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6b157f3bfa64b734a069772bdbb4a3d3a8d26b83 ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -30 +31 @@
-index 534a56a555..302a881310 100644
+index 800df92997..71837e34fe 100644
@@ -33 +34 @@
-@@ -2298,6 +2298,18 @@ mlx5_os_pci_probe_pf(struct rte_pci_device *pci_dev,
+@@ -2114,6 +2114,18 @@ mlx5_os_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,


More information about the stable mailing list