From patchwork Wed Feb 1 04:20:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh A P X-Patchwork-Id: 122772 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C642641B96; Wed, 1 Feb 2023 05:23:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EAF92427E9; Wed, 1 Feb 2023 05:23:16 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.144.205]) by mails.dpdk.org (Postfix) with ESMTP id 734BC4021F for ; Wed, 1 Feb 2023 05:23:15 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 1C9C9C0000EC; Tue, 31 Jan 2023 20:23:13 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 1C9C9C0000EC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1675225395; bh=t0gaA2r6HBpfUIYCYw977BsRAqj2kRiMQH1s9ArKfo4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iY7n7pitd7iYFXOy5uVMRJkqq5mFrE7CadSUU5cxK0OVE6v89POYIulSe4S9UjuiG Pg83FXbb073YiZ7P8e9qVWXEsCN2V68EMNb6zrMrUJVGSBevvJJeU3PDBiQCiE61qV SgVLmvh/lTq446Wv9Z/y7+ofXHdGmpabNoialpd4= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@amd.com, ajit.khaparde@broadcom.com Subject: [dpdk-dev] [PATCH 1/3] net/bnxt: fix Tx queue stats after queue stop and start Date: Wed, 1 Feb 2023 09:50:12 +0530 Message-Id: <20230201042014.23526-2-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20230201042014.23526-1-kalesh-anakkur.purayil@broadcom.com> References: <20230201042014.23526-1-kalesh-anakkur.purayil@broadcom.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Kalesh AP 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") Cc: stable@dpdk.org 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 67e0167..21c2217 100644 --- a/drivers/net/bnxt/bnxt_txr.c +++ b/drivers/net/bnxt/bnxt_txr.c @@ -560,6 +560,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)); + bnxt_free_hwrm_tx_ring(bp, tx_queue_id); rc = bnxt_alloc_hwrm_tx_ring(bp, tx_queue_id); if (rc) From patchwork Wed Feb 1 04:20:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh A P X-Patchwork-Id: 122773 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3ED4341B96; Wed, 1 Feb 2023 05:23:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7106542D0E; Wed, 1 Feb 2023 05:23:18 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (saphodev.broadcom.com [192.19.144.205]) by mails.dpdk.org (Postfix) with ESMTP id F4214427EE for ; Wed, 1 Feb 2023 05:23:16 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 8C67CC0000F1; Tue, 31 Jan 2023 20:23:15 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 8C67CC0000F1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1675225396; bh=MsyCIxbedLmlvbJeedjVxeMJniqAGKlLPZOBbKFTVR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lzsjlyHs7zjT9KojbFu5bXfEyy+GNhFV8tz5vEdcUCUPk6sYAw898H5rphCXZ7mWK j30NdI1XRAoXH89TTQ6Sw5s1T66E+MAHt8+71LMbjemsKk5gyNqBOp2bhHQAdaVQTI hz33IhcWv3dGgh1ZsTkhN95raEWG3rD0EEUMla6U= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@amd.com, ajit.khaparde@broadcom.com Subject: [dpdk-dev] [PATCH 2/3] net/bnxt: fix Rx queue stats after queue stop and start Date: Wed, 1 Feb 2023 09:50:13 +0530 Message-Id: <20230201042014.23526-3-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20230201042014.23526-1-kalesh-anakkur.purayil@broadcom.com> References: <20230201042014.23526-1-kalesh-anakkur.purayil@broadcom.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Mike Baucom The Rx 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") Cc: stable@dpdk.org Signed-off-by: Mike Baucom Reviewed-by: Somnath Kotur Reviewed-by: Kishore Padmanabha Reviewed-by: Randy Schacher Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_rxq.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c index fabbbd4..99758dd 100644 --- a/drivers/net/bnxt/bnxt_rxq.c +++ b/drivers/net/bnxt/bnxt_rxq.c @@ -471,6 +471,12 @@ int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id) return -EINVAL; } + /* reset the previous stats for the rx_queue since the counters + * will be cleared when the queue is started. + */ + memset(&bp->prev_rx_ring_stats[rx_queue_id], 0, + sizeof(struct bnxt_ring_stats)); + /* Set the queue state to started here. * We check the status of the queue while posting buffer. * If queue is it started, we do not post buffers for Rx. From patchwork Wed Feb 1 04:20:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh A P X-Patchwork-Id: 122774 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EE03E41B96; Wed, 1 Feb 2023 05:23:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C11D42D29; Wed, 1 Feb 2023 05:23:19 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (saphodev.broadcom.com [192.19.144.205]) by mails.dpdk.org (Postfix) with ESMTP id 636D542D0C for ; Wed, 1 Feb 2023 05:23:18 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 07C76C0000E8; Tue, 31 Jan 2023 20:23:16 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 07C76C0000E8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1675225398; bh=ppXuhSU5iYBIV5puLNXvfFzAb38gdLEcWRx5HNr6r4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qNL6BeVUdZ2DFlkrvIa0JRNyqAch3k4YLr5h/ibyRp21IYDktlxRImfZiWYjVNAPE 9mOomaevvmmBCFKbnpBt15Q1hVUWLOJmmj5J4azEAFrXSYazJGcDyVMUVrMLIZD++P A4oLFgl7l/uIaYOysmZftSO4Xi7VAn7LRBQjX1vE= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@amd.com, ajit.khaparde@broadcom.com Subject: [dpdk-dev] [PATCH 3/3] net/bnxt: do not corrupt RSS hash value in the mbuf Date: Wed, 1 Feb 2023 09:50:14 +0530 Message-Id: <20230201042014.23526-4-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20230201042014.23526-1-kalesh-anakkur.purayil@broadcom.com> References: <20230201042014.23526-1-kalesh-anakkur.purayil@broadcom.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Venkat Duvvuru By clearing mbuf->hash.fdir.id in the data path, the driver is corrupting the RSS hash value populated in the mbuf as they are defined as a union. This patch fixes the problem by removing the code that clears mbuf->hash.fdir.id. Fixes: 17b6c8386d73 ("net/bnxt: fix mark handling") Cc: stable@dpdk.org Signed-off-by: Venkat Duvvuru Reviewed-by: Kalesh AP Reviewed-by: Kishore Padmanabha --- drivers/net/bnxt/bnxt_rxr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index daaf9ff..0eebddb 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -813,7 +813,6 @@ bnxt_ulp_set_mark_in_mbuf(struct bnxt *bp, struct rx_pkt_cmpl_hi *rxcmp1, skip_mark: mbuf->hash.fdir.hi = 0; - mbuf->hash.fdir.id = 0; return 0; }