66 static const __m128i rte_thash_ipv6_bswap_mask = {
67 0x0405060700010203ULL, 0x0C0D0E0F08090A0BULL};
74 #define RTE_THASH_V4_L3_LEN ((sizeof(struct rte_ipv4_tuple) - \
75 sizeof(((struct rte_ipv4_tuple *)0)->sctp_tag)) / 4)
82 #define RTE_THASH_V4_L4_LEN ((sizeof(struct rte_ipv4_tuple)) / 4)
88 #define RTE_THASH_V6_L3_LEN ((sizeof(struct rte_ipv6_tuple) - \
89 sizeof(((struct rte_ipv6_tuple *)0)->sctp_tag)) / 4)
96 #define RTE_THASH_V6_L4_LEN ((sizeof(struct rte_ipv6_tuple)) / 4)
120 uint8_t src_addr[16];
121 uint8_t dst_addr[16];
131 union rte_thash_tuple {
135 } __attribute__((aligned(XMM_SIZE)));
154 for (i = 0; i < (len >> 2); i++)
170 __m128i ipv6 = _mm_loadu_si128((
const __m128i *)orig->
src_addr);
171 *(__m128i *)targ->v6.src_addr =
172 _mm_shuffle_epi8(ipv6, rte_thash_ipv6_bswap_mask);
173 ipv6 = _mm_loadu_si128((
const __m128i *)orig->
dst_addr);
174 *(__m128i *)targ->v6.dst_addr =
175 _mm_shuffle_epi8(ipv6, rte_thash_ipv6_bswap_mask);
178 for (i = 0; i < 4; i++) {
179 *((uint32_t *)targ->v6.src_addr + i) =
181 *((uint32_t *)targ->v6.dst_addr + i) =
198 static inline uint32_t
200 const uint8_t *rss_key)
202 uint32_t i, j, ret = 0;
204 for (j = 0; j < input_len; j++) {
205 for (i = 0; i < 32; i++) {
206 if (input_tuple[j] & (1 << (31 - i))) {
208 (uint32_t)((uint64_t)(
rte_cpu_to_be_32(((
const uint32_t *)rss_key)[j + 1])) >>
229 static inline uint32_t
231 const uint8_t *rss_key)
233 uint32_t i, j, ret = 0;
235 for (j = 0; j < input_len; j++) {
236 for (i = 0; i < 32; i++) {
237 if (input_tuple[j] & (1 << (31 - i))) {
238 ret ^= ((
const uint32_t *)rss_key)[j] << i |
239 (uint32_t)((uint64_t)(((
const uint32_t *)rss_key)[j + 1]) >> (32 - i));