Commit e6d08d7e authored by Paolo Abeni's avatar Paolo Abeni
Browse files
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: default avatarPaolo Abeni <pabeni@redhat.com>
parents 5bdaf362 a16909ae
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -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);

@@ -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;
	}

@@ -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;
}