patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: fix packets segments allocation
@ 2022-06-02 12:59 Raja Zidane
  2022-06-08 11:38 ` Andrew Rybchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Raja Zidane @ 2022-06-02 12:59 UTC (permalink / raw)
  To: dev; +Cc: matan, stable

When --mbuf-size cmdln 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")
Cc: stable@dpdk.org

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

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 99f2a31bb8..f5e5987487 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2671,7 +2671,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.21.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] app/testpmd: fix packets segments allocation
  2022-06-02 12:59 [PATCH] app/testpmd: fix packets segments allocation Raja Zidane
@ 2022-06-08 11:38 ` Andrew Rybchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Rybchenko @ 2022-06-08 11:38 UTC (permalink / raw)
  To: Raja Zidane, dev; +Cc: matan, stable

On 6/2/22 15:59, Raja Zidane wrote:
> When --mbuf-size cmdln 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Raja Zidane <rzidane@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Applied to dpdk-next-net/main, thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-08 11:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 12:59 [PATCH] app/testpmd: fix packets segments allocation Raja Zidane
2022-06-08 11:38 ` Andrew Rybchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).