nft_set_pipapo: Generalise group size for buckets
authorStefano Brivio <sbrivio@redhat.com>
Sat, 7 Mar 2020 16:52:32 +0000 (17:52 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 15 Mar 2020 14:27:42 +0000 (15:27 +0100)
commite807b13cb3e3bcf0f602cb5ef66f7a1988d0e703
treeb9cb6d4b3f692ad23eadbdca7149e8b2320fee04
parent88bf6e4114d5af685c11c02ce95efa7c7494e940
nft_set_pipapo: Generalise group size for buckets

Get rid of all hardcoded assumptions that buckets in lookup tables
correspond to four-bit groups, and replace them with appropriate
calculations based on a variable group size, now stored in struct
field.

The group size could now be in principle any divisor of eight. Note,
though, that lookup and get functions need an implementation
intimately depending on the group size, and the only supported size
there, currently, is four bits, which is also the initial and only
used size at the moment.

While at it, drop 'groups' from struct nft_pipapo: it was never used.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_set_pipapo.c