From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C5DBEA2E1B for ; Thu, 5 Sep 2019 12:18:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BD9681EF75; Thu, 5 Sep 2019 12:18:26 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 930861EF8E for ; Thu, 5 Sep 2019 12:18:25 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 083208980E5; Thu, 5 Sep 2019 10:18:25 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-52.ams2.redhat.com [10.36.117.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF2B63DA4; Thu, 5 Sep 2019 10:18:23 +0000 (UTC) From: Kevin Traynor To: Santoshkumar Karanappa Rastapur Cc: Rahul Gupta , Somnath Kotur , dpdk stable Date: Thu, 5 Sep 2019 11:17:10 +0100 Message-Id: <20190905101754.21933-10-ktraynor@redhat.com> In-Reply-To: <20190905101754.21933-1-ktraynor@redhat.com> References: <20190905101754.21933-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Thu, 05 Sep 2019 10:18:25 +0000 (UTC) Subject: [dpdk-stable] patch 'net/bnxt: fix extended port counter statistics' has been queued to LTS release 18.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 LTS release 18.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 09/12/19. 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/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/1c90b45f091380e985231d80b1d5a1de8bb364c3 Thanks. Kevin Traynor --- >From 1c90b45f091380e985231d80b1d5a1de8bb364c3 Mon Sep 17 00:00:00 2001 From: Santoshkumar Karanappa Rastapur Date: Thu, 25 Jul 2019 10:29:46 +0530 Subject: [PATCH] net/bnxt: fix extended port counter statistics [ upstream commit b02a39ba3ba043827fb91c175900aed0eddf0d2d ] We were trying to fill in more rx extended stats than the size allocated for stats causing segfault. Fixed this by adding an explicit check. Rearranged the code to return statistic values in xstats_get as per the names returned in xstats_get_names. Fixes: f55e12f33416 ("net/bnxt: support extended port counters") Signed-off-by: Rahul Gupta Signed-off-by: Santoshkumar Karanappa Rastapur Signed-off-by: Somnath Kotur --- drivers/net/bnxt/bnxt_stats.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c index aa1ab805d..e0f70781a 100644 --- a/drivers/net/bnxt/bnxt_stats.c +++ b/drivers/net/bnxt/bnxt_stats.c @@ -427,6 +427,10 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev, bnxt_hwrm_func_qstats_tx_drop(bp, 0xffff, &tx_drop_pkts); bnxt_hwrm_ext_port_qstats(bp); - rx_port_stats_ext_cnt = bp->fw_rx_port_stats_ext_size / stat_size; - tx_port_stats_ext_cnt = bp->fw_tx_port_stats_ext_size / stat_size; + rx_port_stats_ext_cnt = RTE_MIN(RTE_DIM(bnxt_rx_ext_stats_strings), + (bp->fw_rx_port_stats_ext_size / + stat_size)); + tx_port_stats_ext_cnt = RTE_MIN(RTE_DIM(bnxt_tx_ext_stats_strings), + (bp->fw_tx_port_stats_ext_size / + stat_size)); count = RTE_DIM(bnxt_rx_stats_strings) + @@ -463,14 +467,4 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev, count++; - for (i = 0; i < tx_port_stats_ext_cnt; i++) { - uint64_t *tx_stats_ext = (uint64_t *)bp->hw_tx_port_stats_ext; - - xstats[count].value = rte_le_to_cpu_64 - (*(uint64_t *)((char *)tx_stats_ext + - bnxt_tx_ext_stats_strings[i].offset)); - - count++; - } - for (i = 0; i < rx_port_stats_ext_cnt; i++) { uint64_t *rx_stats_ext = (uint64_t *)bp->hw_rx_port_stats_ext; @@ -483,4 +477,14 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev, } + for (i = 0; i < tx_port_stats_ext_cnt; i++) { + uint64_t *tx_stats_ext = (uint64_t *)bp->hw_tx_port_stats_ext; + + xstats[count].value = rte_le_to_cpu_64 + (*(uint64_t *)((char *)tx_stats_ext + + bnxt_tx_ext_stats_strings[i].offset)); + + count++; + } + return stat_count; } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-09-05 10:36:48.121254501 +0100 +++ 0010-net-bnxt-fix-extended-port-counter-statistics.patch 2019-09-05 10:36:47.474701384 +0100 @@ -1 +1 @@ -From b02a39ba3ba043827fb91c175900aed0eddf0d2d Mon Sep 17 00:00:00 2001 +From 1c90b45f091380e985231d80b1d5a1de8bb364c3 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b02a39ba3ba043827fb91c175900aed0eddf0d2d ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index 4e74f8a27..69ac2dd91 100644 +index aa1ab805d..e0f70781a 100644 @@ -25 +26 @@ -@@ -428,6 +428,10 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev, +@@ -427,6 +427,10 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev, @@ -38 +39 @@ -@@ -464,14 +468,4 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev, +@@ -463,14 +467,4 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev, @@ -53 +54 @@ -@@ -484,4 +478,14 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev, +@@ -483,4 +477,14 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,