summaryrefslogtreecommitdiff
path: root/drivers/net/iavf/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/iavf/Makefile')
-rw-r--r--drivers/net/iavf/Makefile23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/iavf/Makefile b/drivers/net/iavf/Makefile
index cd74e14..d3f9972 100644
--- a/drivers/net/iavf/Makefile
+++ b/drivers/net/iavf/Makefile
@@ -45,7 +45,28 @@ SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_ethdev.c
SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_vchnl.c
SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_rxtx.c
ifeq ($(CONFIG_RTE_ARCH_X86), y)
-SRCS-$(CONFIG_RTE_LIBRTE_IAVF_INC_VECTOR) += iavf_rxtx_vec_sse.c
+SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_rxtx_vec_sse.c
+endif
+
+ifeq ($(CONFIG_RTE_LIBRTE_IAVF_PMD), y)
+ ifeq ($(findstring RTE_MACHINE_CPUFLAG_AVX2,$(CFLAGS)),RTE_MACHINE_CPUFLAG_AVX2)
+ CC_AVX2_SUPPORT=1
+ else
+ CC_AVX2_SUPPORT=\
+ $(shell $(CC) -march=core-avx2 -dM -E - </dev/null 2>&1 | \
+ grep -q AVX2 && echo 1)
+ ifeq ($(CC_AVX2_SUPPORT), 1)
+ ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
+ CFLAGS_iavf_rxtx_vec_avx2.o += -march=core-avx2
+ else
+ CFLAGS_iavf_rxtx_vec_avx2.o += -mavx2
+ endif
+ endif
+ endif
+endif
+
+ifeq ($(CC_AVX2_SUPPORT), 1)
+ SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_rxtx_vec_avx2.c
endif
include $(RTE_SDK)/mk/rte.lib.mk