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 B61B44266A; Wed, 4 Oct 2023 10:45:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 847A8402CC; Wed, 4 Oct 2023 10:45:59 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id C8EDE4029A for ; Wed, 4 Oct 2023 10:45:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696409157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AlG3tC90pFei8w7X7aNkSAJrtebGs033A1uDDbjp9uU=; b=WaWDpenakzHq60hCeuKLIaMCG7bDtKhOmiijXvDDfETfKm78q3fIP4noR9l25qevye60O9 88SluCo4vMAEGXkgO6rnKAFCzMki2h0AjGsGuABWbF8oY/tIHpCPC6wmxu4hF6k/n6z2A5 xpB7xAN8NpqQEVBcwitQeVgcEf3NZYk= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-K-Wvko5AMJSb4h4nCZuGwg-1; Wed, 04 Oct 2023 04:45:56 -0400 X-MC-Unique: K-Wvko5AMJSb4h4nCZuGwg-1 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2c2b9eb8e26so16705321fa.0 for ; Wed, 04 Oct 2023 01:45:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696409154; x=1697013954; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AlG3tC90pFei8w7X7aNkSAJrtebGs033A1uDDbjp9uU=; b=H1qOg/zReXWqeU88FbHbIYufBHVJ60B0/7y1EFg+NQ9tjeuy6h5hpRuViD0tws53Hf GPY85hJIvzLulmRYtelld42r0zJvPI7rrmtOv1x7Fk1mW6kUVTpv4g19K/voqtRWeheD wIE/JfrxUDUyMQYJxTg3Xp8Rk9WPHIb2zFp6KmA3WakQhyPU1pzfeGeZa03nOOz4YPVA V9Cu8AHsu3fDzUg7NBHCmNdaRyXj0kF03kiGW5svGlM50KNWtiPESu/6uQSap+RYL8gu XkWZFrj3tFHhy8yWQqKV3/zJudGBFGKwV0zgL2UkwYuE4sMPU3zmQNXW7xYjDZQqi5Sa HyJw== X-Gm-Message-State: AOJu0Yy41o9QGGsxCVfUyY+HoqVzlprH/9sWQBoQY/ZBi4ibtWUQZaS2 QDGJfQ9pr5VXtaxZHILN+JLN68zhoTsCywMn8YIf6AC67fzpphCc03843Y01f1wYcdJkCsU87UG wq781fuG2KdU4k42Im+w= X-Received: by 2002:a2e:8241:0:b0:2c1:6b9c:48d6 with SMTP id j1-20020a2e8241000000b002c16b9c48d6mr1478715ljh.16.1696409154748; Wed, 04 Oct 2023 01:45:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5y1c+/ugbbkPej6DItTaS26OY2SyQNdNMsx2wHQx+wIqxD0GchtShKAnG5vSiU1J2emQ5ILYHQTXypr8sEs8= X-Received: by 2002:a2e:8241:0:b0:2c1:6b9c:48d6 with SMTP id j1-20020a2e8241000000b002c16b9c48d6mr1478703ljh.16.1696409154424; Wed, 04 Oct 2023 01:45:54 -0700 (PDT) MIME-Version: 1.0 References: <20230906155302.82749-1-stephen@networkplumber.org> <20230907152456.20570-1-stephen@networkplumber.org> <20230907152456.20570-2-stephen@networkplumber.org> <4a0cc5ff-a8e3-79cf-0190-09a4de2f1e9a@lysator.liu.se> In-Reply-To: <4a0cc5ff-a8e3-79cf-0190-09a4de2f1e9a@lysator.liu.se> From: David Marchand Date: Wed, 4 Oct 2023 10:45:42 +0200 Message-ID: Subject: Re: [PATCH v2 1/2] random: initialize the random state for non-EAL threads To: Stephen Hemminger , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= Cc: dev@dpdk.org, mattias.ronnblom@ericsson.com, =?UTF-8?Q?Morten_Br=C3=B8rup?= , Bruce Richardson X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 Mon, Oct 2, 2023 at 2:28=E2=80=AFPM Mattias R=C3=B6nnblom wrote: > > On 2023-09-07 17:24, Stephen Hemminger wrote: > > 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 > > "/../ by an unregistered non-EAL thread /../" > > > use rand_states[RTE_MAX_LCORE] which was never initialized. > > > > Fix by using RTE_DIM() which will get all lcores. > > > > Fixes: 3f002f069612 ("eal: replace libc-based random generation with LF= SR") > > Cc: mattias.ronnblom@ericsson.com > > Acked-by: Morten Br=C3=B8rup > > Signed-off-by: Stephen Hemminger > > --- > > lib/eal/common/rte_random.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/lib/eal/common/rte_random.c b/lib/eal/common/rte_random.c > > index 53636331a27b..812e5b4757b5 100644 > > --- a/lib/eal/common/rte_random.c > > +++ b/lib/eal/common/rte_random.c > > @@ -84,7 +84,7 @@ rte_srand(uint64_t seed) > > unsigned int lcore_id; > > > > /* add lcore_id to seed to avoid having the same sequence */ > > - for (lcore_id =3D 0; lcore_id < RTE_MAX_LCORE; lcore_id++) > > + for (lcore_id =3D 0; lcore_id < RTE_DIM(rand_states); lcore_id++) > > __rte_srand_lfsr258(seed + lcore_id, &rand_states[lcore_i= d]); > > } > > > > With the above-mentioned commit message rewording: > > Acked-by: Mattias R=C3=B6nnblom > Applied this patch. The second patch is marked as rejected in pw, in favor of a followup doc pa= tch. Thanks. --=20 David Marchand