From: Pavan Nikhilesh Date: Thu, 21 Nov 2019 19:34:06 +0000 (+0530) Subject: app/testpmd: use better randomness for Tx split X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7392ad06f5263e33f1583365ef0532ab435fce38;p=dpdk.git 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 --- 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;