* This is an alternative implementation of pipapo_refill() suitable for usage
* with AVX2 lookup routines: we know there are four words to be scanned, at
* a given offset inside the map, for each matching iteration.
+ * The caller must ensure at least one bit in the four words is set.
*
* This function doesn't actually use any AVX2 instruction.
*
NFT_PIPAPO_AVX2_REFILL_ONE_WORD(3);
#undef NFT_PIPAPO_AVX2_REFILL_ONE_WORD
+ DEBUG_NET_WARN_ON_ONCE(ret < 0);
return ret;
}
b = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);
if (last)
ret = b;
-
- if (unlikely(ret == -1))
+ else if (unlikely(ret == -1))
ret = b / XSAVE_YMM_SIZE;
continue;
b = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);
if (last)
ret = b;
-
- if (unlikely(ret == -1))
+ else if (unlikely(ret == -1))
ret = b / XSAVE_YMM_SIZE;
continue;
b = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);
if (last)
ret = b;
-
- if (unlikely(ret == -1))
+ else if (unlikely(ret == -1))
ret = b / XSAVE_YMM_SIZE;
continue;
b = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);
if (last)
ret = b;
-
- if (unlikely(ret == -1))
+ else if (unlikely(ret == -1))
ret = b / XSAVE_YMM_SIZE;
continue;
b = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);
if (last)
ret = b;
-
- if (unlikely(ret == -1))
+ else if (unlikely(ret == -1))
ret = b / XSAVE_YMM_SIZE;
continue;
b = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);
if (last)
ret = b;
-
- if (unlikely(ret == -1))
+ else if (unlikely(ret == -1))
ret = b / XSAVE_YMM_SIZE;
continue;
b = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);
if (last)
ret = b;
-
- if (unlikely(ret == -1))
+ else if (unlikely(ret == -1))
ret = b / XSAVE_YMM_SIZE;
continue;
b = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);
if (last)
ret = b;
-
- if (unlikely(ret == -1))
+ else if (unlikely(ret == -1))
ret = b / XSAVE_YMM_SIZE;
continue;
b = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);
if (last)
ret = b;
-
- if (unlikely(ret == -1))
+ else if (unlikely(ret == -1))
ret = b / XSAVE_YMM_SIZE;
continue;
b = nft_pipapo_avx2_refill(i_ul, &map[i_ul], fill, f->mt, last);
if (last)
ret = b;
-
- if (unlikely(ret == -1))
+ else if (unlikely(ret == -1))
ret = b / XSAVE_YMM_SIZE;
continue;
const struct nft_pipapo_field *f;
unsigned long *res, *fill, *map;
bool map_index;
+ int ret = 0;
int i;
scratch = *raw_cpu_ptr(m->scratch);
nft_pipapo_for_each_field(f, i, m) {
bool last = i == m->field_count - 1, first = !i;
- int ret = 0;
+ /* NB: previous round @ret is passed to avx2 lookup fn */
#define NFT_SET_PIPAPO_AVX2_LOOKUP(b, n) \
(ret = nft_pipapo_avx2_lookup_##b##b_##n(res, fill, f, \
ret, data, \