summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2020-02-14 20:14:14 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2020-02-19 00:07:09 +0300
commit9a7712048f9d43da5022e75eca3d6b81080e76d3 (patch)
tree81a504947b2cf86d20f53c370422d2d1b94f9d62 /net
parentbd97ad51a7eb1b02049deca56bc26d96cabbac8a (diff)
downloadlinux-9a7712048f9d43da5022e75eca3d6b81080e76d3.tar.xz
netfilter: nft_set_pipapo: Don't abuse unlikely() in pipapo_refill()
I originally used unlikely() in the if (match_only) clause, which we hit on the mapping table for the last field in a set, to ensure we avoid branching to the rest of for loop body, which is executed more frequently. However, Pablo reports, this is confusing as it gives the impression that this is not a common case, and it's actually not the intended usage of unlikely(). I couldn't observe any statistical difference in matching rates on x864_64 and aarch64 without it, so just drop it. Reported-by: Pablo Neira Ayuso <pablo@netfilter.org> Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges") Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nft_set_pipapo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c
index 579600b39f39..feac8553f6d9 100644
--- a/net/netfilter/nft_set_pipapo.c
+++ b/net/netfilter/nft_set_pipapo.c
@@ -503,7 +503,7 @@ static int pipapo_refill(unsigned long *map, int len, int rules,
return -1;
}
- if (unlikely(match_only)) {
+ if (match_only) {
bitmap_clear(map, i, 1);
return i;
}