* @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) */
| 113 | * @return Random number between 0 and (2^22 - 1) |
| 114 | */ |
| 115 | static inline uint32_t |
| 116 | rte_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 |
no outgoing calls
no test coverage detected