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 5537F42529; Wed, 6 Sep 2023 18:26:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 51243402B6; Wed, 6 Sep 2023 18:26:06 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id B77084027C for ; Wed, 6 Sep 2023 18:26:04 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 3AD7D20977; Wed, 6 Sep 2023 18:26:02 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH] random: initialize the random state for non-eal lcores Date: Wed, 6 Sep 2023 18:25:57 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87B7B@smartserver.smartshare.dk> In-Reply-To: <20230906155302.82749-1-stephen@networkplumber.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] random: initialize the random state for non-eal lcores Thread-Index: Adng2kItl3xQJPMBR9qKPEwyhd3saQABGTyw References: <20230906155302.82749-1-stephen@networkplumber.org> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Stephen Hemminger" , Cc: , "Matan Azrad" , "Viacheslav Ovsiienko" , "Ori Kam" , "Suanming Mou" , "Bruce Richardson" 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 > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Wednesday, 6 September 2023 17.53 >=20 > The per-lcore PRNG was not initializing the rand_state of all > the lcores. Any usage of rte_random by a non-EAL lcore would > use rand_states[RTE_MAX_LCORE] which was never initialized. >=20 > Fix by using RTE_DIM() which will get all lcores. >=20 > Fixes: 3f002f069612 ("eal: replace libc-based random generation with = LFSR") > Cc: mattias.ronnblom@ericsson.com > Signed-off-by: Stephen Hemminger > --- > drivers/common/mlx5/linux/mlx5_common_os.c | 2 +- With the unrelated MLX5 stuff removed, Acked-by: Morten Br=F8rup > lib/eal/common/rte_random.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-)