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 47D6AA0613 for ; Wed, 28 Aug 2019 15:43:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3B0FF1C226; Wed, 28 Aug 2019 15:43:51 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 9C6BD1C226 for ; Wed, 28 Aug 2019 15:43:49 +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 173917FDCC; Wed, 28 Aug 2019 13:43:49 +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 C7FA8194BE; Wed, 28 Aug 2019 13:43:47 +0000 (UTC) From: Kevin Traynor To: Lance Richardson Cc: Kalesh AP , Ajit Khaparde , dpdk stable Date: Wed, 28 Aug 2019 14:42:22 +0100 Message-Id: <20190828134234.20547-46-ktraynor@redhat.com> In-Reply-To: <20190828134234.20547-1-ktraynor@redhat.com> References: <20190828134234.20547-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.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 28 Aug 2019 13:43:49 +0000 (UTC) Subject: [dpdk-stable] patch 'net/bnxt: fix getting 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/04/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/7ce0d3877090030eaeb6ed339ca73d6b9d9450ee Thanks. Kevin Traynor --- >From 7ce0d3877090030eaeb6ed339ca73d6b9d9450ee Mon Sep 17 00:00:00 2001 From: Lance Richardson Date: Thu, 18 Jul 2019 09:06:13 +0530 Subject: [PATCH] net/bnxt: fix getting statistics [ upstream commit 75306ee088915446c50e5525fc657fad28ee6935 ] Avoid overrun in rte_eth_stats struct when the number of tx/rx rings in use is greater than RTE_ETHDEV_QUEUE_STAT_CNTRS. Fixes: 57d5e5bc86e4 ("net/bnxt: add statistics") Signed-off-by: Lance Richardson Reviewed-by: Kalesh AP Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_stats.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c index 73e909691..aa1ab805d 100644 --- a/drivers/net/bnxt/bnxt_stats.c +++ b/drivers/net/bnxt/bnxt_stats.c @@ -351,4 +351,5 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, unsigned int i; struct bnxt *bp = eth_dev->data->dev_private; + unsigned int num_q_stats; memset(bnxt_stats, 0, sizeof(*bnxt_stats)); @@ -358,5 +359,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, } - for (i = 0; i < bp->rx_cp_nr_rings; i++) { + num_q_stats = RTE_MIN(bp->rx_cp_nr_rings, + (unsigned int)RTE_ETHDEV_QUEUE_STAT_CNTRS); + + for (i = 0; i < num_q_stats; i++) { struct bnxt_rx_queue *rxq = bp->rx_queues[i]; struct bnxt_cp_ring_info *cpr = rxq->cp_ring; @@ -370,5 +374,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, } - for (i = 0; i < bp->tx_cp_nr_rings; i++) { + num_q_stats = RTE_MIN(bp->tx_cp_nr_rings, + (unsigned int)RTE_ETHDEV_QUEUE_STAT_CNTRS); + + for (i = 0; i < num_q_stats; i++) { struct bnxt_tx_queue *txq = bp->tx_queues[i]; struct bnxt_cp_ring_info *cpr = txq->cp_ring; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-08-28 14:32:34.592561062 +0100 +++ 0047-net-bnxt-fix-getting-statistics.patch 2019-08-28 14:32:31.711955800 +0100 @@ -1 +1 @@ -From 75306ee088915446c50e5525fc657fad28ee6935 Mon Sep 17 00:00:00 2001 +From 7ce0d3877090030eaeb6ed339ca73d6b9d9450ee Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 75306ee088915446c50e5525fc657fad28ee6935 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index 3cd5144ec..4e74f8a27 100644 +index 73e909691..aa1ab805d 100644 @@ -23 +24 @@ -@@ -352,4 +352,5 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, +@@ -351,4 +351,5 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, @@ -29 +30 @@ -@@ -359,5 +360,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, +@@ -358,5 +359,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, @@ -39 +40 @@ -@@ -371,5 +375,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, +@@ -370,5 +374,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,