From 7392ad06f5263e33f1583365ef0532ab435fce38 Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Fri, 22 Nov 2019 01:04:06 +0530 Subject: [PATCH] app/testpmd: use better randomness for Tx split Use rte_rand() instead of random() for better randomness. Coverity issue: 337666 Fixes: 79bec05b32b7 ("app/testpmd: add ability to split outgoing packets") Cc: stable@dpdk.org Signed-off-by: Pavan Nikhilesh Reviewed-by: Ferruh Yigit --- app/test-pmd/txonly.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index 539043c347..3caf281cb8 100644 --- a/app/test-pmd/txonly.c +++ b/app/test-pmd/txonly.c @@ -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; -- 2.20.1