From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 73067A0C47 for ; Mon, 26 Jul 2021 15:56:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C9D240F35; Mon, 26 Jul 2021 15:56:06 +0200 (CEST) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mails.dpdk.org (Postfix) with ESMTP id 5AC9A40DDA for ; Mon, 26 Jul 2021 15:56:05 +0200 (CEST) Received: by mail-wm1-f41.google.com with SMTP id o5-20020a1c4d050000b02901fc3a62af78so8240466wmh.3 for ; Mon, 26 Jul 2021 06:56:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JrKqdf83EQFkpJrkGetrfo80zXO3KFA4Y2++Y4v5AsI=; b=ev8kG9K6Ali+bL2MrPCunVYK+pg1bL6S6EfG8Jn2xUoXxu6Z25U645pw34ENVZoIwg 0AcOr329iR1w8RM2F5eEdd90M7aSuNLwqav8cPf1LkE+r93t2UnsA/DDcc3VtAwv/reB rwx4wFEE4PKd4LyfA2t8G3uugcSVUla/L0GyUnZOPGpxlMVk2sRaznvxuQSagzhwL3P2 QQBCd6BQ3cbYb7YdOTH8mueO5aMJSt3Vs2EbXc0y0dbr8Op/90rG5JPeYgD1TEHSDgVB HkyucJZuPFL1+SZpG0NBIqMSGNdiTyibOHIbhFS+1vmE68BPr7VPImOzeW9zjFgZJr6r M0yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JrKqdf83EQFkpJrkGetrfo80zXO3KFA4Y2++Y4v5AsI=; b=M920QJnW/3/4x32lRDlu9zvpbql9G7I6RBCBn/6QTGa4DRh1lprfQ1FiLmxbod5nYb P8vX+8jRb5Nh7IRYhR3aqfa1xvXrV7/LPbvoSGGTkA8DpvJ2HiolkkXsOGjr3+e8636h Nzy8gn3MXny09PIguUYWIQ2Zx1MC69Emj0cPPaj6/aoBiByVocx3BHLYJI6owiILWoV2 OSVzLXZXpUVmmJEoP9FOIa6RdHwqExJY1SWNO8LjfcjwrNCIHjyYJVU8jOe3CXVEIABf 2OOvGlOgsDsuGnmPgKGzFG6JguNGYYfxdsjfZooBmp9AlO9exe6NQ74dLszE56m4F+2y ikvw== X-Gm-Message-State: AOAM530Hr3T/koIR0p5OhBfvmD4IyiAFuSmHYasMkyWRPBwBieWihuKk BAUUrb1ajtGbLvQFqZeTdcM= X-Google-Smtp-Source: ABdhPJz31FNDjorBC+t3pvd3pOCSHpVEWF/NjWETJWmazjx99MLgpft4FKcbOcen8L91C6iEggTWRA== X-Received: by 2002:a1c:4e10:: with SMTP id g16mr24432170wmh.66.1627307765175; Mon, 26 Jul 2021 06:56:05 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id c2sm42284238wrs.60.2021.07.26.06.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 06:56:04 -0700 (PDT) From: luca.boccassi@gmail.com To: Ivan Ilchenko Cc: Andrew Rybchenko , Andy Moreton , dpdk stable Date: Mon, 26 Jul 2021 14:53:14 +0100 Message-Id: <20210726135322.149850-51-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210726135322.149850-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> <20210726135322.149850-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/sfc: fix MAC stats lock in xstats query by ID' has been queued to stable release 20.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 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 Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- 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@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,