pipapo_lt_8b_to_4b(9)
β¨ NAME β¨
pipapo_lt_8b_to_4b β bestie, this is the glow-up function that switches your lookup table group width from 8 bits to 4 bits π
(yeah, we're doing a whole wardrobe change on the lookup table, it's giving makeover episode)
Quick vibe check: we're deep in the kernel API manual, the pipapo corner of the universe, so you know it's the nftables set-matching lore π§
πΈ SYNOPSIS πΈ
void pipapo_lt_8b_to_4b(int old_groups, int bsize, unsigned long *old_lt, unsigned long *new_lt);
π ARGUMENTS π
old_groupsβ the number of groups you've got right now, like the headcount before the remix β¨bsizeβ size of one bucket, measured in longs (yes, longs, not vibes, keep up π«Ά)old_ltβ pointer to the current lookup table, the O.G. πnew_ltβ pointer to the new lookup table, which you already pre-allocated yourself, no cap, that part is on you π
π¦ DESCRIPTION π¦
Okay so here's the tea β. Every bucket with index b in the new lookup table, the one that belongs to group g, gets filled up with the bit union of these two things:
- literally all the buckets whose index is such that the upper four bits of the lower byte equal
b, taken from groupg, wheregis odd π - literally all the buckets whose index is such that the lower four bits equal
b, taken from groupg, wheregis even πΈ
So like, if you think about buckets from the new lookup table N(x, y) and the old lookup table O(x, y), where x is the bucket index and y is the group index, then:
- when
gis odd:N(b, g) := U(O(x, g) for each x : x = (b & 0xf0) >> 4) - when
gis even:N(b, g) := U(O(x, g) for each x : x = b & 0x0f)
where U is the arbitrary union operation (that's the binary OR of n terms, for the uninitiated π§ β¨). And the whole point of this little maneuver? It ensures equivalence of the matching results on lookup. Periodt. That's the guarantee, and it ate π₯
π SEE ALSO π
The main character file is ./net/netfilter/nft_set_pipapo.c and its buddy Theory of Operation(9), plus the whole extended friend group β every single one of them, no gatekeeping here π«Ά:
pipapo_refill(9)pipapo_get_slow(9)pipapo_get(9)nft_pipapo_lookup(9)nft_pipapo_get(9)pipapo_realloc_mt(9)lt_calculate_size(9)pipapo_resize(9)pipapo_bucket_set(9)pipapo_lt_4b_to_8b(9)pipapo_lt_bits_adjust(9)pipapo_insert(9)pipapo_step_diff(9)pipapo_step_after_end(9)pipapo_base_sum(9)pipapo_expand(9)pipapo_map(9)pipapo_free_scratch(9)pipapo_realloc_scratch(9)pipapo_maybe_clone(9)nft_pipapo_insert(9)pipapo_clone(9)pipapo_rules_same_key(9)pipapo_unmap(9)pipapo_drop(9)pipapo_gc_scan(9)pipapo_gc_queue(9)pipapo_free_fields(9)pipapo_reclaim_match(9)nft_pipapo_commit(9)nft_pipapo_activate(9)nft_pipapo_deactivate(9)nft_pipapo_flush(9)pipapo_get_boundaries(9)pipapo_match_field(9)nft_pipapo_remove(9)nft_pipapo_do_walk(9)nft_pipapo_walk(9)nft_pipapo_privsize(9)nft_pipapo_estimate(9)nft_pipapo_init(9)nft_set_pipapo_match_destroy(9)nft_pipapo_destroy(9)nft_pipapo_gc_init(9)
β¨ mwah π that's the whole page bestie β¨
Source lives at ./net/netfilter and this lil masterpiece was stamped October 2026 β screenshot it, cite it, tell your friends, iykyk πππ¦
π¦ 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