Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [91.216.245.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98B1A30649C; Tue, 2 Sep 2025 13:36:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.216.245.30 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756820179; cv=none; b=WjQmySEijMMeUN9njNTPIJvo1t5tCEyjjKK4RlgAkifMYJkurTDdPOwL/EzWwsUkPco61G3qgFo2ij/8hW0dkL7TyiW51AM5yKhxYUTpa1jfH0sCgD7fWbiQojjEcs23GH3kXRsl56p+fAme2LdZJgaqyq+R+wjnvvVjXq7qLYQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756820179; c=relaxed/simple; bh=C5FJACMj8Tl46ZtgGXrVraHENJmLhdCgWGnpMB4l3ag=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=okOhyKiRqc7u4eDCnq+0sSL1tPGiQj38Pqn3Fq+DKG9zfLhL4vBvXza6vEDxzph44aIRL3P32D/7UMCnQ1XNORCRkF1VPFDzu2tWmTGYrshKW+5HMJtUvRNTbICV57bra9KsDIfduZAGJiMPQ+Jc0KI7M2eMmPW5dZedE5CBMDQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de; spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc; arc=none smtp.client-ip=91.216.245.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc Received: by Chamillionaire.breakpoint.cc (Postfix, from userid 1003) id CE57260298; Tue, 2 Sep 2025 15:36:15 +0200 (CEST) From: Florian Westphal To: Cc: Paolo Abeni , "David S. Miller" , Eric Dumazet , Jakub Kicinski , , pablo@netfilter.org Subject: [PATCH v2 net-next 5/7] netfilter: nft_set_pipapo: remove redundant test for avx feature bit Date: Tue, 2 Sep 2025 15:35:47 +0200 Message-ID: <20250902133549.15945-6-fw@strlen.de> X-Mailer: git-send-email 2.49.1 In-Reply-To: <20250902133549.15945-1-fw@strlen.de> References: <20250902133549.15945-1-fw@strlen.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Stefano Brivio Signed-off-by: Florian Westphal --- net/netfilter/nft_set_pipapo.c | 3 +-- net/netfilter/nft_set_pipapo_avx2.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c index b385cfcf886f..4b64c3bd8e70 100644 --- a/net/netfilter/nft_set_pipapo.c +++ b/net/netfilter/nft_set_pipapo.c @@ -530,8 +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) && - irq_fpu_usable()) { + if (boot_cpu_has(X86_FEATURE_AVX2) && irq_fpu_usable()) { e = pipapo_get_avx2(m, data, genmask, tstamp); local_bh_enable(); return e; diff --git a/net/netfilter/nft_set_pipapo_avx2.c b/net/netfilter/nft_set_pipapo_avx2.c index 29326f3fcaf3..7559306d0aed 100644 --- a/net/netfilter/nft_set_pipapo_avx2.c +++ b/net/netfilter/nft_set_pipapo_avx2.c @@ -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); -- 2.49.1