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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 5 12:16:49 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.1

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/07/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/3f39b9182dd705b7e5aec944411cfee3987f79c4

Thanks.

Luca Boccassi

---
>From 3f39b9182dd705b7e5aec944411cfee3987f79c4 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 4db816a360..3a248d512c 100644
--- a/app/test/test_pmd_perf.c
+++ b/app/test/test_pmd_perf.c
@@ -606,10 +606,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];
@@ -628,16 +628,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.29.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-02-05 11:18:34.710114484 +0000
+++ 0123-test-fix-buffer-overflow-in-Tx-burst.patch	2021-02-05 11:18:28.994694692 +0000
@@ -1 +1 @@
-From 58325f094a059e8ef4e1085d322a46107aad468f Mon Sep 17 00:00:00 2001
+From 3f39b9182dd705b7e5aec944411cfee3987f79c4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 58325f094a059e8ef4e1085d322a46107aad468f ]
+
@@ -9 +10,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list