[dpdk-stable] patch 'test: fix buffer overflow in Tx burst' has been queued to stable release 19.11.7

Christian Ehrhardt christian.ehrhardt at canonical.com
Thu Feb 4 12:28:22 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.7

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/06/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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/71aed37555a9b85e7f5f9a86b8c1746b61fcd9e0

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 71aed37555a9b85e7f5f9a86b8c1746b61fcd9e0 Mon Sep 17 00:00:00 2001
From: Alvin Zhang <alvinx.zhang at intel.com>
Date: Wed, 25 Nov 2020 17:46:22 +0800
Subject: [PATCH] test: fix buffer overflow in Tx burst

[ upstream commit 58325f094a059e8ef4e1085d322a46107aad468f ]

The Tx buffer may overflow when there is more than one port.

Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx")

Signed-off-by: Alvin Zhang <alvinx.zhang at intel.com>
Acked-by: Jeff Guo <jia.guo at intel.com>
Tested-by: Wei Ling <weix.ling at intel.com>
---
 app/test/test_pmd_perf.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c
index 352cd47156..de7e726429 100644
--- a/app/test/test_pmd_perf.c
+++ b/app/test/test_pmd_perf.c
@@ -609,10 +609,10 @@ timeout:
 static int
 exec_burst(uint32_t flags, int lcore)
 {
-	unsigned i, portid, nb_tx = 0;
+	unsigned int portid, nb_tx = 0;
 	struct lcore_conf *conf;
 	uint32_t pkt_per_port;
-	int num, idx = 0;
+	int num, i, idx = 0;
 	int diff_tsc;
 
 	conf = &lcore_conf[lcore];
@@ -631,16 +631,14 @@ exec_burst(uint32_t flags, int lcore)
 		rte_atomic64_set(&start, 1);
 
 	/* start xmit */
+	i = 0;
 	while (num) {
 		nb_tx = RTE_MIN(MAX_PKT_BURST, num);
-		for (i = 0; i < conf->nb_ports; i++) {
-			portid = conf->portlist[i];
-			nb_tx = rte_eth_tx_burst(portid, 0,
-					 &tx_burst[idx], nb_tx);
-			idx += nb_tx;
-			num -= nb_tx;
-		}
-
+		portid = conf->portlist[i];
+		nb_tx = rte_eth_tx_burst(portid, 0, &tx_burst[idx], nb_tx);
+		idx += nb_tx;
+		num -= nb_tx;
+		i = (i >= conf->nb_ports - 1) ? 0 : (i + 1);
 	}
 
 	sleep(5);
-- 
2.30.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-02-04 12:04:30.053757329 +0100
+++ 0047-test-fix-buffer-overflow-in-Tx-burst.patch	2021-02-04 12:04:27.958789659 +0100
@@ -1 +1 @@
-From 58325f094a059e8ef4e1085d322a46107aad468f Mon Sep 17 00:00:00 2001
+From 71aed37555a9b85e7f5f9a86b8c1746b61fcd9e0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 58325f094a059e8ef4e1085d322a46107aad468f ]
+
@@ -9 +10,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index 4db816a360..3a248d512c 100644
+index 352cd47156..de7e726429 100644
@@ -22 +23 @@
-@@ -606,10 +606,10 @@ timeout:
+@@ -609,10 +609,10 @@ timeout:
@@ -35 +36 @@
-@@ -628,16 +628,14 @@ exec_burst(uint32_t flags, int lcore)
+@@ -631,16 +631,14 @@ exec_burst(uint32_t flags, int lcore)


More information about the stable mailing list