app/testpmd: use better randomness for Tx split
Use rte_rand() instead of random() for better randomness.
Coverity issue: 337666
Fixes: 79bec05b32
("app/testpmd: add ability to split outgoing packets")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
This commit is contained in:
parent
4c5b169990
commit
7392ad06f5
@ -159,7 +159,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp,
|
||||
uint8_t i;
|
||||
|
||||
if (unlikely(tx_pkt_split == TX_PKT_SPLIT_RND))
|
||||
nb_segs = random() % tx_pkt_nb_segs + 1;
|
||||
nb_segs = rte_rand() % tx_pkt_nb_segs + 1;
|
||||
else
|
||||
nb_segs = tx_pkt_nb_segs;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user