This is first part of three series to fix the DPDK random number
generator to make it faster and more secure.
The first series fixes things that are broken and missing
from the random number seeding. Later series improve the underlying
algorithms.
1/5 adds a Windows getentropy() shim over BCryptGenRandom(), so the
EAL can call getentropy() unconditionally.
Needs to go with #2 for stable backport.
2/5 drops the broken probe and always uses getentropy(). The TSC
fallback remains but now logs at ERR with the errno, so a
blocked syscall can be told apart from other failures.
Marked for stable.
3/5 mixes all 64 bits of seed passed into rte_srand()
4/5 removes the RDSEED fallback. It is unreachable once getentropy()
is always used, and RDSEED has known reliability problems and
errata.
5/5 allow setting random number seed via environment variable
for standalone tests for repeatability.
Stephen Hemminger (5):
eal/windows: add getentropy shim
random: always use getentropy
random: use all 64 bits of the seed
random: remove RDSEED fallback for initial seed
test: allow setting random seed for tests
app/test/test.c | 48 +++++++++++++
doc/guides/contributing/unit_test.rst | 15 ++++
lib/eal/common/rte_random.c | 98 ++++++++++++---------------
lib/eal/include/rte_random.h | 7 +-
lib/eal/meson.build | 3 -
lib/eal/windows/include/rte_os_shim.h | 30 ++++++++
lib/eal/windows/meson.build | 6 +-
7 files changed, 145 insertions(+), 62 deletions(-)
--
2.53.0