summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Nikhilesh <pbhagavatula@marvell.com>2019-11-22 01:04:06 +0530
committerFerruh Yigit <ferruh.yigit@intel.com>2019-11-25 16:41:03 +0000
commit5a4a123f1a497f91c5acdfaab82e47c29f8aab0f (patch)
tree6cb38dc83a01349bd48786f8d0dd3eecf4c17ce6
parent3f3b59c9ac03f5f4ca3829e4f5f20ca4f5f0c3c7 (diff)
downloaddpdk-next-net-intel-5a4a123f1a497f91c5acdfaab82e47c29f8aab0f.zip
dpdk-next-net-intel-5a4a123f1a497f91c5acdfaab82e47c29f8aab0f.tar.gz
dpdk-next-net-intel-5a4a123f1a497f91c5acdfaab82e47c29f8aab0f.tar.xz
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 <pbhagavatula@marvell.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
-rw-r--r--app/test-pmd/txonly.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c
index 539043c..3caf281 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;