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 BD24F45EDD for ; Wed, 18 Dec 2024 17:35:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96A1440DDE; Wed, 18 Dec 2024 17:35:07 +0100 (CET) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id BF50D40DDE for ; Wed, 18 Dec 2024 17:35:06 +0100 (CET) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2161eb94cceso46251565ad.2 for ; Wed, 18 Dec 2024 08:35:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1734539706; x=1735144506; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=0w4/cORO70LxCNj4ar7eygC3LVvRpSdWJk/Q+ENqk94=; b=EjPnP9xL0icFuEgT93JDw3hB2YjQCnzS0rKeuEqmLKvOZLIRfEcGgBceID7Q2NzL9F 1DuiwSdkJKylGBjMYoJxkR3gLCnFhMgsrYfQUuVuWFklqHrxfwvrPjShgg8oI39WOrzb vS9+8z++bBGajs+S0wBByPEhlDRPfC8RPJe+VId6U3BL+m3HaHg3qu5k6W89yZ9yJBA/ c3qMmBlV5vGyclfW1Sq67lC09lbb4ffgrw4vDXFFSqZbGC+qsTeQe7kVRbBPPeexxhzS 2SPq+jXRFQKwxWkyNGhSC1iVSFERNTIZK8OVP3jV5jA798w9N044At8cQVZsjF7MyKBN TauQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734539706; x=1735144506; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0w4/cORO70LxCNj4ar7eygC3LVvRpSdWJk/Q+ENqk94=; b=cMfyJzxjhK88ZzPEr3dgFe2BxQRkQwoFA1ggDsgQTbx5DuoamGxnfYnlKF5GWrT45/ EPBua9B+//Kpum16IFIFwrjnoMs2JIDfn9PFRLtMhov4bvfHLZYWgw1ZVhCjeYKg+yqW tMBR2QCAgFLNJY1Nk1dQc/bgqdfZAJKOL5a4VQKFgL5iHQUpyiag76FUwSJtPFOfr/TA gn2hd1Wb+kyAI5k0ynbE+ZFxTJaaDeZoxcI/GN6iuc+wwzZJEv4qmQKuWPknKKHGR/wB jRnngF7Zfz9A8TVrmZZ7ReksF/gNRI0A/r8x9dnSInpy365EmEJRky+RpTV6KzGFbgvU 6e+g== X-Forwarded-Encrypted: i=1; AJvYcCVfk0VbkcuELqD29BXp6QII1fYLTBVYGO7lOcX6PT5R8xvshnfYW8XBk3xd5kVI24S7An4UZ1c=@dpdk.org X-Gm-Message-State: AOJu0YyvdZTXqw4bY48RYOyM78MhTMXshAKrdaupZrSfFRaKcJQbBgLe SxETsMtHMBXk3ZEqohp+X2apvNKmnugmkT9HXPzOj99J1YR+XY8WP6b7ft6iMks= X-Gm-Gg: ASbGncuUGsx0cnsrdRBDFz5ScvnEsjaXeOgvKw1MaImEyEpDA0xbecI53oKHN/Vhj+J UtFJxdmqfeOtqgYTchRK0Wzs2ROK85JL3yedW0vrFrIEK9YcJgDpXCXqbMA+y926OvoOLR/vCtw R8RfoTA3Ks/47Uj82zyE/XAbLKOMBNV5+tU4ebnm82uHMRLOHfn1zWIoXj+N7/8Q2LrXXDgyCn5 /BRNbB9RoQOywKqsrUkUG+pca40Z1KU9bWP79CMIP+SdxcsWjGKBbh+E5Go91PG/yC3wMpbMPsH UsWe/5254GNBHqtM4Ie8tIgIUggCnkgwUg== X-Google-Smtp-Source: AGHT+IFeBEMcZjoDJKchCs5m5ULvtCjgdRhSVHBjTTwN8TyipFMFFFB6d2hJGYqjxlk5VBvHsiz0KQ== X-Received: by 2002:a17:902:eccc:b0:216:45eb:5e4d with SMTP id d9443c01a7336-218d6fcbf06mr48670235ad.6.1734539705954; Wed, 18 Dec 2024 08:35:05 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e64289sm78499165ad.234.2024.12.18.08.35.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 08:35:05 -0800 (PST) Date: Wed, 18 Dec 2024 08:35:02 -0800 From: Stephen Hemminger To: David Marchand Cc: dev@dpdk.org, thomas@monjalon.net, frode.nordahl@canonical.com, mattias.ronnblom@ericsson.com, anatoly.burakov@intel.com, stable@dpdk.org, Tyler Retzlaff , Bruce Richardson , Dmitry Kozlyuk , Chengwen Feng , Morten =?UTF-8?B?QnLDuHJ1cA==?= , Konstantin Ananyev Subject: Re: [PATCH v2 2/5] random: defer seeding to EAL init Message-ID: <20241218083502.266cd066@hermes.local> In-Reply-To: <20241217085954.3310414-3-david.marchand@redhat.com> References: <20241205175754.1673888-1-david.marchand@redhat.com> <20241217085954.3310414-1-david.marchand@redhat.com> <20241217085954.3310414-3-david.marchand@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Tue, 17 Dec 2024 09:59:49 +0100 David Marchand wrote: > The RNG is documented as being seeded as part of EAL init. >=20 > Move the initialisation (seeding) helper out of a constructor and > call it explicitly from rte_eal_init() as it was done before commit > 3f002f069612 ("eal: replace libc-based random generation with LFSR"). >=20 > This also moves the unconditional lcore variable allocation out of a > constructor. >=20 > While at it, mark local symbol rand_state as static. >=20 > Fixes: 29c39cd3d54d ("random: keep PRNG state in lcore variable") > Cc: stable@dpdk.org >=20 > Signed-off-by: David Marchand > Reviewed-by: Mattias R=C3=B6nnblom > Acked-by: Anatoly Burakov Probably need to add a check to rte_random() so it crashes if called before initialization, rather than returning an un-random number which could be a hidden long term bug.