From patchwork Mon Dec 1 07:33:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Helin" X-Patchwork-Id: 1698 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 54CEF68AC; Mon, 1 Dec 2014 08:33:56 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id DF916DE0 for ; Mon, 1 Dec 2014 08:33:54 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 30 Nov 2014 23:31:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,492,1413270000"; d="scan'208";a="616477400" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 30 Nov 2014 23:33:53 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id sB17XogW031896; Mon, 1 Dec 2014 15:33:50 +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 sB17XmrN021499; Mon, 1 Dec 2014 15:33:50 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id sB17Xm1L021495; Mon, 1 Dec 2014 15:33:48 +0800 From: Helin Zhang To: dev@dpdk.org Date: Mon, 1 Dec 2014 15:33:47 +0800 Message-Id: <1417419227-21465-1-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] i40e: bug 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The compile error will occur as below when set 'RTE_LIBRTE_I40E_16BYTE_RX_DESC=y'. The changes is just to fix it. 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 | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_rxtx.c index 2d2ef04..95666fd 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; @@ -438,22 +434,28 @@ i40e_rxd_build_fdir(volatile union i40e_rx_desc *rxdp, struct rte_mbuf *mb) I40E_RX_DESC_EXT_STATUS_FLEXBL_SHIFT) & I40E_RX_DESC_EXT_STATUS_FLEXBL_MASK; - if (flexbh == I40E_RX_DESC_EXT_STATUS_FLEXBH_FD_ID) { mb->hash.fdir.hi = rte_le_to_cpu_32(rxdp->wb.qword3.hi_dword.fd_id); flags |= PKT_RX_FDIR_ID; } else if (flexbh == I40E_RX_DESC_EXT_STATUS_FLEXBH_FLEX) { mb->hash.fdir.hi = - rte_le_to_cpu_32(rxdp->wb.qword3.hi_dword.flex_bytes_hi); + rte_le_to_cpu_32( + rxdp->wb.qword3.hi_dword.flex_bytes_hi); flags |= PKT_RX_FDIR_FLX; } + if (flexbl == I40E_RX_DESC_EXT_STATUS_FLEXBL_FLEX) { mb->hash.fdir.lo = - rte_le_to_cpu_32(rxdp->wb.qword3.lo_dword.flex_bytes_lo); + 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; } static inline void