[dpdk-dev] efd: fix build when compiler does not support AVX2

Message ID 20171013182421.13473-1-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Ferruh Yigit Oct. 13, 2017, 6:24 p.m. UTC
  Compiler error:
irte_efd.o: In function `rte_efd_lookup':
rte_efd.c:(.text+0x6d6e): undefined reference to `efd_lookup_internal_avx2'
rte_efd.o: In function `rte_efd_lookup_bulk':
rte_efd.c:(.text+0x87d4): undefined reference to `efd_lookup_internal_avx2'

This can be observed with a compiler that doesn't support AVX2 and
shared build.

Fixes: 86d898968826 ("efd: add AVX2 vector lookup function")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_efd/rte_efd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Oct. 13, 2017, 8:07 p.m. UTC | #1
13/10/2017 20:24, Ferruh Yigit:
> Compiler error:
> irte_efd.o: In function `rte_efd_lookup':
> rte_efd.c:(.text+0x6d6e): undefined reference to `efd_lookup_internal_avx2'
> rte_efd.o: In function `rte_efd_lookup_bulk':
> rte_efd.c:(.text+0x87d4): undefined reference to `efd_lookup_internal_avx2'
> 
> This can be observed with a compiler that doesn't support AVX2 and
> shared build.
> 
> Fixes: 86d898968826 ("efd: add AVX2 vector lookup function")
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c
index 4d9a08876..ba9f0d83c 100644
--- a/lib/librte_efd/rte_efd.c
+++ b/lib/librte_efd/rte_efd.c
@@ -1278,7 +1278,7 @@  efd_lookup_internal(const struct efd_online_group_entry * const group,
 
 	switch (lookup_fn) {
 
-#if defined(RTE_ARCH_X86)
+#if defined(RTE_ARCH_X86) && defined(CC_SUPPORT_AVX2)
 	case EFD_LOOKUP_AVX2:
 		return efd_lookup_internal_avx2(group->hash_idx,
 					group->lookup_table,