From ad981b6c7a62709756be04a895a279d6aa5cab18 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Thu, 14 Apr 2016 17:02:35 +0100 Subject: [PATCH] i40e: require SSE4.1 support for vector driver Later commits to improve the driver will make use of the SSE4.1 _mm_blend_epi16 intrinsic, so: * set the compilation level to always have SSE4.1 support, * and add in a runtime check for SSE4.1 as part of the condition checks for vector driver selection. Signed-off-by: Bruce Richardson Acked-by: Zhe Tao --- drivers/net/i40e/Makefile | 6 ++++++ drivers/net/i40e/i40e_rxtx_vec.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile index 6dd6eaab78..56b20d58aa 100644 --- a/drivers/net/i40e/Makefile +++ b/drivers/net/i40e/Makefile @@ -102,6 +102,12 @@ SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_ethdev_vf.c SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_pf.c SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_fdir.c +# vector PMD driver needs SSE4.1 support +ifeq ($(findstring RTE_MACHINE_CPUFLAG_SSE4_1,$(CFLAGS)),) +CFLAGS_i40e_rxtx_vec.o += -msse4.1 +endif + + # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += lib/librte_eal lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += lib/librte_mempool lib/librte_mbuf diff --git a/drivers/net/i40e/i40e_rxtx_vec.c b/drivers/net/i40e/i40e_rxtx_vec.c index 047aff5349..1e2fadddc2 100644 --- a/drivers/net/i40e/i40e_rxtx_vec.c +++ b/drivers/net/i40e/i40e_rxtx_vec.c @@ -751,6 +751,10 @@ i40e_rx_vec_dev_conf_condition_check(struct rte_eth_dev *dev) struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode; struct rte_fdir_conf *fconf = &dev->data->dev_conf.fdir_conf; + /* need SSE4.1 support */ + if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1)) + return -1; + #ifndef RTE_LIBRTE_I40E_RX_OLFLAGS_ENABLE /* whithout rx ol_flags, no VP flag report */ if (rxmode->hw_vlan_strip != 0 || -- 2.20.1