67 static const __m128i rte_thash_ipv6_bswap_mask = {
68 0x0405060700010203ULL, 0x0C0D0E0F08090A0BULL};
75 #define RTE_THASH_V4_L3_LEN ((sizeof(struct rte_ipv4_tuple) - \
76 sizeof(((struct rte_ipv4_tuple *)0)->sctp_tag)) / 4)
83 #define RTE_THASH_V4_L4_LEN ((sizeof(struct rte_ipv4_tuple)) / 4)
89 #define RTE_THASH_V6_L3_LEN ((sizeof(struct rte_ipv6_tuple) - \
90 sizeof(((struct rte_ipv6_tuple *)0)->sctp_tag)) / 4)
97 #define RTE_THASH_V6_L4_LEN ((sizeof(struct rte_ipv6_tuple)) / 4)
122 uint8_t src_addr[16];
123 uint8_t dst_addr[16];
134 union rte_thash_tuple {
138 } __attribute__((aligned(XMM_SIZE)));
157 for (i = 0; i < (len >> 2); i++)
173 __m128i ipv6 = _mm_loadu_si128((
const __m128i *)orig->
src_addr);
174 *(__m128i *)targ->v6.src_addr =
175 _mm_shuffle_epi8(ipv6, rte_thash_ipv6_bswap_mask);
176 ipv6 = _mm_loadu_si128((
const __m128i *)orig->
dst_addr);
177 *(__m128i *)targ->v6.dst_addr =
178 _mm_shuffle_epi8(ipv6, rte_thash_ipv6_bswap_mask);
181 for (i = 0; i < 4; i++) {
182 *((uint32_t *)targ->v6.src_addr + i) =
184 *((uint32_t *)targ->v6.dst_addr + i) =
201 static inline uint32_t
203 const uint8_t *rss_key)
205 uint32_t i, j, ret = 0;
207 for (j = 0; j < input_len; j++) {
208 for (i = 0; i < 32; i++) {
209 if (input_tuple[j] & (1 << (31 - i))) {
211 (uint32_t)((uint64_t)(
rte_cpu_to_be_32(((
const uint32_t *)rss_key)[j + 1])) >>
232 static inline uint32_t
234 const uint8_t *rss_key)
236 uint32_t i, j, ret = 0;
238 for (j = 0; j < input_len; j++) {
239 for (i = 0; i < 32; i++) {
240 if (input_tuple[j] & (1 << (31 - i))) {
241 ret ^= ((
const uint32_t *)rss_key)[j] << i |
242 (uint32_t)((uint64_t)(((
const uint32_t *)rss_key)[j + 1]) >> (32 - i));