* Optimized implementation. * If you want the calculated hash value matches NIC RSS value * you have to use special converted key with rte_convert_rss_key() fn. * @param input_tuple * Pointer to input tuple * @param input_len * Length of input_tuple in 4-bytes chunks * @param *rss_key * Pointer to RSS hash key. * @return * Calculated hash value. */
| 203 | * Calculated hash value. |
| 204 | */ |
| 205 | static inline uint32_t |
| 206 | rte_softrss_be(uint32_t *input_tuple, uint32_t input_len, |
| 207 | const uint8_t *rss_key) |
| 208 | { |
| 209 | uint32_t i, j, map, ret = 0; |
| 210 | |
| 211 | for (j = 0; j < input_len; j++) { |
| 212 | for (map = input_tuple[j]; map; map &= (map - 1)) { |
| 213 | i = rte_bsf32(map); |
| 214 | ret ^= ((const uint32_t *)rss_key)[j] << (31 - i) | |
| 215 | (uint32_t)((uint64_t)(((const uint32_t *)rss_key)[j + 1]) >> (i + 1)); |
| 216 | } |
| 217 | } |
| 218 | return ret; |
| 219 | } |
| 220 | |
| 221 | /** |
| 222 | * Indicates if GFNI implementations of the Toeplitz hash are supported. |