From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 64811B367 for ; Wed, 30 Jul 2014 16:48:15 +0200 (CEST) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1XCVCd-0006o3-8m; Wed, 30 Jul 2014 10:50:09 -0400 From: Neil Horman To: dev@dpdk.org Date: Wed, 30 Jul 2014 10:49:28 -0400 Message-Id: <1406731769-18523-2-git-send-email-nhorman@tuxdriver.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1406731769-18523-1-git-send-email-nhorman@tuxdriver.com> References: <1406665466-29654-1-git-send-email-nhorman@tuxdriver.com> <1406731769-18523-1-git-send-email-nhorman@tuxdriver.com> X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: [dpdk-dev] [PATCH v2 1/2] ixgbe: test sse4.2 support at runtime for vectorized receive operations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 14:48:15 -0000 The ixgbe vector receive code uses the sse4.2 intrinsics directly. Instead of requiring that they be enabled at build time for the entire dpdk library, just enable sse4.2 for the ixgbe_rxtx_vec.c file, and test for support at runtime when using it Signed-off-by: Neil Horman CC: Thomas Monjalon --- lib/librte_pmd_ixgbe/Makefile | 6 ++++++ lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile index 00ccedb..c002239 100644 --- a/lib/librte_pmd_ixgbe/Makefile +++ b/lib/librte_pmd_ixgbe/Makefile @@ -39,6 +39,12 @@ LIB = librte_pmd_ixgbe.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +# +# the vectorized recieve functions need sse4.2 instruction +# intrinsics, make sure we emit them from the compiler +# +CFLAGS_ixgbe_rxtx_vec.o += -msse4.2 + ifeq ($(CC), icc) # # CFLAGS for icc diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c index 09e19a3..18e8bfe 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "ixgbe_ethdev.h" #include "ixgbe_rxtx.h" @@ -679,6 +680,10 @@ int ixgbe_rx_vec_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; + if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_2)) { + RTE_LOG(ERR, PMD, "ixgbe vector rx needs sse4.2!\n"); + return -1; + } #ifndef RTE_IXGBE_RX_OLFLAGS_ENABLE /* whithout rx ol_flags, no VP flag report */ if (rxmode->hw_vlan_strip != 0 || -- 1.8.3.1