netfilter: nft_set_pipapo: increment data in one step
Since commit e807b13cb3 ("nft_set_pipapo: Generalise group size for buckets")
there is no longer a need to increment the data pointer in two steps.
Switch to a single invocation of NFT_PIPAPO_GROUPS_PADDED_SIZE() helper,
like the avx2 implementation.
[ Stefano: Improve commit message ]
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
master
parent
8e57338c36
commit
04e1ca21a5
|
|
@ -452,8 +452,6 @@ static struct nft_pipapo_elem *pipapo_get_slow(const struct nft_pipapo_match *m,
|
|||
pipapo_and_field_buckets_4bit(f, res_map, data);
|
||||
NFT_PIPAPO_GROUP_BITS_ARE_8_OR_4;
|
||||
|
||||
data += f->groups / NFT_PIPAPO_GROUPS_PER_BYTE(f);
|
||||
|
||||
/* Now populate the bitmap for the next field, unless this is
|
||||
* the last field, in which case return the matched 'ext'
|
||||
* pointer if any.
|
||||
|
|
@ -498,7 +496,7 @@ next_match:
|
|||
map_index = !map_index;
|
||||
swap(res_map, fill_map);
|
||||
|
||||
data += NFT_PIPAPO_GROUPS_PADDING(f);
|
||||
data += NFT_PIPAPO_GROUPS_PADDED_SIZE(f);
|
||||
}
|
||||
|
||||
__local_unlock_nested_bh(&scratch->bh_lock);
|
||||
|
|
|
|||
|
|
@ -42,9 +42,6 @@
|
|||
/* Fields are padded to 32 bits in input registers */
|
||||
#define NFT_PIPAPO_GROUPS_PADDED_SIZE(f) \
|
||||
(round_up((f)->groups / NFT_PIPAPO_GROUPS_PER_BYTE(f), sizeof(u32)))
|
||||
#define NFT_PIPAPO_GROUPS_PADDING(f) \
|
||||
(NFT_PIPAPO_GROUPS_PADDED_SIZE(f) - (f)->groups / \
|
||||
NFT_PIPAPO_GROUPS_PER_BYTE(f))
|
||||
|
||||
/* Number of buckets given by 2 ^ n, with n bucket bits */
|
||||
#define NFT_PIPAPO_BUCKETS(bb) (1 << (bb))
|
||||
|
|
|
|||
Loading…
Reference in New Issue