DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: use rte_rand() instead of random()
@ 2019-11-21 19:34 pbhagavatula
  2019-11-22 16:38 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: pbhagavatula @ 2019-11-21 19:34 UTC (permalink / raw)
  To: jerinj, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Use rte_rand() instead of random() for better randomness.

Coverity Issue: 337666

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 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 539043c34..3caf281cb 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.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: use rte_rand() instead of random()
  2019-11-21 19:34 [dpdk-dev] [PATCH] app/testpmd: use rte_rand() instead of random() pbhagavatula
@ 2019-11-22 16:38 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2019-11-22 16:38 UTC (permalink / raw)
  To: pbhagavatula, jerinj, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger; +Cc: dev

On 11/21/2019 7:34 PM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Use rte_rand() instead of random() for better randomness.
> 
> Coverity Issue: 337666
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-22 16:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21 19:34 [dpdk-dev] [PATCH] app/testpmd: use rte_rand() instead of random() pbhagavatula
2019-11-22 16:38 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).