Commit e6d08d7e authored by Paolo Abeni's avatar Paolo Abeni

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.orgSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents 5bdaf362 a16909ae
...@@ -1139,8 +1139,14 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set, ...@@ -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, ...@@ -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 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set, ...@@ -1235,6 +1242,7 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
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;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment