[dpdk-dev] [RFC v3 1/2] eal: replace libc-based random number generation with LFSR
Stephen Hemminger
stephen at networkplumber.org
Thu May 9 03:10:14 CEST 2019
On Wed, 8 May 2019 22:30:00 +0200
Mattias Rönnblom <mattias.ronnblom at ericsson.com> wrote:
> 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.
Linux has had it since 3.17 but you often need a syscall wrapper.
Or just read /dev/urandom.
More information about the dev
mailing list