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

Function get_bit_lfsr

dpdk/lib/hash/rte_thash.c:124–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124static inline uint32_t
125get_bit_lfsr(struct thash_lfsr *lfsr)
126{
127 uint32_t bit, ret;
128
129 /*
130 * masking the TAP bits defined by the polynomial and
131 * calculating parity
132 */
133 bit = rte_popcount32(lfsr->state & lfsr->poly) & 0x1;
134 ret = lfsr->state & 0x1;
135 lfsr->state = ((lfsr->state >> 1) | (bit << (lfsr->deg - 1))) &
136 ((1 << lfsr->deg) - 1);
137
138 lfsr->bits_cnt++;
139 return ret;
140}
141
142static inline uint32_t
143get_rev_bit_lfsr(struct thash_lfsr *lfsr)

Callers 1

generate_subkeyFunction · 0.85

Calls 1

rte_popcount32Function · 0.85

Tested by

no test coverage detected