app/testpmd: fix packet burst spreading stats
authorEli Britstein <elibr@nvidia.com>
Thu, 21 Oct 2021 13:20:02 +0000 (16:20 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 22 Oct 2021 02:23:15 +0000 (04:23 +0200)
commit6a8b64fd5e9e8f5572ea4d9de40a1cff23498246
tree65824cc2c15671175448c13c185e280c00ff5581
parent2fc3e696a7f1925b20664b9de15f2430b9b68208
app/testpmd: fix packet burst spreading stats

RX/TX functions (rte_eth_rx_burst/rte_eth_tx_burst) get 'nb_pkts'
argument, which specifies the maximum number to receive/transmit.
It can be 0..nb_pkts, meaning nb_pkts+1 options.
Testpmd can provide statistics of the burst sizes ('set
record-burst-stats on') by incrementing an array cell of index
<burst-size>. This array is mistakenly [MAX_PKT_BURST] size. Receiving
the maximum burst will cause out of bound write.
Enlarge the spread stats array by one cell to fix it.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Eli Britstein <elibr@nvidia.com>
Reviewed-by: Matan Azrad <matan@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test-pmd/testpmd.c
app/test-pmd/testpmd.h