Skip to contentSkip to conversation

netfilter: nft_set_pipapo: remove redundant test for avx feature bit

PATCH In review Florian Westphal 2 participants 2 messages Aug 28, 2025 – Aug 29, 2025

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: nft_set_pipapo: remove redundant test for avx feature bit

Sebastian points out that avx2 depends on avx, see check_cpufeature_deps() in arch/x86/kernel/cpu/cpuid-deps.c:
avx2 feature bit will be cleared when avx isn't available.

No functional change intended.

---
 net/netfilter/nft_set_pipapo.c      | 2 +-
 net/netfilter/nft_set_pipapo_avx2.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nft_set_pipapo.c +1 -1
index b385cfcf886f..415be47e0407 100644
@@ -530,7 +530,7 @@ static struct nft_pipapo_elem *pipapo_get(const struct nft_pipapo_match *m,
 	local_bh_disable();
 
 #if defined(CONFIG_X86_64) && !defined(CONFIG_UML)
-	if (boot_cpu_has(X86_FEATURE_AVX2) && boot_cpu_has(X86_FEATURE_AVX) &&
+	if (boot_cpu_has(X86_FEATURE_AVX2) &&
 	    irq_fpu_usable()) {
 		e = pipapo_get_avx2(m, data, genmask, tstamp);
 		local_bh_enable();
net/netfilter/nft_set_pipapo_avx2.c +1 -1
index 29326f3fcaf3..7559306d0aed 100644
@@ -1099,7 +1099,7 @@ bool nft_pipapo_avx2_estimate(const struct nft_set_desc *desc, u32 features,
 	    desc->field_count < NFT_PIPAPO_MIN_FIELDS)
 		return false;
 
-	if (!boot_cpu_has(X86_FEATURE_AVX2) || !boot_cpu_has(X86_FEATURE_AVX))
+	if (!boot_cpu_has(X86_FEATURE_AVX2))
 		return false;
 
 	est->size = pipapo_estimate_size(desc);
Signature · 1 line
2.49.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · On Fri, 29 Aug 2025 01:50:05 +0200 Florian Westphal <[email protected]> wrote:

Sebastian points out that avx2 depends on avx, see check_cpufeature_deps() in arch/x86/kernel/cpu/cpuid-deps.c:
avx2 feature bit will be cleared when avx isn't available.

Oops, I didn't notice.

Quoted 5 lines

No functional change intended.

With or without a minor nit reported below:

Quoted 10 lines
---
 net/netfilter/nft_set_pipapo.c      | 2 +-
 net/netfilter/nft_set_pipapo_avx2.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nft_set_pipapo.c +0 -0
index b385cfcf886f..415be47e0407 100644

net/netfilter/nft_set_pipapo.c static struct nft_pipapo_elem *pipapo_get(const struct nft_pipapo_match *m, · line 534

Quoted 6 lines
net/netfilter/nft_set_pipapo.c +1 -1
@@ -530,7 +530,7 @@ static struct nft_pipapo_elem *pipapo_get(const struct nft_pipapo_match *m,
 	local_bh_disable();
 
 #if defined(CONFIG_X86_64) && !defined(CONFIG_UML)
-	if (boot_cpu_has(X86_FEATURE_AVX2) && boot_cpu_has(X86_FEATURE_AVX) &&
+	if (boot_cpu_has(X86_FEATURE_AVX2) &&
 	    irq_fpu_usable()) {

...this could be a single line now.

Signature · 1 line
Stefano