From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 6C17958DB for ; Wed, 2 Dec 2015 03:10:07 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 01 Dec 2015 18:10:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,371,1444719600"; d="scan'208";a="862665093" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 01 Dec 2015 18:10:05 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id tB22A2Jx011222; Wed, 2 Dec 2015 10:10:02 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id tB229xwJ025545; Wed, 2 Dec 2015 10:10:01 +0800 Received: (from dayuqiu@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id tB229tPW025541; Wed, 2 Dec 2015 10:09:55 +0800 From: Michael Qiu To: dev@dpdk.org Date: Wed, 2 Dec 2015 10:09:54 +0800 Message-Id: <1449022194-25510-1-git-send-email-michael.qiu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1448534997-24297-1-git-send-email-michael.qiu@intel.com> References: <1448534997-24297-1-git-send-email-michael.qiu@intel.com> Subject: [dpdk-dev] [PATCH v2] lib/librte_sched: Fix compile with gcc 4.3.4 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, 02 Dec 2015 02:10:07 -0000 gcc 4.3.4 does not include "immintrin.h", and will post below error: lib/librte_sched/rte_sched.c:56:23: error: immintrin.h: No such file or directory To avoid this issue, a gcc version check is need and a flag to indicate vector ablility. Fixes: 42ec27a0178a ("sched: enable SSE optimizations in config") Signed-off-by: Michael Qiu --- v2 --> v1: include header file rte_vect.h instead of gcc version check change __AVX__ to __SSE2__ since all vector function are SSE2 related. lib/librte_sched/rte_sched.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c index d47cfc2..0d46618 100644 --- a/lib/librte_sched/rte_sched.c +++ b/lib/librte_sched/rte_sched.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "rte_sched.h" #include "rte_bitmap.h" @@ -53,7 +54,11 @@ #endif #ifdef RTE_SCHED_VECTOR -#include + +#if defined(__SSE2__) +#define SCHED_VECTOR_ENABLE +#endif + #endif #define RTE_SCHED_TB_RATE_CONFIG_ERR (1e-7) @@ -1667,7 +1672,7 @@ grinder_schedule(struct rte_sched_port *port, uint32_t pos) return 1; } -#ifdef RTE_SCHED_VECTOR +#ifdef SCHED_VECTOR_ENABLE static inline int grinder_pipe_exists(struct rte_sched_port *port, uint32_t base_pipe) -- 1.9.3