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

Function rte_softrss

dpdk/lib/hash/rte_thash.h:175–190  ·  view source on GitHub ↗

* Generic implementation. Can be used with original rss_key * @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. */

Source from the content-addressed store, hash-verified

173 * Calculated hash value.
174 */
175static inline uint32_t
176rte_softrss(uint32_t *input_tuple, uint32_t input_len,
177 const uint8_t *rss_key)
178{
179 uint32_t i, j, map, ret = 0;
180
181 for (j = 0; j < input_len; j++) {
182 for (map = input_tuple[j]; map; map &= (map - 1)) {
183 i = rte_bsf32(map);
184 ret ^= rte_cpu_to_be_32(((const uint32_t *)rss_key)[j]) << (31 - i) |
185 (uint32_t)((uint64_t)(rte_cpu_to_be_32(((const uint32_t *)rss_key)[j + 1])) >>
186 (i + 1));
187 }
188 }
189 return ret;
190}
191
192/**
193 * Optimized implementation.

Callers 9

rte_thash_adjust_tupleFunction · 0.85
run_rss_calcFunction · 0.85
test_toeplitz_hash_calcFunction · 0.85
test_big_tuple_gfniFunction · 0.85
test_adjust_tupleFunction · 0.85
calc_tuple_hashFunction · 0.85

Calls 1

rte_bsf32Function · 0.50

Tested by 8

run_rss_calcFunction · 0.68
test_toeplitz_hash_calcFunction · 0.68
test_big_tuple_gfniFunction · 0.68
test_adjust_tupleFunction · 0.68
calc_tuple_hashFunction · 0.68