Skip to content

Commit e6d08d7

Browse files
author
Paolo Abeni
committed
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/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents 5bdaf36 + a16909a commit e6d08d7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

net/netfilter/nft_set_pipapo_avx2.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,8 +1139,14 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
11391139
bool map_index;
11401140
int i, ret = 0;
11411141

1142-
if (unlikely(!irq_fpu_usable()))
1143-
return nft_pipapo_lookup(net, set, key, ext);
1142+
local_bh_disable();
1143+
1144+
if (unlikely(!irq_fpu_usable())) {
1145+
bool fallback_res = nft_pipapo_lookup(net, set, key, ext);
1146+
1147+
local_bh_enable();
1148+
return fallback_res;
1149+
}
11441150

11451151
m = rcu_dereference(priv->match);
11461152

@@ -1155,6 +1161,7 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
11551161
scratch = *raw_cpu_ptr(m->scratch);
11561162
if (unlikely(!scratch)) {
11571163
kernel_fpu_end();
1164+
local_bh_enable();
11581165
return false;
11591166
}
11601167

@@ -1235,6 +1242,7 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
12351242
if (i % 2)
12361243
scratch->map_index = !map_index;
12371244
kernel_fpu_end();
1245+
local_bh_enable();
12381246

12391247
return ret >= 0;
12401248
}

0 commit comments

Comments
 (0)