16 #ifndef __THROTTLE_H__ 17 #define __THROTTLE_H__ 36 #define THROTTLE_BITS (512) 50 return t->
seeds[thread_index];
67 drop = (t->
bitmaps[thread_index][w] & m) != 0;
68 t->
bitmaps[thread_index][w] |= m;
static u64 clib_xxhash(u64 key)
clib_memset(h->entries, 0, sizeof(h->entries[0])*entries)
static u64 random_u64(u64 *seed)
64-bit random number generator Again, constants courtesy of Donald Knuth.
static u64 throttle_seed(throttle_t *t, u32 thread_index, f64 time_now)
A throttle Used in the data plane to decide if a given hash should be throttled, i.e.
f64 * last_seed_change_time
void throttle_init(throttle_t *t, u32 n_threads, f64 time)
struct throttle_t_ throttle_t
A throttle Used in the data plane to decide if a given hash should be throttled, i.e.
static int throttle_check(throttle_t *t, u32 thread_index, u64 hash, u64 seed)