[dpdk-stable] patch 'net/sfc: fix MAC stats lock in xstats query by ID' has been queued to stable release 19.11.10

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Aug 10 17:40:05 CEST 2021


Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/e675fd546c07cbeb919e4f10c028add7c58706c4

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From e675fd546c07cbeb919e4f10c028add7c58706c4 Mon Sep 17 00:00:00 2001
From: Ivan Ilchenko <ivan.ilchenko at oktetlabs.ru>
Date: Fri, 23 Jul 2021 16:15:05 +0300
Subject: [PATCH] net/sfc: fix MAC stats lock in xstats query by ID

[ upstream commit 9076e855f171e6588d43c0c20956da154b8c4371 ]

Add MAC stats lock in xstats_get_by_id() callback before reading
number of supported MAC stats.

Fixes: 73280c1e4ff ("net/sfc: support xstats retrieval by ID")

Signed-off-by: Ivan Ilchenko <ivan.ilchenko at oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton at xilinx.com>
---
 drivers/net/sfc/sfc_ethdev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 07eebb06d5..703139f2c9 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -772,12 +772,14 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 	int ret;
 	int rc;
 
-	if (unlikely(values == NULL) ||
-	    unlikely((ids == NULL) && (n < port->mac_stats_nb_supported)))
-		return port->mac_stats_nb_supported;
-
 	rte_spinlock_lock(&port->mac_stats_lock);
 
+	if (unlikely(values == NULL) ||
+	    unlikely(ids == NULL && n < port->mac_stats_nb_supported)) {
+		ret = port->mac_stats_nb_supported;
+		goto unlock;
+	}
+
 	rc = sfc_port_update_mac_stats(sa);
 	if (rc != 0) {
 		SFC_ASSERT(rc > 0);
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:16.291956804 +0200
+++ 0085-net-sfc-fix-MAC-stats-lock-in-xstats-query-by-ID.patch	2021-08-10 15:11:13.098638677 +0200
@@ -1 +1 @@
-From 9076e855f171e6588d43c0c20956da154b8c4371 Mon Sep 17 00:00:00 2001
+From e675fd546c07cbeb919e4f10c028add7c58706c4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9076e855f171e6588d43c0c20956da154b8c4371 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 88896db1f8..d4ac61ff76 100644
+index 07eebb06d5..703139f2c9 100644
@@ -23 +24 @@
-@@ -789,12 +789,14 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
+@@ -772,12 +772,14 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,


More information about the stable mailing list