40 #define CNE_THASH_V4_L3_LEN \
41 ((sizeof(struct cne_ipv4_tuple) - sizeof(((struct cne_ipv4_tuple *)0)->sctp_tag)) / 4)
48 #define CNE_THASH_V4_L4_LEN ((sizeof(struct cne_ipv4_tuple)) / 4)
54 #define CNE_THASH_V6_L3_LEN \
55 ((sizeof(struct cne_ipv6_tuple) - sizeof(((struct cne_ipv6_tuple *)0)->sctp_tag)) / 4)
62 #define CNE_THASH_V6_L4_LEN ((sizeof(struct cne_ipv6_tuple)) / 4)
99 union cne_thash_tuple {
102 } __attribute__((aligned(XMM_SIZE)));
118 for (i = 0; i < (len >> 2); i++)
119 targ[i] = be32toh(orig[i]);
133 __m128i ipv6 = _mm_loadu_si128((
const __m128i *)orig->
src_addr);
135 ipv6 = _mm_loadu_si128((
const __m128i *)orig->
dst_addr);
150 static inline uint32_t
151 cne_softrss(uint32_t *input_tuple, uint32_t input_len,
const uint8_t *rss_key)
153 uint32_t i, j, map, ret = 0;
155 for (j = 0; j < input_len; j++) {
156 for (map = input_tuple[j]; map; map &= (map - 1)) {
158 ret ^= htobe32(((
const uint32_t *)rss_key)[j]) << (31 - i) |
159 (uint32_t)((uint64_t)(htobe32(((
const uint32_t *)rss_key)[j + 1])) >> (i + 1));
178 static inline uint32_t
179 cne_softrss_be(uint32_t *input_tuple, uint32_t input_len,
const uint8_t *rss_key)
181 uint32_t i, j, map, ret = 0;
183 for (j = 0; j < input_len; j++) {
184 for (map = input_tuple[j]; map; map &= (map - 1)) {
186 ret ^= ((
const uint32_t *)rss_key)[j] << (31 - i) |
187 (uint32_t)((uint64_t)(((
const uint32_t *)rss_key)[j + 1]) >> (i + 1));
static uint32_t cne_bsf32(uint32_t v)
static void cne_convert_rss_key(const uint32_t *orig, uint32_t *targ, int len)
static void cne_thash_load_v6_addrs(const struct cne_ipv6_hdr *orig, union cne_thash_tuple *targ)
static const __m128i cne_thash_ipv6_bswap_mask
static uint32_t cne_softrss(uint32_t *input_tuple, uint32_t input_len, const uint8_t *rss_key)
static uint32_t cne_softrss_be(uint32_t *input_tuple, uint32_t input_len, const uint8_t *rss_key)