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 06E9141D4F for ; Thu, 23 Feb 2023 10:38:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F1AAD43152; Thu, 23 Feb 2023 10:38:30 +0100 (CET) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mails.dpdk.org (Postfix) with ESMTP id 455D643152 for ; Thu, 23 Feb 2023 10:38:29 +0100 (CET) Received: by mail-wm1-f42.google.com with SMTP id p3-20020a05600c358300b003e206711347so7649113wmq.0 for ; Thu, 23 Feb 2023 01:38:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+5KiQrx8BiiMp7FBx5XmumR+EzteVxa4/hJCdtRE6qQ=; b=ICfhnefQupe/8LDxye5ZxX2iXlCWuOz+sYOWVcltxy7hD4zjxdY2cn1bW0Np5tLtpy rqgcl089RDZvBPqC6pe1iqU3y1AzXrVawtHgatCSLb7xkRiJmEeOdUU+bKu7URZhf191 9DFuAJlyTe4PpYPX58iIGdDoqZjVwxvolb0YsMwRAoiiMLAMvUPLRaS5ybjT3hBwxkdo APULUi65Ryam28LRP3Iye2EK3yKnA2ncfGJM6OjnFTlKlNhOGq4vZCRP1ledT+Pwu0uW bfDG+Bs3DJSLayKASgccHZCE/y49HmhdYr61QATFEYTTBKAS1BGCCKIBKL8T1KenRwZU EG5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+5KiQrx8BiiMp7FBx5XmumR+EzteVxa4/hJCdtRE6qQ=; b=vyucyfbbA581yLDvggE46lORt1WAbat/FSOQaqjGSahz517TFwLIr3/pV9H3WyECmD k7d+A8eAUjo87ukhHpLDcywNz0GO6R6+HGVEFvA05MXWL5iKplfTCbjKpxtnsFU5payZ RVxvxztYRqZtwHagOM7zu3CzNklQzcQqn87zfT29hou1a71Q59gF91NjlC/BxH+QpjFL TFxJBikPwmmyDzcMT84t6hj9XagUyBM12mdEaA752cVbYzW3uLmfXBz6mrnYBFcjWTF9 HyQkgL+7a/+eQkMheOx81U06U4PS9b1olp3c76Kyn9r6/E2gk8Eh0gJM6stsiMPX/tKf ciOQ== X-Gm-Message-State: AO0yUKXSiLvbbW3HqR8VWaL4jerJJFXgjXrvZxQLg3ktsV+j+86YiQxP Olls+PSJ0SmbWsnRY8GVLU1zJ4WBmxw= X-Google-Smtp-Source: AK7set+H3tlM45rwx0Je3Unpb+cSc8TkUHGJa+PDR9gYdpDqn+HXeA29cVSuxqXu9TeRB5QrN4NZVA== X-Received: by 2002:a1c:4b13:0:b0:3de:d52:2cd2 with SMTP id y19-20020a1c4b13000000b003de0d522cd2mr2269981wma.4.1677145108917; Thu, 23 Feb 2023 01:38:28 -0800 (PST) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id k22-20020a05600c1c9600b003e89e3284fasm6333229wms.36.2023.02.23.01.38.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 01:38:28 -0800 (PST) From: luca.boccassi@gmail.com To: Kalesh AP Cc: Ajit Khaparde , dpdk stable Subject: patch 'net/bnxt: fix Tx queue stats after queue stop and start' has been queued to stable release 20.11.8 Date: Thu, 23 Feb 2023 09:36:27 +0000 Message-Id: <20230223093715.3926893-23-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230223093715.3926893-1-luca.boccassi@gmail.com> References: <20230223093715.3926893-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 20.11.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/25/23. 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/82a289a1db6ab917c2342f9c12523c68b7a6b9d5 Thanks. Luca Boccassi --- >From 82a289a1db6ab917c2342f9c12523c68b7a6b9d5 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Wed, 1 Feb 2023 09:50:12 +0530 Subject: [PATCH] net/bnxt: fix Tx queue stats after queue stop and start [ upstream commit 9bd8998fe09736a048e367e1ef7543dd8b5dfd2c ] The Tx queue stats are being reported incorrectly due to a workaround for ring counters sometimes being reported as zero. When a queue is stopped and started, the ring counter is reset to zero. The workaround interprets the zero as incorrect, and sets the reported ring count as the previously read value (from before the queue being restared). This shows up as negative counters in testpmd's "show fwd stats" command. The fix clears the prev counter for the queue when the queue is started. Fixes: 219842b9990c ("net/bnxt: workaround spurious zero stats in Thor") Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_txr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c index 78d7329f2b..4310a14eed 100644 --- a/drivers/net/bnxt/bnxt_txr.c +++ b/drivers/net/bnxt/bnxt_txr.c @@ -535,6 +535,12 @@ int bnxt_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id) if (rc) return rc; + /* reset the previous stats for the tx_queue since the counters + * will be cleared when the queue is started. + */ + memset(&bp->prev_tx_ring_stats[tx_queue_id], 0, + sizeof(struct bnxt_ring_stats)); + dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED; txq->tx_started = true; PMD_DRV_LOG(DEBUG, "Tx queue started\n"); -- 2.39.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-23 09:36:29.201946377 +0000 +++ 0023-net-bnxt-fix-Tx-queue-stats-after-queue-stop-and-sta.patch 2023-02-23 09:36:28.218169792 +0000 @@ -1 +1 @@ -From 9bd8998fe09736a048e367e1ef7543dd8b5dfd2c Mon Sep 17 00:00:00 2001 +From 82a289a1db6ab917c2342f9c12523c68b7a6b9d5 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 9bd8998fe09736a048e367e1ef7543dd8b5dfd2c ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index 67e016775c..21c2217092 100644 +index 78d7329f2b..4310a14eed 100644 @@ -27 +28 @@ -@@ -560,6 +560,12 @@ int bnxt_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id) +@@ -535,6 +535,12 @@ int bnxt_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id) @@ -37,3 +38,3 @@ - bnxt_free_hwrm_tx_ring(bp, tx_queue_id); - rc = bnxt_alloc_hwrm_tx_ring(bp, tx_queue_id); - if (rc) + dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED; + txq->tx_started = true; + PMD_DRV_LOG(DEBUG, "Tx queue started\n");