From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 04C90FB00 for ; Wed, 18 Jan 2017 21:45:04 +0100 (CET) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP; 18 Jan 2017 12:45:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,250,1477983600"; d="scan'208";a="54858459" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.38]) ([10.237.220.38]) by fmsmga005.fm.intel.com with ESMTP; 18 Jan 2017 12:45:02 -0800 To: "Mody, Rasesh" , Andrew Rybchenko , "dev@dpdk.org" References: <1369b769-d822-1a3f-e2de-57c3cd211512@solarflare.com> Cc: "Patil, Harish" From: Ferruh Yigit Message-ID: <20af9aa0-1ab3-dc8a-3758-eea48d7f001c@intel.com> Date: Wed, 18 Jan 2017 20:45:02 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] net/qede/base: build is broken on FreeBSD 11.0 with clang 3.8.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 20:45:05 -0000 On 1/18/2017 1:33 AM, Mody, Rasesh wrote: >> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com] >> Sent: Tuesday, January 17, 2017 7:00 AM >> >> Hi, >> >> build is broken for me on FreeBSD 11.0. Just default config and gmake: >> >> == Build drivers/net/qede >> CC base/ecore_dev.o >> CC base/ecore_hw.o >> CC base/ecore_cxt.o >> /tmp/dpdk-next-net/drivers/net/qede/base/ecore_cxt.c:1257:2: error: >> shifting a negative signed value is undefined [-Werror,-Wshift-negative- >> value] >> SET_FIELD(cdu_params, CDUC_NCIB, elems_per_page); >> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> /tmp//dpdk-next-net/drivers/net/qede/base/ecore.h:82:27: note: >> expanded from macro 'SET_FIELD' >> (value) &= ~(name##_MASK << name##_SHIFT); \ >> ~~~~~~~~~~~ ^ >> /tmp/dpdk-next-net/drivers/net/qede/base/ecore_cxt.c:1268:2: error: >> shifting a negative signed value is undefined [-Werror,-Wshift-negative- >> value] >> SET_FIELD(cdu_params, CDUT_TYPE0_CXT_SIZE, (cxt_size >> 3)); >> >> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> ~ >> /tmp/dpdk-next-net/drivers/net/qede/base/ecore.h:82:27: note: >> expanded from macro 'SET_FIELD' >> (value) &= ~(name##_MASK << name##_SHIFT); \ >> ~~~~~~~~~~~ ^ >> /tmp/dpdk-next-net/drivers/net/qede/base/ecore_cxt.c:1280:2: error: >> shifting a negative signed value is undefined [-Werror,-Wshift-negative- >> value] >> SET_FIELD(cdu_params, CDUT_TYPE1_CXT_SIZE, (cxt_size >> 3)); >> >> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> ~ >> /tmp/dpdk-next-net/drivers/net/qede/base/ecore.h:82:27: note: >> expanded from macro 'SET_FIELD' >> (value) &= ~(name##_MASK << name##_SHIFT); \ >> ~~~~~~~~~~~ ^ >> 3 errors generated. >> gmake[5]: *** [/tmp/dpdk-next-net/mk/internal/rte.compile-pre.mk:140: >> base/ecore_cxt.o] Error 1 >> gmake[4]: *** [/tmp/dpdk-next-net/mk/rte.subdir.mk:63: qede] Error 2 >> gmake[3]: *** [/tmp/dpdk-next-net/mk/rte.subdir.mk:63: net] Error 2 >> gmake[2]: *** [/tmp/dpdk-next-net/mk/rte.sdkbuild.mk:80: drivers] Error 2 >> gmake[1]: *** [/tmp/dpdk-next-net/mk/rte.sdkroot.mk:127: all] Error 2 >> gmake: *** [Makefile:12: all] Error 2 >> >> $ clang --version >> FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM >> 3.8.0) >> Target: x86_64-unknown-freebsd11.0 >> Thread model: posix >> InstalledDir: /usr/bin > > We didn’t see these errors reported in our internal testing. > FreeBSD clang version 3.6.1 (tags/RELEASE_361/final 237755) 20150525 > Target: x86_64-unknown-freebsd11.0 > Thread model: posix > > We'll update our FreeBSD clang compiler version to test against 3.8.0. Confirmed the build error with clang 3.8 (clang 3.4 was compiling fine). Something like following is fixing the build: diff --git a/drivers/net/qede/base/ecore_init_fw_funcs.c b/drivers/net/qede/base/ecore_init_fw_funcs.c index a5437b55c..71ff1548a 100644 --- a/drivers/net/qede/base/ecore_init_fw_funcs.c +++ b/drivers/net/qede/base/ecore_init_fw_funcs.c @@ -89,7 +89,7 @@ voq * (PBF_REG_YCMD_QS_NUM_LINES_VOQ1_RT_OFFSET \ #define QM_STOP_CMD_STRUCT_SIZE 2 #define QM_STOP_CMD_PAUSE_MASK_OFFSET 0 #define QM_STOP_CMD_PAUSE_MASK_SHIFT 0 -#define QM_STOP_CMD_PAUSE_MASK_MASK -1 +#define QM_STOP_CMD_PAUSE_MASK_MASK 0xffffffff #define QM_STOP_CMD_GROUP_ID_OFFSET 1 #define QM_STOP_CMD_GROUP_ID_SHIFT 16 #define QM_STOP_CMD_GROUP_ID_MASK 15 diff --git a/drivers/net/qede/base/reg_addr.h b/drivers/net/qede/base/reg_addr.h index ab886716a..62b30f47b 100644 --- a/drivers/net/qede/base/reg_addr.h +++ b/drivers/net/qede/base/reg_addr.h @@ -30,7 +30,7 @@ 24 #define CDU_REG_CID_ADDR_PARAMS_NCIB ( \ - 0xff << 24) + 0xffUL << 24) #define XSDM_REG_OPERATION_GEN \ 0xf80408UL @@ -436,11 +436,11 @@ #define NIG_REG_LLH_FUNC_FILTER_VALUE 0x501a00UL #define XMAC_REG_CTRL_TX_EN (0x1 << 0) #define XMAC_REG_CTRL_RX_EN (0x1 << 1) -#define CDU_REG_SEGMENT0_PARAMS_T0_TID_SIZE (0xff << 24) +#define CDU_REG_SEGMENT0_PARAMS_T0_TID_SIZE (0xffUL << 24) #define CDU_REG_SEGMENT0_PARAMS_T0_TID_BLOCK_WASTE (0xff << 16) #define CDU_REG_SEGMENT0_PARAMS_T0_TID_BLOCK_WASTE_SHIFT 16 #define CDU_REG_SEGMENT1_PARAMS_T1_TID_BLOCK_WASTE (0xff << 16) -#define CDU_REG_SEGMENT1_PARAMS_T1_TID_SIZE (0xff << 24) +#define CDU_REG_SEGMENT1_PARAMS_T1_TID_SIZE (0xffUL << 24) #define CDU_REG_SEGMENT1_PARAMS_T1_NUM_TIDS_IN_BLOCK (0xfff << 0) #define CDU_REG_SEGMENT1_PARAMS_T1_NUM_TIDS_IN_BLOCK_SHIFT 0 #define CDU_REG_SEGMENT0_PARAMS_T0_NUM_TIDS_IN_BLOCK (0xfff << 0) > > Thanks! > -Rasesh > >> Andrew.