nft_pipapo_avx2_lookup_4b_2(9)
π nft_pipapo_avx2_lookup_4b_2 β from the Kernel API Manual (yes bestie, we're in the kernel docs now β¨)
okay so picture this: you're deep in the netfilter guts, AVX2 registers are humming, and this little icon is the one doing the 2-four-bit-group lookups. no cap, she's niche, but she eats. π
β¨ NAME β¨
nft_pipapo_avx2_lookup_4b_2 β the AVX2-based lookup for 2 four-bit groups, periodt. π
π¦ SYNOPSIS π¦
int nft_pipapo_avx2_lookup_4b_2 (unsigned long *map , unsigned long
*fill , const struct nft_pipapo_field *f , int offset , const u8 *pkt ,
bool first , bool last );
πΈ ARGUMENTS πΈ
like, every single one, because we don't skip π
mapβ the previous match result, used as the initial bitmap. it's the receipts from last time, basically.fillβ the destination bitmap that gets filled with the current match result. main character of the output, lowkey.fβ the field, holding the lookup and mapping tables. she's got the lore.offsetβ ignore buckets before this index; no bits are filled there. respectfully, everything before it is not invited to the function. πpktβ the packet data, a pointer to the input nftables register. the raw tea itself.firstβ if this is the first field, don't source the previous result. fresh start energy β¨lastβ last field: stop at the first match and return that bit index. wrap it up, we're done here π₯
π DESCRIPTION π
so here's the vibe: you load buckets from the lookup table corresponding to the values of each 4-bit group of packet bytes, and then you do a bitwise intersection between them. that's it, that's the whole personality. π§
if this is the first field in the set, you simply AND the buckets together β which is literally equivalent to using an all-ones starting bitmap, iykyk β and otherwise you use the provided starting bitmap. then you call nft_pipapo_avx2_refill to generate the next working bitmap, fill. slay, pipeline complete. π«Ά
this one is used for 8-bit fields (i.e. protocol numbers). yes, 4b_2 serving the 8-bit fields, don't ask, it's giving family dynamics π
β οΈ okay this part is important bestie: out-of-order (and superscalar) execution is vital here, so it's critical to avoid false data dependencies. the CPU and compiler could (mostly) take care of this on their own β but the operation ordering is explicitly given here with a likely execution order in mind, specifically to highlight possible stalls. that's why a number of logically distinct operations (i.e. loading buckets, intersecting buckets) are interleaved. it's choreography, not chaos. π
π RETURN π
-1on no match π«- the rule index of the match if
lastπ - otherwise, the first long word index to be checked next (i.e. the first filled word) β
π SEE ALSO π
kernel file ./net/netfilter/nft_set_pipapo_avx2.c β go read her, she's iconic:
nft_pipapo_avx2_prepare(9)nft_pipapo_avx2_fill(9)nft_pipapo_avx2_refill(9)nft_pipapo_avx2_lookup_4b_4(9)nft_pipapo_avx2_lookup_4b_8(9)nft_pipapo_avx2_lookup_4b_12(9)nft_pipapo_avx2_lookup_4b_32(9)nft_pipapo_avx2_lookup_8b_1(9)nft_pipapo_avx2_lookup_8b_2(9)nft_pipapo_avx2_lookup_8b_4(9)nft_pipapo_avx2_lookup_8b_6(9)nft_pipapo_avx2_lookup_8b_16(9)nft_pipapo_avx2_lookup_slow(9)nft_pipapo_avx2_estimate(9)pipapo_resmap_init_avx2(9)pipapo_get_avx2(9)nft_pipapo_avx2_lookup(9)
the whole friend group, honestly. π
and that's the page, bestie π came out of ./net/netfilter, dated October 2026 β go forth and look up those four-bit groups, you absolute legend π¦β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms