[dpdk-stable] patch 'net/mlx5: fix HW counters path in switchdev mode' has been queued to stable release 19.11.4
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Fri Jul 24 14:00:10 CEST 2020
Hi,
FYI, your patch has been queued to stable release 19.11.4
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/26/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.
Thanks.
Luca Boccassi
---
>From 9b7e7f229e94d30d6de0bd0782b778c379dba898 Mon Sep 17 00:00:00 2001
From: Shy Shyman <shys at mellanox.com>
Date: Wed, 15 Jul 2020 13:50:55 +0300
Subject: [PATCH] net/mlx5: fix HW counters path in switchdev mode
[ upstream commit 038e7fc085746167f8a50c1612acada5a78fc7da ]
When debugging performance of a DPDK application the user may
need to view the different statistics of DPDK (for example out_of_buffer)
This can be enabled by using testpmd command 'show port xstats
<port_id>' for example.
The current implementation assumes legacy mode in which the counters
are at <ibdev_path>/<port_id>/hw_counters/<file_name>.
In switchdev mode the counters file is located right after the device
name, hence resides at <ibdev_path>/hw_counters.
The fix tries to open the path in the second location after a failure
to open the file from the first location.
Fixes: 9c0a9eed37f1 ("net/mlx5: switch to the names in the shared IB context")
Signed-off-by: Shy Shyman <shys at mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
---
drivers/net/mlx5/mlx5_stats.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index 636fc80c7..f3ec9543f 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -145,10 +145,20 @@ mlx5_read_ib_stat(struct mlx5_priv *priv, const char *ctr_name, uint64_t *stat)
if (priv->sh) {
MKSTR(path, "%s/ports/%d/hw_counters/%s",
- priv->sh->ibdev_path,
- priv->ibv_port,
- ctr_name);
+ priv->sh->ibdev_path,
+ priv->ibv_port,
+ ctr_name);
fd = open(path, O_RDONLY);
+ /*
+ * in switchdev the file location is not per port
+ * but rather in <ibdev_path>/hw_counters/<file_name>.
+ */
+ if (fd == -1) {
+ MKSTR(path1, "%s/hw_counters/%s",
+ priv->sh->ibdev_path,
+ ctr_name);
+ fd = open(path1, O_RDONLY);
+ }
if (fd != -1) {
char buf[21] = {'\0'};
ssize_t n = read(fd, buf, sizeof(buf));
--
2.20.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2020-07-24 12:53:55.187825621 +0100
+++ 0172-net-mlx5-fix-HW-counters-path-in-switchdev-mode.patch 2020-07-24 12:53:48.579011900 +0100
@@ -1,8 +1,10 @@
-From 038e7fc085746167f8a50c1612acada5a78fc7da Mon Sep 17 00:00:00 2001
+From 9b7e7f229e94d30d6de0bd0782b778c379dba898 Mon Sep 17 00:00:00 2001
From: Shy Shyman <shys at mellanox.com>
Date: Wed, 15 Jul 2020 13:50:55 +0300
Subject: [PATCH] net/mlx5: fix HW counters path in switchdev mode
+[ upstream commit 038e7fc085746167f8a50c1612acada5a78fc7da ]
+
When debugging performance of a DPDK application the user may
need to view the different statistics of DPDK (for example out_of_buffer)
This can be enabled by using testpmd command 'show port xstats
@@ -17,27 +19,26 @@
to open the file from the first location.
Fixes: 9c0a9eed37f1 ("net/mlx5: switch to the names in the shared IB context")
-Cc: stable at dpdk.org
Signed-off-by: Shy Shyman <shys at mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
---
- drivers/net/mlx5/linux/mlx5_os.c | 16 +++++++++++++---
+ drivers/net/mlx5/mlx5_stats.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
-diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
-index 9622eb31e..c4e6c6f6f 100644
---- a/drivers/net/mlx5/linux/mlx5_os.c
-+++ b/drivers/net/mlx5/linux/mlx5_os.c
-@@ -2166,10 +2166,20 @@ mlx5_os_read_dev_stat(struct mlx5_priv *priv, const char *ctr_name,
+diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
+index 636fc80c7..f3ec9543f 100644
+--- a/drivers/net/mlx5/mlx5_stats.c
++++ b/drivers/net/mlx5/mlx5_stats.c
+@@ -145,10 +145,20 @@ mlx5_read_ib_stat(struct mlx5_priv *priv, const char *ctr_name, uint64_t *stat)
if (priv->sh) {
MKSTR(path, "%s/ports/%d/hw_counters/%s",
- priv->sh->ibdev_path,
-- priv->dev_port,
+- priv->ibv_port,
- ctr_name);
+ priv->sh->ibdev_path,
-+ priv->dev_port,
++ priv->ibv_port,
+ ctr_name);
fd = open(path, O_RDONLY);
+ /*
More information about the stable
mailing list