Skip to content

Commit

Permalink
Merge tag 'nf-24-07-24' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/netfilter/nf

Pablo Neira Ayuso says:

====================
Netfilter fixes for net

The following patchset contains a Netfilter fix for net:

Patch #1 if FPU is busy, then pipapo set backend falls back to standard
         set element lookup. Moreover, disable bh while at this.
	 From Florian Westphal.

netfilter pull request 24-07-24

* tag 'nf-24-07-24' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf:
  netfilter: nft_set_pipapo_avx2: disable softinterrupts
====================

Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
Paolo Abeni committed Jul 25, 2024
2 parents 5bdaf36 + a16909a commit e6d08d7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions net/netfilter/nft_set_pipapo_avx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,14 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
bool map_index;
int i, ret = 0;

if (unlikely(!irq_fpu_usable()))
return nft_pipapo_lookup(net, set, key, ext);
local_bh_disable();

if (unlikely(!irq_fpu_usable())) {
bool fallback_res = nft_pipapo_lookup(net, set, key, ext);

local_bh_enable();
return fallback_res;
}

m = rcu_dereference(priv->match);

Expand All @@ -1155,6 +1161,7 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
scratch = *raw_cpu_ptr(m->scratch);
if (unlikely(!scratch)) {
kernel_fpu_end();
local_bh_enable();
return false;
}

Expand Down Expand Up @@ -1235,6 +1242,7 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
if (i % 2)
scratch->map_index = !map_index;
kernel_fpu_end();
local_bh_enable();

return ret >= 0;
}

0 comments on commit e6d08d7

Please sign in to comment.