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

Mattias Rönnblom mattias.ronnblom at ericsson.com
Wed May 8 22:30:00 CEST 2019


On 2019-05-08 22:12, Stephen Hemminger wrote:
> 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.
> 

Sounds reasonable.

What version of FreeBSD is DPDK supposed to support? getrandom(2) (and 
its cousin getentropy(3)) seem not be available until FreeBSD 12.


More information about the dev mailing list