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 B6B01A0C47 for ; Mon, 26 Jul 2021 15:54:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC4B3410E6; Mon, 26 Jul 2021 15:54:12 +0200 (CEST) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mails.dpdk.org (Postfix) with ESMTP id CC62F40DDA for ; Mon, 26 Jul 2021 15:54:10 +0200 (CEST) Received: by mail-wr1-f49.google.com with SMTP id l18so3525408wrv.5 for ; Mon, 26 Jul 2021 06:54:10 -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=u04PTr7ZyHBROwV9dqrvPPfr7sKiK16mkz9Kw3uqzY4=; b=LMtTKZdw3PpU2zJU1GYBB4f5UsrBl+jXBVBMU3Ww3aKziDyUJ06E8Te+m+Bt9XiZke B8gg64anKTNEFhchFtIQ1D9ZhBeXSc0E+dbGysatg7JPn+fFCjhPOB1SI7ouQwlVNiC6 V4n/bWx6Hc2JPBati+S7ldSCjSXbeTk3TvQjcwS1CpE+e2Mlozjp2WtQSju4LAj8oEgX Qib7F7pI1JWkkawHRm4QveLwItwRncVaEOxgQLcB8M9j2q2oU6m0oinZi/rc99qMPguQ s6MdIfccQ22xSAgwsVQ3KsPd/1bkaohQUzodrlQ40hvChG5rSGxzTU2GmAdO8zavluT+ bj0Q== 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=u04PTr7ZyHBROwV9dqrvPPfr7sKiK16mkz9Kw3uqzY4=; b=MycCs56OsGtWrdUwYEs0c0UT+Q0k7xt3lv8/BHPs+pZm6m7vNzUml9S+cRcaPoc3Ek oMePi3XPtoyeKjx+Uf0DzflrVzQaa8jHIaiJSgm7t4xfrBVw8n+tHqQcJ/LR+F9IT5Re /uFwjdpEH/AVLtyqbObH78CPkm/iNqjLX4icK/dyCdJ2ekdP2QHsHWo1BcuZ6Bja1Cdw odSxq92ACfHt7gZSA4goSRWraMoK/19pP3iovemEBvSQZrmGsLgaoHvMLGbvFX59VDT4 ZHhLgBiJBfGfXlqIFATANnMKoHr7YkPeWaO8DnYVrPcSuyFwDl+a/juWbpr8PAtgzEcu YLEA== X-Gm-Message-State: AOAM531lyVlWH41cWrjIGxPDtopl4ZVe3G8UaWBpqVzdpfDLkJOGGltM 7ghgMw1WjH+7Ef3DS4x4IQo= X-Google-Smtp-Source: ABdhPJyZ8xUOT7ORkes3JWeCDExaGj4gOO7U3c8LOEIhKAZxC2V3rJoePIMiPgFQ0FGpx55PMlx67A== X-Received: by 2002:a5d:4fc2:: with SMTP id h2mr2033019wrw.420.1627307650627; Mon, 26 Jul 2021 06:54:10 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id w185sm13468877wmb.11.2021.07.26.06.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 06:54:10 -0700 (PDT) From: luca.boccassi@gmail.com To: Kalesh AP Cc: Ajit Khaparde , Lance Richardson , Somnath Kotur , dpdk stable Date: Mon, 26 Jul 2021 14:52:38 +0100 Message-Id: <20210726135322.149850-15-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/bnxt: clear cached statistics' 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/fc9d2f0dbe64c6f282ab9a2562991f03e9ed13a9 Thanks. Luca Boccassi --- >From fc9d2f0dbe64c6f282ab9a2562991f03e9ed13a9 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 4e67fdf9f2..47dcf40893 100644 --- a/drivers/net/bnxt/bnxt_stats.c +++ b/drivers/net/bnxt/bnxt_stats.c @@ -597,6 +597,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; @@ -619,6 +629,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; } @@ -927,6 +939,8 @@ 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.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-26 13:53:16.684858122 +0100 +++ 0015-net-bnxt-clear-cached-statistics.patch 2021-07-26 13:53:15.829292202 +0100 @@ -1 +1 @@ -From 84fd852caac19795d0a05af8dabce8f011fe61a4 Mon Sep 17 00:00:00 2001 +From fc9d2f0dbe64c6f282ab9a2562991f03e9ed13a9 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 4e67fdf9f2..47dcf40893 100644 @@ -27 +28 @@ -@@ -603,6 +603,16 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, +@@ -597,6 +597,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) +@@ -619,6 +629,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) +@@ -927,6 +939,8 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)