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 9ACC7A0C47 for ; Tue, 10 Aug 2021 17:44:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9268B4014F; Tue, 10 Aug 2021 17:44:01 +0200 (CEST) Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) by mails.dpdk.org (Postfix) with ESMTP id EFE27411C3 for ; Tue, 10 Aug 2021 17:43:59 +0200 (CEST) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (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-1.canonical.com (Postfix) with ESMTPS id D86343F338 for ; Tue, 10 Aug 2021 15:43:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628610239; bh=LNW9a5/YwxKgERdPPwGpYUqfi/wphrv627SfdiI8CQc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PdI2kc97d7UFMKtjDS+Ud2Wg9XMl/WPWWgOnBuR4kd1dR6iu3iGfSUOiWZNTb90aA zICnZ9wkHdGLc5xsijwwAAiWrWSJjuf3sCeT1xgIlo78T4gBBqN1YWpa2XqslSkxrF fYLpl/IKbMOEgla77RNTCyCP2wSXdKv/wRzfCfDkHyX3xzBDSvAPOa4MY/09l6sh7+ jGNF8R5y/DvD+SPkT9AR7WrmyWcjV8IctiqRakU0XbGxHoM5MdhHMfHLgdFFQoz5hf KSHR8BzQshyy3X8o7E27dz7gY6+ApM9j6ppEAO0H+wr/0UkhPiG83e4nJX7gNfCZiO dVpeGq1dWW/tw== Received: by mail-ed1-f69.google.com with SMTP id y22-20020a0564023596b02903bd9452ad5cso10910913edc.20 for ; Tue, 10 Aug 2021 08:43:59 -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=LNW9a5/YwxKgERdPPwGpYUqfi/wphrv627SfdiI8CQc=; b=HXX1lFHz3Ybe1b76foKQCXJz4qJx/F19/qgZNpeNtwtslSIDqpMOSfg+9SIzScTIqq Qov6ddSj088/E5LHyU0b5Jw6NivxG8Vg4TuBwIze8Mx6nEO9fKFqxrDaeLQ8wJdPzLkt b/CO4qiq2cA5onU9x7OSt52tuyc343+zFafUSg+Ggh05OBmHJwkUPJZ0co07177iZyxZ MbiJ5xna0/X9D4RucVy5gseImpkr9HLYrd9dohc3UkCyyRd+sn0iJpVaHggyNIfLSwn3 cAB1s9qA8Uq7ViTesjh9hU/v/RHxex50etZfKLPxdOGAJAgZXHZ3l3G+CfDiurR5ylBI Pe8g== X-Gm-Message-State: AOAM5335/9WEioP+xnHp/NXw4shqDPwgbf2bZVXUjY5Xy/jBA2PLt6fb lnZ7yaMXqppBtjZKJNbRyy6tI2A/z64/7FEhLSawzRMyRQpOXdS/2/xe/4fXN8DsqixQww/Dnrk p7rANJ5QHFgdWef5Pm8qBZbo8 X-Received: by 2002:a05:6402:1e91:: with SMTP id f17mr5527005edf.133.1628610239566; Tue, 10 Aug 2021 08:43:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGzWahTeDnuRp8CNL6gVfS09ZZfjI0iQxM7p8RK4LblujaO39pH0p3t54lTLsCEHYtLGozfQ== X-Received: by 2002:a05:6402:1e91:: with SMTP id f17mr5526985edf.133.1628610239392; Tue, 10 Aug 2021 08:43:59 -0700 (PDT) Received: from Keschdeichel.fritz.box ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id s18sm6979936ejc.52.2021.08.10.08.43.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 08:43:58 -0700 (PDT) From: christian.ehrhardt@canonical.com To: Kalesh AP Cc: Ajit Khaparde , Lance Richardson , Somnath Kotur , dpdk stable Date: Tue, 10 Aug 2021 17:39:50 +0200 Message-Id: <20210810154022.749358-70-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/bnxt: clear cached statistics' 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/a0776bdb0995d658f4c9793b70b56fe7f4118e5f Thanks. Christian Ehrhardt --- >From a0776bdb0995d658f4c9793b70b56fe7f4118e5f Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Tue, 13 Jul 2021 19:04:13 +0530 Subject: [PATCH] net/bnxt: clear cached statistics [ upstream commit 84fd852caac19795d0a05af8dabce8f011fe61a4 ] As part of the workaround put in the commit "219842b9990c", driver caches the last read stats values from the hardware. But this is not cleared during the clear stats operation. This results in showing up stale stats values while reading the stats after the clear operation. Fixes: 219842b9990c ("net/bnxt: workaround spurious zero stats in Thor") Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Lance Richardson Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_stats.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c index 692b0967eb..a30e2b465d 100644 --- a/drivers/net/bnxt/bnxt_stats.c +++ b/drivers/net/bnxt/bnxt_stats.c @@ -424,6 +424,16 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, return rc; } +static void bnxt_clear_prev_stat(struct bnxt *bp) +{ + /* + * Clear the cached values of stats returned by HW in the previous + * get operation. + */ + memset(bp->prev_rx_ring_stats, 0, sizeof(struct bnxt_ring_stats) * bp->rx_cp_nr_rings); + memset(bp->prev_tx_ring_stats, 0, sizeof(struct bnxt_ring_stats) * bp->tx_cp_nr_rings); +} + int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev) { struct bnxt *bp = eth_dev->data->dev_private; @@ -446,6 +456,8 @@ int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev) rte_atomic64_clear(&rxq->rx_mbuf_alloc_fail); } + bnxt_clear_prev_stat(bp); + return ret; } @@ -611,5 +623,7 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev) PMD_DRV_LOG(ERR, "Failed to reset xstats: %s\n", strerror(-ret)); + bnxt_clear_prev_stat(bp); + return ret; } -- 2.32.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-08-10 15:11:15.728060604 +0200 +++ 0070-net-bnxt-clear-cached-statistics.patch 2021-08-10 15:11:13.074638504 +0200 @@ -1 +1 @@ -From 84fd852caac19795d0a05af8dabce8f011fe61a4 Mon Sep 17 00:00:00 2001 +From a0776bdb0995d658f4c9793b70b56fe7f4118e5f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 84fd852caac19795d0a05af8dabce8f011fe61a4 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index c7b23f46a1..991eafc644 100644 +index 692b0967eb..a30e2b465d 100644 @@ -27 +28 @@ -@@ -603,6 +603,16 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, +@@ -424,6 +424,16 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, @@ -44 +45 @@ -@@ -625,6 +635,8 @@ int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev) +@@ -446,6 +456,8 @@ int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev) @@ -53 +54 @@ -@@ -933,6 +945,8 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev) +@@ -611,5 +623,7 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev) @@ -61 +61,0 @@ -