netfilter: nft_set_pipapo: remove redundant test for avx feature bit
Subsystems (2)
Florian Westphal
maintainerPATCH 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.
Reported-by Sebastian Andrzej Siewior <[email protected]>
Cc Stefano Brivio <[email protected]>
Signed-off-by Florian Westphal <[email protected]>
--- 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
@@ -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
@@ -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
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()inarch/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.
Reported-by Sebastian Andrzej Siewior <[email protected]>Cc Stefano Brivio <[email protected]>Signed-off-by Florian Westphal <[email protected]>
With or without a minor nit reported below:
Reviewed-by Stefano Brivio <[email protected]>
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
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