[RFC,v2,0/2] Pseudo-number generation improvements
mbox series

Message ID 20190419212138.17422-1-mattias.ronnblom@ericsson.com
Headers show
Series
  • Pseudo-number generation improvements
Related show

Message

Mattias Rönnblom April 19, 2019, 9:21 p.m. UTC
Make rte_rand() multi-thread safe, go faster and produce
better-quality pseudo-random numbers.

v2:
* Removed 32-bit version of rte_rand() and rte_rand_max().
* Switched from a four-sequence LFSR (producing a 32-bit number)
  to a five-sequence LFSR (producing a 64-bit number).
* Added a note on generator not being cryptographically secure.

Mattias Rönnblom (2):
  eal: replace libc-based random number generation with LFSR
  eal: introduce random generator function with upper bound

 lib/librte_eal/common/include/rte_random.h |  45 +++---
 lib/librte_eal/common/meson.build          |   1 +
 lib/librte_eal/common/rte_random.c         | 157 +++++++++++++++++++++
 lib/librte_eal/freebsd/eal/Makefile        |   1 +
 lib/librte_eal/freebsd/eal/eal.c           |   2 -
 lib/librte_eal/linux/eal/Makefile          |   1 +
 lib/librte_eal/linux/eal/eal.c             |   2 -
 lib/librte_eal/rte_eal_version.map         |   3 +
 8 files changed, 190 insertions(+), 22 deletions(-)
 create mode 100644 lib/librte_eal/common/rte_random.c