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 8EC804319F for ; Thu, 19 Oct 2023 02:00:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8870E4029E; Thu, 19 Oct 2023 02:00:00 +0200 (CEST) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mails.dpdk.org (Postfix) with ESMTP id 7567240A7A for ; Thu, 19 Oct 2023 01:59:58 +0200 (CEST) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4083f61322fso8495765e9.1 for ; Wed, 18 Oct 2023 16:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697673598; x=1698278398; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=++eOVDUzBDy7rWIP6F1kfxHC9IyQuO3jJBUa+8kSysA=; b=W3SzBUp9fK4k/+eD8rLC4x7N54C+otPn8mTTemoLlLlDt06KGnUCriHieEeWXErfUn kww4LuGWXUEVsyZdwy6jc/tNIgBfigIkGwAj9936PlO8IMzt7Ee8BCo1djvRpplyq876 UP95VnPNWCMmAJrQTbdQyLMpf5+ZkL6gqwvOmTvzcm7WcEQio/1X3AkN6pNhjCM/Sitm 9JK3T8KE6GK2JNG3o8M1/8LLKKVgFaVypaj5KMbaAuwNjYtw8Vc86QWGGwIA6sXPyvy6 uXfO/AvSRO6bntLYFF/Eg5EWphbZ73GVl19UCSECsKicXWu4P5SxNaNuLok0NaSwV6yd PtDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697673598; x=1698278398; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=++eOVDUzBDy7rWIP6F1kfxHC9IyQuO3jJBUa+8kSysA=; b=nUho0byVIPBJEph/RTBCk+ybw3OSDAiw6+bNniyp9IaHSgwDIv2xWl/MZzl7Jdr4fC bg5A9rViOxMtzNyrS0po7LoCMASx77ogfZZUK822vxMRRTYmyjs6V2VjYTwzGlT48Jwb l2ZwA35+yLPad3Zc6XLfIleQ+qaH82yyF69LnS6j3F9FMzPwtaUmKCfN9sbcWUjNyZ6G Ub6z4iP7yLRz3F0aVWIIbELfgrcRHz1WS53lOQXvnViVq5N7lQlnjONFHkDgk7G+/EX0 0ucjSCgOMETZwsqFr9TQY7ivPDaRqvkYB+/ZJGMUlUTTCTDqoZfy0QVo6r8YhzmnLcO2 yMpQ== X-Gm-Message-State: AOJu0Ywbh6waGFwuzco1agt3Eee1uU0EEHLV8eDzyQ1XpXCIELviw9VJ T8xuceNFhCjoRXbIKFp/YMM= X-Google-Smtp-Source: AGHT+IGdhKmUFuQvar0//hhedRhDweS2kBcEvif9TIsGBx74xnp2+qPDSgRQZzR6bXYd+HtfQDPUjw== X-Received: by 2002:a5d:55d1:0:b0:32d:9640:6bd9 with SMTP id i17-20020a5d55d1000000b0032d96406bd9mr341051wrw.57.1697673598124; Wed, 18 Oct 2023 16:59:58 -0700 (PDT) Received: from localhost ([137.220.119.58]) by smtp.gmail.com with ESMTPSA id q28-20020adfab1c000000b003248a490e3asm3182315wrc.39.2023.10.18.16.59.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 16:59:57 -0700 (PDT) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: =?UTF-8?q?Morten=20Br=C3=B8rup?= , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= , dpdk stable Subject: patch 'random: initialize state for unregistered non-EAL threads' has been queued to stable release 20.11.10 Date: Thu, 19 Oct 2023 00:58:58 +0100 Message-Id: <20231018235930.3144-9-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231018235930.3144-1-luca.boccassi@gmail.com> References: <20231018235930.3144-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 20.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/21/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/681827b2e3220fa97568958da137dd7847215fbb Thanks. Luca Boccassi --- >From 681827b2e3220fa97568958da137dd7847215fbb Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 7 Sep 2023 08:24:55 -0700 Subject: [PATCH] random: initialize state for unregistered non-EAL threads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 3a4e21301c7a8bf709ff9e74d05628f87450a11e ] The per-lcore PRNG was not initializing the rand_state of all the lcores. Any usage of rte_random by an unregistered non-EAL thread would 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 LFSR") Signed-off-by: Stephen Hemminger Reviewed-by: Morten Brørup Acked-by: Mattias Rönnblom --- lib/librte_eal/common/rte_random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/rte_random.c b/lib/librte_eal/common/rte_random.c index ce21c2242a..ac5876dd1f 100644 --- a/lib/librte_eal/common/rte_random.c +++ b/lib/librte_eal/common/rte_random.c @@ -82,7 +82,7 @@ rte_srand(uint64_t seed) unsigned int lcore_id; /* add lcore_id to seed to avoid having the same sequence */ - for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) + for (lcore_id = 0; lcore_id < RTE_DIM(rand_states); lcore_id++) __rte_srand_lfsr258(seed + lcore_id, &rand_states[lcore_id]); } -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-10-19 00:28:56.701114210 +0100 +++ 0009-random-initialize-state-for-unregistered-non-EAL-thr.patch 2023-10-19 00:28:56.201804098 +0100 @@ -1 +1 @@ -From 3a4e21301c7a8bf709ff9e74d05628f87450a11e Mon Sep 17 00:00:00 2001 +From 681827b2e3220fa97568958da137dd7847215fbb Mon Sep 17 00:00:00 2001 @@ -8,0 +9,2 @@ +[ upstream commit 3a4e21301c7a8bf709ff9e74d05628f87450a11e ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ - lib/eal/common/rte_random.c | 2 +- + lib/librte_eal/common/rte_random.c | 2 +- @@ -25,5 +26,5 @@ -diff --git a/lib/eal/common/rte_random.c b/lib/eal/common/rte_random.c -index 53636331a2..812e5b4757 100644 ---- a/lib/eal/common/rte_random.c -+++ b/lib/eal/common/rte_random.c -@@ -84,7 +84,7 @@ rte_srand(uint64_t seed) +diff --git a/lib/librte_eal/common/rte_random.c b/lib/librte_eal/common/rte_random.c +index ce21c2242a..ac5876dd1f 100644 +--- a/lib/librte_eal/common/rte_random.c ++++ b/lib/librte_eal/common/rte_random.c +@@ -82,7 +82,7 @@ rte_srand(uint64_t seed)