patch 'app/testpmd: fix packet segment allocation' has been queued to stable release 20.11.6

Xueming Li xuemingl at nvidia.com
Tue Jun 21 10:02:54 CEST 2022


Hi,

FYI, your patch has been queued to stable release 20.11.6

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

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 9c1410c9b0a7741543cc6c22f3b94196d777318b Mon Sep 17 00:00:00 2001
From: Raja Zidane <rzidane at nvidia.com>
Date: Thu, 2 Jun 2022 15:59:47 +0300
Subject: [PATCH] app/testpmd: fix packet segment allocation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 1108c33e743f8be81e765165c8b3cf27d57a7220 ]

When --mbuf-size cmdline parameter is specified, the segments to scatter
packets on are allocated sequentially from these extra memory pools
(the mbuf for the first segment is allocated from the first pool, the
second one from the second pool, and so on, if segment number is greater
then pool’s the mbuf for remaining segments will be allocated from the
last valid pool).
A bug in comparing segment index with mbuf index caused wrong mapping
of one of the segments.

Fix the comparison.

Fixes: 2befc67ff679 ("app/testpmd: add extended Rx queue setup")

Signed-off-by: Raja Zidane <rzidane at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 app/test-pmd/testpmd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 0e553d19b9..6ecb032c81 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2406,8 +2406,10 @@ rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
 {
 	union rte_eth_rxseg rx_useg[MAX_SEGS_BUFFER_SPLIT] = {};
 	unsigned int i, mp_n;
-	int ret;
+	int ret = -1;
 
+	if (mbuf_data_size_n < 1)
+		goto exit;
 	if (rx_pkt_nb_segs <= 1 ||
 	    (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) == 0) {
 		rx_conf->rx_seg = NULL;
@@ -2424,7 +2426,7 @@ rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
 		 * Use last valid pool for the segments with number
 		 * exceeding the pool index.
 		 */
-		mp_n = (i > mbuf_data_size_n) ? mbuf_data_size_n - 1 : i;
+		mp_n = (i >= mbuf_data_size_n) ? mbuf_data_size_n - 1 : i;
 		mpx = mbuf_pool_find(socket_id, mp_n);
 		/* Handle zero as mbuf data buffer size. */
 		rx_seg->length = rx_pkt_seg_lengths[i] ?
-- 
2.35.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-21 15:37:54.023092616 +0800
+++ 0108-app-testpmd-fix-packet-segment-allocation.patch	2022-06-21 15:37:49.224451914 +0800
@@ -1 +1 @@
-From 1108c33e743f8be81e765165c8b3cf27d57a7220 Mon Sep 17 00:00:00 2001
+From 9c1410c9b0a7741543cc6c22f3b94196d777318b Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 1108c33e743f8be81e765165c8b3cf27d57a7220 ]
@@ -21 +23,0 @@
-Cc: stable at dpdk.org
@@ -26,2 +28,2 @@
- app/test-pmd/testpmd.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ app/test-pmd/testpmd.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
@@ -30 +32 @@
-index fc1b64b60d..4d51eb9576 100644
+index 0e553d19b9..6ecb032c81 100644
@@ -33 +35,13 @@
-@@ -2671,7 +2671,7 @@ rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
+@@ -2406,8 +2406,10 @@ rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
+ {
+ 	union rte_eth_rxseg rx_useg[MAX_SEGS_BUFFER_SPLIT] = {};
+ 	unsigned int i, mp_n;
+-	int ret;
++	int ret = -1;
+ 
++	if (mbuf_data_size_n < 1)
++		goto exit;
+ 	if (rx_pkt_nb_segs <= 1 ||
+ 	    (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) == 0) {
+ 		rx_conf->rx_seg = NULL;
+@@ -2424,7 +2426,7 @@ rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,


More information about the stable mailing list