[dpdk-dev] [RFC v3 1/2] eal: replace libc-based random number generation with LFSR

Stephen Hemminger stephen at networkplumber.org
Wed May 8 22:12:39 CEST 2019


On Wed, 24 Apr 2019 14:33:19 +0200
Mattias Rönnblom <mattias.ronnblom at ericsson.com> wrote:

> diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
> index 161399619..d6bf0e89e 100644
> --- a/lib/librte_eal/linux/eal/eal.c
> +++ b/lib/librte_eal/linux/eal/eal.c
> @@ -1083,8 +1083,6 @@ rte_eal_init(int argc, char **argv)
>  #endif
>  	}
>  
> -	rte_srand(rte_rdtsc());

The current model of seeding with TSC will have problems at scale.
If a whole rack of machines reboots at the same time because of power cycle,
it would not be surprising if several had the same TSC value.

A better solution would be to use the get_random() system call to get
seed, the kernel can get entropy from more sources.


More information about the dev mailing list