From: "Mattias Rönnblom" <mattias.ronnblom@ericsson.com>
To: Dan Gora <dg@adax.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
David Marchand <david.marchand@redhat.com>,
Jerin Jacob <jerinjacobk@gmail.com>,
Bruce Richardson <bruce.richardson@intel.com>
Subject: Re: [dpdk-dev] [PATCH v4 0/2] eal: choose initial PRNG seed source at runtime
Date: Mon, 29 Jun 2020 21:05:59 +0000 [thread overview]
Message-ID: <d89707bf-2608-c493-ac42-ac4dbca11550@ericsson.com> (raw)
In-Reply-To: <CAGyogRYA1qOhwhRJyTcbK=Xox1r1NThFsTvsmbeoLYux2-TVNw@mail.gmail.com>
On 2020-06-29 20:01, Dan Gora wrote:
> On Mon, Jun 29, 2020 at 6:32 AM Mattias Rönnblom
> <mattias.ronnblom@ericsson.com> wrote:
>> On 2020-04-23 01:42, Dan Gora wrote:
>>> Hi All,
>>>
>>> The following patches updates the rte_random subsystem to dynamically find
>>> the best source of the initial seed to the PRNG at run time.
>>>
>>> The first patch enables dynamic checking for the rdseed instruction and
>>> removes the requirement for it on the execution system. It also ensures
>>> that the code to use the rdseed instruction is generated, even if the host
>>> compilation system does not support it (on x86 systems).
>>>
>>> The second patch emulates the getentropy() glibc function by reading bytes
>>> from /dev/urandom. This removes an unnecessary dependency on glibc 2.25.
>>>
>>> v4: Note that emulating getentropy by reading from /dev/urandom should
>>> never fail, so now the question is if we should just remove the rdseed
>>> method entirely since it's x86 only? Should we remove the fallback to
>>> rte_get_tsc_cycles()?
>>>
>>> Thanks
>>> Dan
>>>
>>> -----
>>> v2:
>>> * Fix patch apply issue.
>>> * dlclose() handle if dlsym() fails in __rte_getentropy().
>>>
>>> v3:
>>> * Fix error checking of dlsym() in __rte_getentropy().
>>> * Style changes recommended by Mattias.
>>>
>>> v4:
>>> * Replace dlopen/dlsym method with reading from /dev/urandom.
>>> * Try rdseed method before getentropy() method since the
>>> latter should never fail.
>>
>> I see no reason to prefer rdseed over the kernel.
> Let me give you a good reason. The reason that this change was done...
>
> Since rte_getentropy() is now available on all systems (with these
> patches) and cannot fail. rdseed can either 1) go before
> rte_getentropy() or 2) be completely removed.
>
It's unlikely to fail, and if it does something is probably seriously
wrong with your system. You also seem to think it might fail, since you
take great care of setting errno and having non-zero return code in
__rte_getentropy().
From what I recall, it was Bruce that suggested rdseed should be
included as one of the sources. I have no opinion on that particular
subject, other than I think kernel-originated randomness should have
priority.
next prev parent reply other threads:[~2020-06-29 21:06 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-21 19:54 [dpdk-dev] [PATCH " Dan Gora
2020-04-21 19:54 ` [dpdk-dev] [PATCH 1/2] eal: check for rdseed at run time for random seed Dan Gora
2020-04-22 8:22 ` Mattias Rönnblom
2020-04-21 19:54 ` [dpdk-dev] [PATCH 2/2] eal: resolve getentropy " Dan Gora
2020-04-21 21:03 ` Stephen Hemminger
2020-04-21 21:08 ` Dan Gora
2020-04-22 8:28 ` Mattias Rönnblom
2020-04-22 17:44 ` Dan Gora
2020-04-22 20:14 ` Mattias Rönnblom
2020-04-22 20:35 ` Dan Gora
2020-04-23 10:04 ` Luca Boccassi
2020-04-23 17:38 ` Dan Gora
2020-04-27 12:44 ` Luca Boccassi
2020-04-27 16:57 ` Dan Gora
2020-04-30 8:41 ` Luca Boccassi
2020-04-30 20:43 ` Dan Gora
2020-05-01 10:33 ` Luca Boccassi
2020-05-01 21:05 ` Dan Gora
2020-05-04 8:04 ` Mattias Rönnblom
2020-05-04 14:13 ` Dan Gora
2020-05-04 14:19 ` Dan Gora
2020-06-02 5:10 ` Dan Gora
2020-06-09 15:37 ` Dan Gora
2020-06-10 8:15 ` Thomas Monjalon
2020-06-10 8:33 ` Luca Boccassi
2023-06-12 15:55 ` Stephen Hemminger
2020-06-10 8:07 ` Thomas Monjalon
2020-04-23 12:36 ` Mattias Rönnblom
2020-04-23 17:27 ` Dan Gora
2020-04-21 20:41 ` [dpdk-dev] [PATCH v2 0/2] eal: choose initial PRNG seed source at runtime Dan Gora
2020-04-21 20:41 ` [dpdk-dev] [PATCH v2 1/2] eal: check for rdseed at run time for random seed Dan Gora
2020-04-21 20:41 ` [dpdk-dev] [PATCH v2 2/2] eal: resolve getentropy " Dan Gora
2020-04-22 18:15 ` [dpdk-dev] [PATCH v3 0/2] eal: choose initial PRNG seed source at runtime Dan Gora
2020-04-22 18:15 ` [dpdk-dev] [PATCH v3 1/2] eal: check for rdseed at run time for random seed Dan Gora
2020-04-22 18:15 ` [dpdk-dev] [PATCH v3 2/2] eal: resolve getentropy " Dan Gora
2020-04-22 23:42 ` [dpdk-dev] [PATCH v4 0/2] eal: choose initial PRNG seed source at runtime Dan Gora
2020-04-22 23:42 ` [dpdk-dev] [PATCH v4 1/2] eal: check for rdseed at run time for random seed Dan Gora
2020-04-22 23:42 ` [dpdk-dev] [PATCH v4 2/2] eal: emulate glibc getentropy for initial " Dan Gora
2020-04-23 2:39 ` Stephen Hemminger
2020-04-23 17:42 ` Dan Gora
2020-06-29 9:30 ` Mattias Rönnblom
2020-06-29 17:57 ` Dan Gora
2020-06-29 20:57 ` Mattias Rönnblom
2020-06-29 9:32 ` [dpdk-dev] [PATCH v4 0/2] eal: choose initial PRNG seed source at runtime Mattias Rönnblom
2020-06-29 18:01 ` Dan Gora
2020-06-29 18:04 ` Dan Gora
2020-06-29 21:05 ` Mattias Rönnblom [this message]
2020-06-29 21:14 ` Dan Gora
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d89707bf-2608-c493-ac42-ac4dbca11550@ericsson.com \
--to=mattias.ronnblom@ericsson.com \
--cc=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=dg@adax.com \
--cc=jerinjacobk@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).