patch 'net/mlx5: fix statistics read on Linux' has been queued to stable release 21.11.2

Kevin Traynor ktraynor at redhat.com
Thu Jun 9 13:36:40 CEST 2022


Hi,

FYI, your patch has been queued to stable release 21.11.2

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/13/22. 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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/2d0228a9e95bfc46513969fb7f098d43a34e0d64

Thanks.

Kevin

---
>From 2d0228a9e95bfc46513969fb7f098d43a34e0d64 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Geoffrey=20Le=20Gourri=C3=A9rec?=
 <geoffrey.le_gourrierec at 6wind.com>
Date: Thu, 17 Mar 2022 14:23:48 +0100
Subject: [PATCH] net/mlx5: fix statistics read on Linux
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit eadc35df59a1a1a5017c0db1c7a9978ca8eb56e9 ]

This patch encompasses a few fixes carried by a previous patch
that aimed to support bonding device stats counting.

- If mlx5_os_read_dev_stat fails, it returns 1 instead of a
  negative value, causing mlx5_xstats_get to return an invalid
  number of counters. Since this error is not blocking, do not
  mess ret value with mlx5_os_read_dev_stat returned value.

  This allows avoiding the very annoying log:
  "n_xstats != n_xstats_names => skipping"

- Invert the check for mlx5_os_read_dev_stat(), currently leading
  us to store the result if the function failed, and use a
  backup value if it succeeded, which is the opposite of what we
  actually want. Revert to the original (correct) test.

- Add missing test on _mlx5_os_read_dev_counters() to prevent
  using trash stats values.

Fixes: 7ed15acdcd69 ("net/mlx5: improve xstats of bonding port")

Signed-off-by: Didier Pallard <didier.pallard at 6wind.com>
Signed-off-by: Geoffrey Le Gourriérec <geoffrey.le_gourrierec at 6wind.com>
Tested-by: Bassam Zaid AlKilani <bzalkilani at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_ethdev_os.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
index 8fe73f1adb..b5819cc656 100644
--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
@@ -1387,4 +1387,6 @@ mlx5_os_read_dev_counters(struct rte_eth_dev *dev, uint64_t *stats)
 	} else {
 		ret = _mlx5_os_read_dev_counters(dev, -1, stats);
+		if (ret)
+			return ret;
 	}
 	/* Read IB counters. */
@@ -1392,8 +1394,7 @@ mlx5_os_read_dev_counters(struct rte_eth_dev *dev, uint64_t *stats)
 		if (!xstats_ctrl->info[i].dev)
 			continue;
-		ret = mlx5_os_read_dev_stat(priv, xstats_ctrl->info[i].ctr_name,
-					    &stats[i]);
 		/* return last xstats counter if fail to read. */
-		if (ret != 0)
+		if (mlx5_os_read_dev_stat(priv, xstats_ctrl->info[i].ctr_name,
+			    &stats[i]) == 0)
 			xstats_ctrl->xstats[i] = stats[i];
 		else
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-09 12:34:30.985373149 +0100
+++ 0053-net-mlx5-fix-statistics-read-on-Linux.patch	2022-06-09 12:34:29.769980681 +0100
@@ -1 +1 @@
-From eadc35df59a1a1a5017c0db1c7a9978ca8eb56e9 Mon Sep 17 00:00:00 2001
+From 2d0228a9e95bfc46513969fb7f098d43a34e0d64 Mon Sep 17 00:00:00 2001
@@ -9,0 +10,2 @@
+[ upstream commit eadc35df59a1a1a5017c0db1c7a9978ca8eb56e9 ]
+
@@ -30 +31,0 @@
-Cc: stable at dpdk.org
@@ -41 +42 @@
-index 6fbfcfad48..8d30ad0994 100644
+index 8fe73f1adb..b5819cc656 100644



More information about the stable mailing list