[dpdk-stable] patch 'net/mlx5: fix locking in xstats functions' has been queued to stable release 17.08.1

Yuanhan Liu yliu at fridaylinux.org
Tue Nov 21 14:15:57 CET 2017


Hi,

FYI, your patch has been queued to stable release 17.08.1

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/24/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From ff974a02615e64f641edb872122054cc140f19c3 Mon Sep 17 00:00:00 2001
From: Matan Azrad <matan at mellanox.com>
Date: Mon, 14 Aug 2017 14:32:24 +0300
Subject: [PATCH] net/mlx5: fix locking in xstats functions

[ upstream commit b5743da31eba03cdc7abae3295f8ba852919c4a3 ]

The corrupted code didn't unlock the spinlock in xstats
get and reset functions error flow.

Hence, if these errors happened, the device spinlock was
left locked and many mlx5 device functionalities were blocked.

The fix unlocks the spinlock in the missed places.

Fixes: e62bc9e70608 ("net/mlx5: fix extended statistics")

Signed-off-by: Matan Azrad <matan at mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
---
 drivers/net/mlx5/mlx5_stats.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index 703f48c..33997af 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -442,8 +442,10 @@ mlx5_xstats_get(struct rte_eth_dev *dev,
 
 		priv_lock(priv);
 		stats_n = priv_ethtool_get_stats_n(priv);
-		if (stats_n < 0)
+		if (stats_n < 0) {
+			priv_unlock(priv);
 			return -1;
+		}
 		if (xstats_ctrl->stats_n != stats_n)
 			priv_xstats_init(priv);
 		ret = priv_xstats_get(priv, stats);
@@ -468,10 +470,11 @@ mlx5_xstats_reset(struct rte_eth_dev *dev)
 	priv_lock(priv);
 	stats_n = priv_ethtool_get_stats_n(priv);
 	if (stats_n < 0)
-		return;
+		goto unlock;
 	if (xstats_ctrl->stats_n != stats_n)
 		priv_xstats_init(priv);
 	priv_xstats_reset(priv);
+unlock:
 	priv_unlock(priv);
 }
 
-- 
2.7.4



More information about the stable mailing list