[PATCH 2/2] random: always use getentropy

Stephen Hemminger stephen at networkplumber.org
Sun Sep 13 19:30:59 CEST 2026


There was a meson config problem and getentropy() was never actually
being used in the build on Linux. Resulting in fallback to TSC always.
Now that getentropy() wrapper exists for Windows
it can always be enabled. This prevents future breakage.

Bugzilla ID: 2035
Fixes: faf8fd252785 ("eal: improve entropy for initial PRNG seed")
Cc: stable at dpdk.org

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 lib/eal/common/rte_random.c | 2 --
 lib/eal/meson.build         | 3 ---
 2 files changed, 5 deletions(-)

diff --git a/lib/eal/common/rte_random.c b/lib/eal/common/rte_random.c
index 537fa035ee..cfb217b553 100644
--- a/lib/eal/common/rte_random.c
+++ b/lib/eal/common/rte_random.c
@@ -219,7 +219,6 @@ rte_drand(void)
 static uint64_t
 __rte_random_initial_seed(void)
 {
-#ifdef RTE_LIBEAL_USE_GETENTROPY
 	int ge_rc;
 	uint64_t ge_seed;
 
@@ -227,7 +226,6 @@ __rte_random_initial_seed(void)
 
 	if (ge_rc == 0)
 		return ge_seed;
-#endif
 #ifdef __RDSEED__
 	unsigned int rdseed_low;
 	unsigned int rdseed_high;
diff --git a/lib/eal/meson.build b/lib/eal/meson.build
index f9fcee24ee..2bf3c67439 100644
--- a/lib/eal/meson.build
+++ b/lib/eal/meson.build
@@ -24,9 +24,6 @@ endif
 if dpdk_conf.has('RTE_HAS_LIBARCHIVE')
     ext_deps += libarchive
 endif
-if cc.has_function('getentropy', prefix : '#include <unistd.h>')
-    cflags += '-DRTE_LIBEAL_USE_GETENTROPY'
-endif
 
 if is_freebsd
     annotate_locks = false
-- 
2.53.0



More information about the stable mailing list