app/testpmd: fix packets segments allocation
PATCH 1/1 app/testpmd: fix packets segments allocation
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.
--- app/test-pmd/testpmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/testpmd.c +1 -1
@@ -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] ?
Signature · 1 line
2.21.0
Andrew Rybchenko
AppliedQuoted 9 lines · Raja Zidane
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.
Quoted 7 lines
Fix the comparison.
Fixes 2befc67ff679 ("app/testpmd: add extended Rx queue setup")Signed-off-by Raja Zidane <[email protected]>Acked-by Matan Azrad <[email protected]>
Applied to dpdk-next-net/main, thanks.