From: <pbhagavatula@marvell.com>
To: <jerinj@marvell.com>, Wenzhuo Lu <wenzhuo.lu@intel.com>,
Jingjing Wu <jingjing.wu@intel.com>,
Bernard Iremonger <bernard.iremonger@intel.com>
Cc: <dev@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>
Subject: [dpdk-dev] [PATCH] app/testpmd: use rte_rand() instead of random()
Date: Fri, 22 Nov 2019 01:04:06 +0530 [thread overview]
Message-ID: <20191121193407.13843-1-pbhagavatula@marvell.com> (raw)
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
next reply other threads:[~2019-11-21 19:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-21 19:34 pbhagavatula [this message]
2019-11-22 16:38 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191121193407.13843-1-pbhagavatula@marvell.com \
--to=pbhagavatula@marvell.com \
--cc=bernard.iremonger@intel.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=jingjing.wu@intel.com \
--cc=wenzhuo.lu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).