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 951C545EDD; Wed, 18 Dec 2024 17:35:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C9AAE40E8A; Wed, 18 Dec 2024 17:35:07 +0100 (CET) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id C0BA340DF5 for ; Wed, 18 Dec 2024 17:35:06 +0100 (CET) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2163dc5155fso58902675ad.0 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=f3shdfSY3t32GlekNzb3i72qci2jtPeW4w2IpdFFqEqG+J+3kbMUM5I15LD7XSA+9G aX0KThF8+qwp5ebwVy5VFi8Q/MFFe0Ys9XaCfMN/gaYsVZ5YfgWm6lGyRkWStEWQ+Phj 0xRBeJotjn+F67SAIRLcVEkMYCtmI+DIEQ44Kh+eUcUhoXDMU2NXXplX8Raer0SZT0Al dIljmhT6V0Fh7QIZ1X/xtn7Q+xAYs7HAcbezwty2stMaxRJg6C64oCjzepEqD92CQ71o mfKNA77G8VeU2gjQZ2QpIerPCjjllWYkb7IZ9EAJZqkGUO3+gQJuWstXApnA0Svo6VJ5 Zy2w== X-Gm-Message-State: AOJu0Yxbx+bEfeWot469HF2uxJDXRh4Kg6CMrwDoEsp16iczy5RsaxXA /O2gBXZKENJZvaJwITdTmZdL0cyu63du6HuC0VQquiSEUeXP1ZYC2QVDJ0uveHE= X-Gm-Gg: ASbGncu2T65v/s9JkCorkBNcc2r9/iouqpXjOgcEH7jfFmSe2OXVzEWrzcRb4e+mfI4 6bi8rlBqppqE48GrTua+NPGKnoi4WGQTAQ6I5nrVLBcs0k+361ZOd/4gYwWnfx4+qugEQkHKJup 2AoD4UKxtc4FydMkYmObVwJFRGgRNDgIfE+ImxrHcObxdqEDtKI0zjLIAm6ne+8E+2tWn/OXCYK cz+E/H3Y1DpVRsL1rRHXCsyqLj/N4A4VnljiLDOgD5FIc/ZKt31qTM8vtxtH4dPEIiXvlfg76Us 0h1d41DfqQyTziKQemvN+zxgA+5Z0tN73w== 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: 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 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.