[dpdk-stable] patch 'net/mlx5: use open/read/close for ib stats query' has been queued to stable release 19.11.3
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Tue May 19 15:03:36 CEST 2020
Hi,
FYI, your patch has been queued to stable release 19.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 05/21/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 fd2f1973f408d51e47a1a3cbd38f0e661b15b59d Mon Sep 17 00:00:00 2001
From: Mohsin Shaikh <mohsinshaikh at niometrics.com>
Date: Fri, 10 Apr 2020 04:37:06 +0800
Subject: [PATCH] net/mlx5: use open/read/close for ib stats query
[ upstream commit 00437823cb80b8fa87dbe61becc07bd42ee98549 ]
fgets(3)/fread(3)/fscanf(3) etc. use mmap(2)/munmap(2) which leads
to TLB shutdown interrupts to all DPDK app cores including RX cores.
This can cause packet drops. Use read(2)/write(2) instead.
Bugzilla ID: 440
Signed-off-by: Mohsin Shaikh <mohsinshaikh at niometrics.com>
Reviewed-by: Alexander Kozyrev <akozyrev at mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
---
drivers/net/mlx5/mlx5_stats.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index d60a633e15..636fc80c7c 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -3,11 +3,13 @@
* Copyright 2015 Mellanox Technologies, Ltd
*/
+#include <fcntl.h>
#include <inttypes.h>
#include <linux/sockios.h>
#include <linux/ethtool.h>
#include <stdint.h>
#include <stdio.h>
+#include <unistd.h>
#include <rte_ethdev_driver.h>
#include <rte_common.h>
@@ -139,20 +141,23 @@ static const unsigned int xstats_n = RTE_DIM(mlx5_counters_init);
static inline int
mlx5_read_ib_stat(struct mlx5_priv *priv, const char *ctr_name, uint64_t *stat)
{
- FILE *file;
+ int fd;
+
if (priv->sh) {
MKSTR(path, "%s/ports/%d/hw_counters/%s",
priv->sh->ibdev_path,
priv->ibv_port,
ctr_name);
+ fd = open(path, O_RDONLY);
+ if (fd != -1) {
+ char buf[21] = {'\0'};
+ ssize_t n = read(fd, buf, sizeof(buf));
- file = fopen(path, "rb");
- if (file) {
- int n = fscanf(file, "%" SCNu64, stat);
-
- fclose(file);
- if (n == 1)
+ close(fd);
+ if (n != -1) {
+ *stat = strtoull(buf, NULL, 10);
return 0;
+ }
}
}
*stat = 0;
--
2.20.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2020-05-19 14:04:47.755394437 +0100
+++ 0081-net-mlx5-use-open-read-close-for-ib-stats-query.patch 2020-05-19 14:04:44.248648953 +0100
@@ -1,14 +1,15 @@
-From 00437823cb80b8fa87dbe61becc07bd42ee98549 Mon Sep 17 00:00:00 2001
+From fd2f1973f408d51e47a1a3cbd38f0e661b15b59d Mon Sep 17 00:00:00 2001
From: Mohsin Shaikh <mohsinshaikh at niometrics.com>
Date: Fri, 10 Apr 2020 04:37:06 +0800
Subject: [PATCH] net/mlx5: use open/read/close for ib stats query
+[ upstream commit 00437823cb80b8fa87dbe61becc07bd42ee98549 ]
+
fgets(3)/fread(3)/fscanf(3) etc. use mmap(2)/munmap(2) which leads
to TLB shutdown interrupts to all DPDK app cores including RX cores.
This can cause packet drops. Use read(2)/write(2) instead.
Bugzilla ID: 440
-Cc: stable at dpdk.org
Signed-off-by: Mohsin Shaikh <mohsinshaikh at niometrics.com>
Reviewed-by: Alexander Kozyrev <akozyrev at mellanox.com>
@@ -18,7 +19,7 @@
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
-index 5bc6fa6aa1..b4ca6922a4 100644
+index d60a633e15..636fc80c7c 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -3,11 +3,13 @@
@@ -35,7 +36,7 @@
#include <rte_ethdev_driver.h>
#include <rte_common.h>
-@@ -142,20 +144,23 @@ static const unsigned int xstats_n = RTE_DIM(mlx5_counters_init);
+@@ -139,20 +141,23 @@ static const unsigned int xstats_n = RTE_DIM(mlx5_counters_init);
static inline int
mlx5_read_ib_stat(struct mlx5_priv *priv, const char *ctr_name, uint64_t *stat)
{
More information about the stable
mailing list