From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 4BE557E23 for ; Wed, 3 Dec 2014 02:13:35 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 02 Dec 2014 17:13:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="492639668" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 02 Dec 2014 17:10:17 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id sB31DUX8020121; Wed, 3 Dec 2014 09:13:30 +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 sB31DS0s030173; Wed, 3 Dec 2014 09:13:30 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id sB31DSY6030169; Wed, 3 Dec 2014 09:13:28 +0800 From: Helin Zhang To: dev@dpdk.org Date: Wed, 3 Dec 2014 09:13:27 +0800 Message-Id: <1417569207-30139-1-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1417419227-21465-1-git-send-email-helin.zhang@intel.com> References: <1417419227-21465-1-git-send-email-helin.zhang@intel.com> Subject: [dpdk-dev] [PATCH v2] i40e: fix of compile error 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, 03 Dec 2014 01:13:55 -0000 The compile error will occur as below when set 'RTE_LIBRTE_I40E_16BYTE_RX_DESC=y'. 'fd_id' should be used to replace 'fd', as 'fd' is not defined in that structure at all. In addition, local variable of 'flexbl' and 'flexbh' must be used only if 32 bytes RX descriptor is selected. error logs: lib/librte_pmd_i40e/i40e_rxtx.c: In function i40e_rxd_build_fdir: lib/librte_pmd_i40e/i40e_rxtx.c:431:28: error: volatile union has no member named fd lib/librte_pmd_i40e/i40e_rxtx.c:427:19: error: unused variable flexbl [-Werror=unused-variable] lib/librte_pmd_i40e/i40e_rxtx.c:427:11: error: unused variable flexbh [-Werror=unused-variable] Signed-off-by: Helin Zhang --- lib/librte_pmd_i40e/i40e_rxtx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) v2 changes: * Removed the changes for code style fix, and kept it for compile error fix only. * Re-word the commit logs. diff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_rxtx.c index 2d2ef04..63c872d 100644 --- a/lib/librte_pmd_i40e/i40e_rxtx.c +++ b/lib/librte_pmd_i40e/i40e_rxtx.c @@ -424,13 +424,9 @@ static inline uint64_t i40e_rxd_build_fdir(volatile union i40e_rx_desc *rxdp, struct rte_mbuf *mb) { uint64_t flags = 0; +#ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC uint16_t flexbh, flexbl; -#ifdef RTE_LIBRTE_I40E_16BYTE_RX_DESC - mb->hash.fdir.hi = - rte_le_to_cpu_32(rxdp->wb.qword0.hi_dword.fd); - flags |= PKT_RX_FDIR_ID; -#else flexbh = (rte_le_to_cpu_32(rxdp->wb.qword2.ext_status) >> I40E_RX_DESC_EXT_STATUS_FLEXBH_SHIFT) & I40E_RX_DESC_EXT_STATUS_FLEXBH_MASK; @@ -453,6 +449,10 @@ i40e_rxd_build_fdir(volatile union i40e_rx_desc *rxdp, struct rte_mbuf *mb) rte_le_to_cpu_32(rxdp->wb.qword3.lo_dword.flex_bytes_lo); flags |= PKT_RX_FDIR_FLX; } +#else + mb->hash.fdir.hi = + rte_le_to_cpu_32(rxdp->wb.qword0.hi_dword.fd_id); + flags |= PKT_RX_FDIR_ID; #endif return flags; } -- 1.9.3