[PATCH] random: initialize the random state for non-eal lcores

Morten Brørup mb at smartsharesystems.com
Wed Sep 6 18:25:57 CEST 2023


> From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> Sent: Wednesday, 6 September 2023 17.53
> 
> 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
> 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")
> Cc: mattias.ronnblom at ericsson.com
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> ---
>  drivers/common/mlx5/linux/mlx5_common_os.c | 2 +-

With the unrelated MLX5 stuff removed,

Acked-by: Morten Brørup <mb at smartsharesystems.com>

>  lib/eal/common/rte_random.c                | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)


More information about the dev mailing list