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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Jul 26 15:53:14 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.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 07/28/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/e5e8e0aa61a447eeeb7b385500ff23b91733093a

Thanks.

Luca Boccassi

---
>From e5e8e0aa61a447eeeb7b385500ff23b91733093a 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 cde9f2423b..529027630e 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -780,11 +780,13 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 	int ret;
 	int rc;
 
+	rte_spinlock_lock(&port->mac_stats_lock);
+
 	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);
+	    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) {
-- 
2.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-07-26 13:53:18.843886771 +0100
+++ 0051-net-sfc-fix-MAC-stats-lock-in-xstats-query-by-ID.patch	2021-07-26 13:53:15.953294809 +0100
@@ -1 +1 @@
-From 9076e855f171e6588d43c0c20956da154b8c4371 Mon Sep 17 00:00:00 2001
+From e5e8e0aa61a447eeeb7b385500ff23b91733093a 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 cde9f2423b..529027630e 100644
@@ -23 +24 @@
-@@ -789,11 +789,13 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
+@@ -780,11 +780,13 @@ sfc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,


More information about the stable mailing list