app/testpmd: fix packet segment allocation
authorRaja Zidane <rzidane@nvidia.com>
Thu, 2 Jun 2022 12:59:47 +0000 (15:59 +0300)
committerAndrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Wed, 8 Jun 2022 11:27:47 +0000 (13:27 +0200)
commit1108c33e743f8be81e765165c8b3cf27d57a7220
treeeab0624ebeae2b9366a9452c7bef41b70b65e404
parente5e613f05b8ccf2a17a577cf5fa77e651e20dc2b
app/testpmd: fix packet segment allocation

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")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
app/test-pmd/testpmd.c