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 B69A9A0C47 for ; Tue, 10 Aug 2021 17:44:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B08644014F; Tue, 10 Aug 2021 17:44:46 +0200 (CEST) Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) by mails.dpdk.org (Postfix) with ESMTP id 60D3E411C3 for ; Tue, 10 Aug 2021 17:44:45 +0200 (CEST) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPS id 3CFAB3F0FD for ; Tue, 10 Aug 2021 15:44:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628610285; bh=9xbdp1pzYNvcETbOluj5qxOJSBkDkRQGfuxgPM1HHeE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HSskmRv6AUqY6143UHxyt9/2r05Mz2jw1O5ZGw1imQ6CNsgIwl03eWgwS5Yiustjz vKYzzUMy2FnGe5TpcSQdQMLMqBm7ReQMPpBFlbFdeTdUgHHqm1Ssf2E7dgVhn7mzNm fxWIA+EmuEfE1FTN5S/fmI4JhRcX+9df6WMzfHqiEH5nQjfMeKOZNWbwnBIYmjjJWr hswXVmQf/N1a0xSKPZ5ugQ1mbpbqmgRd0hRhtjb5gbFZ7XPhv5+E1U7CoCjVFHmD2i tfz2FV+laLkqN6XgZSsAV09/ue5rVBbcEIs6XsQJHR0DB5w93O2owrFl7iLRVxW9BV ZW964XkMRZTWw== Received: by mail-ed1-f72.google.com with SMTP id p2-20020a50c9420000b02903a12bbba1ebso10901642edh.6 for ; Tue, 10 Aug 2021 08:44:45 -0700 (PDT) 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=9xbdp1pzYNvcETbOluj5qxOJSBkDkRQGfuxgPM1HHeE=; b=GKcJqpDkT2Rk0YlDLZkBgopfAd37Nr2YYj1hslFj/wmUUNLuvMoZ3jXfFAI92oFUa0 gSBNU6/3zGWkAkUJK4OeJsY4qoK3v6jUSbEHkH1EbAuYXjB6BFeu+dgfj/BCX2YxqPvH k7B/b/nZWBgrtZ3mUqwPQ0PeUH8qdC0plfe2rj20kRoFVc3rxisCne07FlE6ewwtFiKI 7gFeq7N5KYw4AdBGNToTIrZWpyZOPdTA0i0qGBVCXdJbpciGklyeHhYDffDywz2HR118 v+nS5JYXn4gJJBU/xOK/MNH0FXN6cZm7E2oWxs4l+Sg4RXOKZWoTHXdYHrhZsNJ17ZMr 05rw== X-Gm-Message-State: AOAM530Mtri9ca5sslHxhmrR0RRNpLn2fjAKcwHg0rd0HfpXn6N85Fo4 uH+1zrutqNGM4+TE2xQFcE+F8U09hja1mX9772kDddbWR+Ly0YuqrDAovQTGcE+lGRQTM6geUxN quKwz5uJsm4/yuksoSB8LrNeK X-Received: by 2002:aa7:c805:: with SMTP id a5mr5632917edt.23.1628610284932; Tue, 10 Aug 2021 08:44:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmGId26qTSUCcceMeDL6Lz9RT81DveJkKPKm8mpyaxt3XZm3ZgcUxqgRACfQGZ3C96DNOroQ== X-Received: by 2002:aa7:c805:: with SMTP id a5mr5632905edt.23.1628610284758; Tue, 10 Aug 2021 08:44:44 -0700 (PDT) Received: from Keschdeichel.fritz.box ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id a2sm415889edm.72.2021.08.10.08.44.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 08:44:44 -0700 (PDT) From: christian.ehrhardt@canonical.com To: Ivan Ilchenko Cc: Andrew Rybchenko , Andy Moreton , dpdk stable Date: Tue, 10 Aug 2021 17:40:05 +0200 Message-Id: <20210810154022.749358-85-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810154022.749358-1-christian.ehrhardt@canonical.com> References: <20210810154022.749358-1-christian.ehrhardt@canonical.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 19.11.10 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 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 --- >From e675fd546c07cbeb919e4f10c028add7c58706c4 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 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@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,