From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 87BE543C27; Sat, 2 Mar 2024 02:07:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 76CA84025D; Sat, 2 Mar 2024 02:07:48 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by mails.dpdk.org (Postfix) with ESMTP id 787F243252 for ; Sat, 2 Mar 2024 02:07:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709341667; x=1740877667; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=vh+5qcSxYjqkrrr4Ws3Lil8rz05CmT67vN9f+JNcTSc=; b=kSR+Ktq9q51iGPFzLFt/ixMXj7i1dLEm8YpTuP0JDppXlJyOP+ErMm0f V0uSmeT6P5nBQg6zBp81ZzYANfgrtCMlAfxruqdL0lZNyzp93T3wssA5V hGY5SzEK4/3aEe+nDMsNMkt2RTwRtm3gD0PNw3WTxktitQAaEBUP/LYRv +ToWdoSvcXHXH9PR6xBoNZxIWTBysVSaP/5D6+e4SsPvx/NYtkrAfaJXX uD8JrIaLOoq3AKzf2eKtV207mZLDtsUA26uQxDpSIsD78oVMKEAoeVoSe E4GeP5lrfV7dEgbOL7M36tEZBZJL2pemk07S9qcFs+W4NiocrnYHDZhZB Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11000"; a="4070672" X-IronPort-AV: E=Sophos;i="6.06,197,1705392000"; d="scan'208";a="4070672" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2024 17:07:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,197,1705392000"; d="scan'208";a="31541290" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 01 Mar 2024 17:07:45 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 1 Mar 2024 17:07:44 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 1 Mar 2024 17:07:44 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 1 Mar 2024 17:07:44 -0800 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.40) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 1 Mar 2024 17:07:43 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YqObsnJbrbbv/YzSsmKTZx0Oo6j2AwIPD6jkH9xh80z7U7FtJctK3Ih4FWrOdGxiki4vRWaZh73Sd4B4dJe49lU1ah6f32ifPEZcvMc93lE3YeTXXmiXYvr6mep5guqE01IaafHxH0F/7KaeMaijB0wTSUjQscBGcWQj7XbTUtNpnB8yOvwAjp8JO4MWbj6g99qpW6GdROA1bN3XXnfyrzXokoj3NozMeOa9lXDjGeDLwysJEHjiuQl1DQ0JU2z/WZUraYplvB5/ybNHnVvJlpXMQen5EEHerjxnZpBipkNsUYFqDphJ2ziP57j9VjZoKCXTw8UGm3VJT5gJJByLiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CFa++sS/SLyycpJ01BuT9DgvdDTDkR6aAX1lCi+iO0I=; b=ieuE8Uzv5011IlahvguObJRXCYGgkoQHycfG5i23tMJvgPpakrUVEJ87duDM3tlRG1+ld5tLXSJ6++c32ZKAw9yOPm6hxKwPZPTuuJq9u1v9vSlPqffVH7d78Bsn4/qV12YFUPBFSlloZDO8ti+xbE+dlhKgzq9rmlcrNDyXXrz+5/zb+hpyLtYtqt3IZIAczfpxvFGldgPXLUVzGVyOjVJcCFvVZgTi6IlmrbcOWg1n6N7wBgFlj1Xh4ddX7kP+KbGIkMJSkVvQLYMxRMwdEuVcN/rb3w2PTFk8tUvi6NnLOODAIOmzBFEd0/qqh08kSOZfCFGhDm0py75erBvVOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BY5PR11MB4451.namprd11.prod.outlook.com (2603:10b6:a03:1cb::30) by BL1PR11MB5223.namprd11.prod.outlook.com (2603:10b6:208:31a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.14; Sat, 2 Mar 2024 01:07:41 +0000 Received: from BY5PR11MB4451.namprd11.prod.outlook.com ([fe80::49d9:bd88:4a13:199b]) by BY5PR11MB4451.namprd11.prod.outlook.com ([fe80::49d9:bd88:4a13:199b%6]) with mapi id 15.20.7362.015; Sat, 2 Mar 2024 01:07:41 +0000 From: "Chautru, Nicolas" To: Stephen Hemminger , "dev@dpdk.org" CC: "Vargas, Hernan" Subject: RE: [PATCH 6/6] baseband/fpga_5gnr: don't use rand() Thread-Topic: [PATCH 6/6] baseband/fpga_5gnr: don't use rand() Thread-Index: AQHabAItQm4ykj15OUCUXYcSbqQYvLEjokWw Date: Sat, 2 Mar 2024 01:07:41 +0000 Message-ID: References: <20240301175842.159967-1-stephen@networkplumber.org> <20240301175842.159967-7-stephen@networkplumber.org> In-Reply-To: <20240301175842.159967-7-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BY5PR11MB4451:EE_|BL1PR11MB5223:EE_ x-ms-office365-filtering-correlation-id: d28ac2a0-062d-42de-9f1f-08dc3a5528e1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 84k9sBVj5AftpnlL8+X2KKkebgV3s1nunGMOmvmxJskFRwbMLzqQ7P46hJf7hCcMUP8j3P+obqQJeaQA2tBHjQLL9i4ZJ8WWeoRBPKHZuO+vLRz9Izu7MJkJcT8istt1p1Ew18CVadkICH6JxHhmG7sNi09o3CMm+aS0pgD3UkH5LXbW/RHWVP9wOxpvgwEk7KjLuX6C18gC9y1V2Lo/AjINqZ9SMnnHIU1ZHFQNt2MeKR4I8Xt0LR7xTi4fLXVP51YYvsI8fp+GfuYzoNYJulCtOWiB3m9+KpMCP+asR6dv1hWJwG+Zv46fZ7Q7/iQIUy+DfxIcivmfLdC3QM0Cr2faXMPDLe1eSBUPUeABMp2SfXnNjbIeRFQlil1sStkVnkUgSAk1PfVHkURiffbh3MNWyulz7fVYBm7RykdUSUbstaFysq6eO5Jn5gl9m3VBM4s0sL9bM/BKz+p487TbvWRtsgrYtVxSfWfLOxYFZgxCOXDIFs8LRaxPtluYNnu31u0r7vFQd7E/t0KWYT+IrcacwEWuw4sAXzvHzHrDulLURLOHtPxEnHa8RfA6gCUvPPC9+zZzQTqLywK9K4gqugpzNZDTulL/GGO68Ss4xgw8MYPiT5FxubvtMg6gWqThRSBW/CdFLD/ERXRJgKtM7faRlprD30C0YrM0AdwjwCHB2qcm2KT7OUXkvvau8P8mvrtSijVRh/gmJjGJYoHn6Q== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR11MB4451.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8sOd9Dt4TjSHXe+E48woFKvgc08n26TRkiwk5lHQqep3kiYvRTeTCZGZjwsg?= =?us-ascii?Q?ZDSdpP6P/TSo/jp4WI3Q92w6J876lEj02ARewlbIZac1jiWMhbGPqmUPQ+Oy?= =?us-ascii?Q?kZ1OJ8vdp2sWFN8W99sEbDio1aGMQ3H3uDynklMSWT5dEcVxOqK7Lax7Dpws?= =?us-ascii?Q?eh+GTcnBGUVYbVtNwWtxoO+5zpVwa0nB896+rCw5gLI0og3haq+tbOkL82ye?= =?us-ascii?Q?HFnH6upbMrgA7lt83HVK/rOUWnsbzL2bvOK4JJloxVfU9h8e19q9lx+ypsjJ?= =?us-ascii?Q?OFTVO7vwZGhB6xD8m3U03NYpWtFFzpoCqypblARpaM4JB842iqJL7JFuZtxL?= =?us-ascii?Q?JM4cGnla/znsLLEfjAn7kuzlivgoHYBtQRzjtmwJeNBZFXhTvsXhMkuHD/tO?= =?us-ascii?Q?/KtkqJsFiGTWkX5YNT/uhq0bmxdfMinJuwWoKH1/bTANNFLibMdon1IPqIR7?= =?us-ascii?Q?ZpStbYxEuledNPSTbZMwmc9RNQCLGWTcsGWVSz96EhZK0FPGY9Hwo/fkUZWW?= =?us-ascii?Q?kv1PTwcX4UpJQsh5xj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8eTiHHQyuOnQYaW5S?= =?us-ascii?Q?Ra9hOwsR3UIOqsYG7W9fpJCbcUWONPXjm7UZOPfICmBu9VP2m9cfNMmOyerH?= =?us-ascii?Q?iOw9NZbXVWCGWnTiMFTpKPWvKdfiRvApdnSDqjBMUGFEANiib/GQkSkAN/lw?= =?us-ascii?Q?xMsSuVhrqNuCw+j2WYNMfRXMgX5hddfmev76WBYp?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR11MB4451.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d28ac2a0-062d-42de-9f1f-08dc3a5528e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Mar 2024 01:07:41.1688 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: BpcnZanKSc5SE6FJdJGHKnN/hYj+cBtcZB9xs6q2wHk0tf3nm4xBZvaFTZ85qnqRACGbikaxQusnQJIDUnbGoHzjqbw8MQFFBkR4QkYwJeY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5223 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Stephen Hemminger > Sent: Friday, March 1, 2024 9:57 AM > To: dev@dpdk.org > Cc: Stephen Hemminger ; Vargas, Hernan > ; Chautru, Nicolas > Subject: [PATCH 6/6] baseband/fpga_5gnr: don't use rand() >=20 > The function rand is very weak and should not be used. > Use the DPDK rte_rand() which is seeded from entropy instead. >=20 > Coverity issue: 414987 > Fixes: b3d326e438f1 ("baseband/fpga_5gnr_fec: add FPGA mutex") > Cc: hernan.vargas@intel.com > Signed-off-by: Stephen Hemminger Acked-by: Nicolas Chautru > --- > drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > index efc1d3a7725b..9b253cde280d 100644 > --- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > +++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include >=20 > #include > #include > @@ -1990,7 +1991,7 @@ fpga_5gnr_mutex_acquisition(struct > fpga_5gnr_queue *q) { > uint32_t mutex_ctrl, mutex_read, cnt =3D 0; > /* Assign a unique id for the duration of the DDR access */ > - q->ddr_mutex_uuid =3D rand(); > + q->ddr_mutex_uuid =3D rte_rand(); > /* Request and wait for acquisition of the mutex */ > mutex_ctrl =3D (q->ddr_mutex_uuid << 16) + 1; > do { > -- > 2.43.0