[dpdk-stable] patch 'app/testpmd: fix packet burst spreading stats' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:31:08 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/12/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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/034da63e88bba2e1e765cb7ba2107a53213ca27c

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 034da63e88bba2e1e765cb7ba2107a53213ca27c Mon Sep 17 00:00:00 2001
From: Eli Britstein <elibr at nvidia.com>
Date: Thu, 21 Oct 2021 16:20:02 +0300
Subject: [PATCH] app/testpmd: fix packet burst spreading stats
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 6a8b64fd5e9e8f5572ea4d9de40a1cff23498246 ]

RX/TX functions (rte_eth_rx_burst/rte_eth_tx_burst) get 'nb_pkts'
argument, which specifies the maximum number to receive/transmit.
It can be 0..nb_pkts, meaning nb_pkts+1 options.
Testpmd can provide statistics of the burst sizes ('set
record-burst-stats on') by incrementing an array cell of index
<burst-size>. This array is mistakenly [MAX_PKT_BURST] size. Receiving
the maximum burst will cause out of bound write.
Enlarge the spread stats array by one cell to fix it.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Eli Britstein <elibr at nvidia.com>
Reviewed-by: Matan Azrad <matan at nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 app/test-pmd/testpmd.c | 2 +-
 app/test-pmd/testpmd.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 466df37a2a..35a48e39cc 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1709,7 +1709,7 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs)
 	pktnb_stats[0] = 0;
 
 	/* Find the next 2 burst sizes with highest occurrences. */
-	for (nb_pkt = 1; nb_pkt < MAX_PKT_BURST; nb_pkt++) {
+	for (nb_pkt = 1; nb_pkt < MAX_PKT_BURST + 1; nb_pkt++) {
 		nb_burst = pbs->pkt_burst_spread[nb_pkt];
 
 		if (nb_burst == 0)
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index b54958165a..43e49a8069 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -92,7 +92,7 @@ enum {
  * that are recorded for each forwarding stream.
  */
 struct pkt_burst_stats {
-	unsigned int pkt_burst_spread[MAX_PKT_BURST];
+	unsigned int pkt_burst_spread[MAX_PKT_BURST + 1];
 };
 
 /** Information for a given RSS type. */
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:10.089725948 +0800
+++ 0184-app-testpmd-fix-packet-burst-spreading-stats.patch	2021-11-10 14:17:01.994078415 +0800
@@ -1 +1 @@
-From 6a8b64fd5e9e8f5572ea4d9de40a1cff23498246 Mon Sep 17 00:00:00 2001
+From 034da63e88bba2e1e765cb7ba2107a53213ca27c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 6a8b64fd5e9e8f5572ea4d9de40a1cff23498246 ]
@@ -16 +18,0 @@
-Cc: stable at dpdk.org
@@ -27 +29 @@
-index 6d5bbc8240..2b835a27bc 100644
+index 466df37a2a..35a48e39cc 100644
@@ -30 +32 @@
-@@ -1879,7 +1879,7 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs)
+@@ -1709,7 +1709,7 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs)
@@ -40 +42 @@
-index bf3669134a..071e4e7d63 100644
+index b54958165a..43e49a8069 100644
@@ -43 +45 @@
-@@ -96,7 +96,7 @@ enum {
+@@ -92,7 +92,7 @@ enum {


More information about the stable mailing list