| 122 | } |
| 123 | |
| 124 | static inline uint32_t |
| 125 | get_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 | |
| 142 | static inline uint32_t |
| 143 | get_rev_bit_lfsr(struct thash_lfsr *lfsr) |
no test coverage detected