From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 24E90A04C1; Thu, 21 Nov 2019 20:34:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 472622BA2; Thu, 21 Nov 2019 20:34:14 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 92A83237 for ; Thu, 21 Nov 2019 20:34:12 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xALJQao5002168; Thu, 21 Nov 2019 11:34:11 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=V2oXfUmepZmfRLnIl+LT0zD+bInI0UZd6UPPbxyF8DM=; b=xLH3GN2130eA7Y6FGCZM1vhKtOWy0d41hWcPxA3AIg0hxvWLNFcFaE4Li5Mor+9sYICU XSLzvRzUyCI9OPd50s7Ozv177p4nFWyVXYuPsyIuKEgDdpjnQPwCIsxm4IQsEm1/Q/xs vRoPLtv6xeiEnSt2sZrvl9r2AiZGJk9wzKz+fdu8H5oV+6v0EUxhozzBOYrjafD3pZof V7zqLQdKl28papW/yZlBoVEdVCoAiJJfCQAyPnShCz7nLZzkvuom1eAYzjGsOXYOTiD4 I/RUK3CcuyNbWlXgh2OnpGDWQ42Fy4xZljuibiagWM5OZ843gXpQzc6taHIE88LYZwsC UA== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2wc842fdam-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 21 Nov 2019 11:34:11 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 21 Nov 2019 11:34:10 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 21 Nov 2019 11:34:10 -0800 Received: from BG-LT7430.marvell.com (unknown [10.28.17.72]) by maili.marvell.com (Postfix) with ESMTP id 8F7B23F7040; Thu, 21 Nov 2019 11:34:08 -0800 (PST) From: To: , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger CC: , Pavan Nikhilesh Date: Fri, 22 Nov 2019 01:04:06 +0530 Message-ID: <20191121193407.13843-1-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-21_05:2019-11-21,2019-11-21 signatures=0 Subject: [dpdk-dev] [PATCH] app/testpmd: use rte_rand() instead of random() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Use rte_rand() instead of random() for better randomness. Coverity Issue: 337666 Signed-off-by: Pavan Nikhilesh --- 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