mbox

[v2,0/2] eal: choose initial PRNG seed source at runtime

Message ID 20200421204115.31950-1-dg@adax.com (mailing list archive)
Headers

Message

Dan Gora April 21, 2020, 8:41 p.m. UTC
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 enables dynamic checking for the getentropy() function
using dlload()/dlsym() to allow the code to use getentropy() if it is
available on the execution system, regardless of whether or not it was
available on the compilation system.

Thanks
Dan

-----
v2:
* Fix patch apply issue.
* dlclose() handle if dlsym() fails in __rte_getentropy().


Dan Gora (2):
  eal: check for rdseed at run time for random seed
  eal: resolve getentropy at run time for random seed

 config/x86/meson.build             | 11 +++++--
 lib/librte_eal/common/rte_random.c | 52 ++++++++++++++++++++++--------
 lib/librte_eal/meson.build         |  3 --
 mk/rte.cpuflags.mk                 |  9 ++++--
 4 files changed, 54 insertions(+), 21 deletions(-)