eal: fix undeclared function error on old CPUs

Message ID 1736871673-25398-1-git-send-email-andremue@linux.microsoft.com (mailing list archive)
State Accepted
Delegated to: David Marchand
Headers
Series eal: fix undeclared function error on old CPUs |

Checks

Context Check Description
ci/loongarch-compilation success Compilation OK
ci/checkpatch success coding style OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS

Commit Message

Andre Muezerie Jan. 14, 2025, 4:21 p.m. UTC
Error reported:
../lib/net/net_crc_sse.c:49:17: error: call to undeclared function
'_mm_clmulepi64_si128'; ISO C99 and later do not support implicit
function declarations [-Wimplicit-function-declaration]

The fix is to remove the unnecessary ifdef around the inclusion of
header file immintrin.h. This header also contains functions that do
not require AVX instructions, so should not be included only when AVX
is available.

Bugzilla ID: 1595
Fixes: da826b7135a4 ("eal: introduce ymm type for AVX 256-bit")
Cc: stable@dpdk.org

Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
 lib/eal/x86/include/rte_vect.h | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Bruce Richardson Jan. 14, 2025, 4:32 p.m. UTC | #1
On Tue, Jan 14, 2025 at 08:21:13AM -0800, Andre Muezerie wrote:
> Error reported:
> ../lib/net/net_crc_sse.c:49:17: error: call to undeclared function
> '_mm_clmulepi64_si128'; ISO C99 and later do not support implicit
> function declarations [-Wimplicit-function-declaration]
> 
> The fix is to remove the unnecessary ifdef around the inclusion of
> header file immintrin.h. This header also contains functions that do
> not require AVX instructions, so should not be included only when AVX
> is available.
> 
> Bugzilla ID: 1595
> Fixes: da826b7135a4 ("eal: introduce ymm type for AVX 256-bit")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
> ---

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

>  lib/eal/x86/include/rte_vect.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/lib/eal/x86/include/rte_vect.h b/lib/eal/x86/include/rte_vect.h
> index 5ac3ccfd82..5fdcd632ac 100644
> --- a/lib/eal/x86/include/rte_vect.h
> +++ b/lib/eal/x86/include/rte_vect.h
> @@ -19,9 +19,7 @@
>  
>  #if defined(__ICC) || defined(_WIN64)
>  #include <smmintrin.h> /* SSE4 */
> -#if defined(__AVX__)
>  #include <immintrin.h>
> -#endif
>  #else
>  #include <x86intrin.h>
>  #endif
> -- 
> 2.47.0.vfs.0.3
>
  
David Marchand Jan. 23, 2025, 1:13 p.m. UTC | #2
On Tue, Jan 14, 2025 at 5:33 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Tue, Jan 14, 2025 at 08:21:13AM -0800, Andre Muezerie wrote:
> > Error reported:
> > ../lib/net/net_crc_sse.c:49:17: error: call to undeclared function
> > '_mm_clmulepi64_si128'; ISO C99 and later do not support implicit
> > function declarations [-Wimplicit-function-declaration]
> >
> > The fix is to remove the unnecessary ifdef around the inclusion of
> > header file immintrin.h. This header also contains functions that do
> > not require AVX instructions, so should not be included only when AVX
> > is available.
> >
> > Bugzilla ID: 1595
> > Fixes: da826b7135a4 ("eal: introduce ymm type for AVX 256-bit")
> > Cc: stable@dpdk.org
> >

Reported-by: Pier Damouny <pdamouny@nvidia.com>
> > Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks Andre.
  

Patch

diff --git a/lib/eal/x86/include/rte_vect.h b/lib/eal/x86/include/rte_vect.h
index 5ac3ccfd82..5fdcd632ac 100644
--- a/lib/eal/x86/include/rte_vect.h
+++ b/lib/eal/x86/include/rte_vect.h
@@ -19,9 +19,7 @@ 
 
 #if defined(__ICC) || defined(_WIN64)
 #include <smmintrin.h> /* SSE4 */
-#if defined(__AVX__)
 #include <immintrin.h>
-#endif
 #else
 #include <x86intrin.h>
 #endif