Merge tag 'nf-24-07-24' of git://git.kernel.org/pub/scm/linux/kernel/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/20240724081305.3152-1-pablo@netfilter.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Paolo Abeni
2024-07-25 11:17:21 +02:00

View File

@ -1139,8 +1139,14 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
bool map_index; bool map_index;
int i, ret = 0; int i, ret = 0;
if (unlikely(!irq_fpu_usable())) local_bh_disable();
return nft_pipapo_lookup(net, set, key, ext);
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); m = rcu_dereference(priv->match);
@ -1155,6 +1161,7 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
scratch = *raw_cpu_ptr(m->scratch); scratch = *raw_cpu_ptr(m->scratch);
if (unlikely(!scratch)) { if (unlikely(!scratch)) {
kernel_fpu_end(); kernel_fpu_end();
local_bh_enable();
return false; return false;
} }
@ -1235,6 +1242,7 @@ out:
if (i % 2) if (i % 2)
scratch->map_index = !map_index; scratch->map_index = !map_index;
kernel_fpu_end(); kernel_fpu_end();
local_bh_enable();
return ret >= 0; return ret >= 0;
} }