MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_fast_rand

Function rte_fast_rand

dpdk/lib/sched/rte_red.h:115–120  ·  view source on GitHub ↗

* @brief Generate random number for RED * * Implementation based on: * http://software.intel.com/en-us/articles/fast-random-number-generator-on-the-intel-pentiumr-4-processor/ * * 10 bit shift has been found through empirical tests (was 16). * * @return Random number between 0 and (2^22 - 1) */

Source from the content-addressed store, hash-verified

113 * @return Random number between 0 and (2^22 - 1)
114 */
115static inline uint32_t
116rte_fast_rand(void)
117{
118 rte_red_rand_seed = (214013 * rte_red_rand_seed) + 2531011;
119 return rte_red_rand_seed >> 10;
120}
121
122/**
123 * @brief calculate factor to scale average queue size when queue

Callers 2

__rte_red_dropFunction · 0.85
rte_red_config_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected