From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 84BDEA0524 for ; Thu, 4 Feb 2021 12:35:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7E0C624071C; Thu, 4 Feb 2021 12:35:27 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 4DD9C24074D for ; Thu, 4 Feb 2021 12:35:26 +0100 (CET) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l7cv0-0005Oj-4S; Thu, 04 Feb 2021 11:35:26 +0000 From: Christian Ehrhardt To: Alvin Zhang Cc: Jeff Guo , Wei Ling , dpdk stable Date: Thu, 4 Feb 2021 12:28:22 +0100 Message-Id: <20210204112954.2488123-47-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210204112954.2488123-1-christian.ehrhardt@canonical.com> References: <20210204112954.2488123-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'test: fix buffer overflow in Tx burst' has been queued to stable release 19.11.7 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 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 --- >From 71aed37555a9b85e7f5f9a86b8c1746b61fcd9e0 Mon Sep 17 00:00:00 2001 From: Alvin Zhang 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 Acked-by: Jeff Guo Tested-by: Wei Ling --- 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@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)