From patchwork Thu Jan 16 07:09:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaolong Ye X-Patchwork-Id: 64749 X-Patchwork-Delegate: xiaolong.ye@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CF14FA0352; Thu, 16 Jan 2020 08:10:01 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9E76D1C020; Thu, 16 Jan 2020 08:10:01 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 1DC171C013 for ; Thu, 16 Jan 2020 08:09:59 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2020 23:09:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,325,1574150400"; d="scan'208";a="257221579" Received: from yexl-server.sh.intel.com ([10.67.117.17]) by fmsmga002.fm.intel.com with ESMTP; 15 Jan 2020 23:09:58 -0800 From: Xiaolong Ye To: Qiming Yang , Wenzhuo Lu Cc: dev@dpdk.org, ferruh.yigit@intel.com, chenxux.di@intel.com, Xiaolong Ye Date: Thu, 16 Jan 2020 15:09:48 +0800 Message-Id: <20200116070948.108027-1-xiaolong.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <767c28a2f74b414580a46aec1f4443d8@intel.com> References: <767c28a2f74b414580a46aec1f4443d8@intel.com> Subject: [dpdk-dev] [PATCH] net/ice: cleanup for vec path check 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Move the conditional compilation block to the inner check helper, so we can reduce the number of multiple ifdef check pairs used. Signed-off-by: Xiaolong Ye Acked-by: Qiming Yang --- drivers/net/ice/ice_rxtx.c | 9 --------- drivers/net/ice/ice_rxtx_vec_common.h | 8 ++++++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 71adba809..8feeeb828 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -2753,14 +2753,12 @@ ice_tx_done_cleanup_full(struct ice_tx_queue *txq, return (int)pkt_cnt; } -#ifdef RTE_ARCH_X86 static int ice_tx_done_cleanup_vec(struct ice_tx_queue *txq __rte_unused, uint32_t free_cnt __rte_unused) { return -ENOTSUP; } -#endif static int ice_tx_done_cleanup_simple(struct ice_tx_queue *txq, @@ -2794,10 +2792,8 @@ ice_tx_done_cleanup(void *txq, uint32_t free_cnt) struct ice_adapter *ad = ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); -#ifdef RTE_ARCH_X86 if (ad->tx_vec_allowed) return ice_tx_done_cleanup_vec(q, free_cnt); -#endif if (ad->tx_simple_allowed) return ice_tx_done_cleanup_simple(q, free_cnt); else @@ -2953,7 +2949,6 @@ ice_set_rx_function(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); struct ice_adapter *ad = ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); -#ifdef RTE_ARCH_X86 struct ice_rx_queue *rxq; int i; bool use_avx2 = false; @@ -2998,8 +2993,6 @@ ice_set_rx_function(struct rte_eth_dev *dev) return; } -#endif - if (dev->data->scattered_rx) { /* Set the non-LRO scattered function */ PMD_INIT_LOG(DEBUG, @@ -3131,7 +3124,6 @@ ice_set_tx_function(struct rte_eth_dev *dev) { struct ice_adapter *ad = ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); -#ifdef RTE_ARCH_X86 struct ice_tx_queue *txq; int i; bool use_avx2 = false; @@ -3167,7 +3159,6 @@ ice_set_tx_function(struct rte_eth_dev *dev) return; } -#endif if (ad->tx_simple_allowed) { PMD_INIT_LOG(DEBUG, "Simple tx finally be used."); diff --git a/drivers/net/ice/ice_rxtx_vec_common.h b/drivers/net/ice/ice_rxtx_vec_common.h index 6b57ff2ae..223aac878 100644 --- a/drivers/net/ice/ice_rxtx_vec_common.h +++ b/drivers/net/ice/ice_rxtx_vec_common.h @@ -267,6 +267,7 @@ ice_tx_vec_queue_default(struct ice_tx_queue *txq) static inline int ice_rx_vec_dev_check_default(struct rte_eth_dev *dev) { +#ifdef RTE_ARCH_X86 int i; struct ice_rx_queue *rxq; struct ice_adapter *ad = @@ -283,11 +284,15 @@ ice_rx_vec_dev_check_default(struct rte_eth_dev *dev) } return 0; +#else + return -1; +#endif } static inline int ice_tx_vec_dev_check_default(struct rte_eth_dev *dev) { +#ifdef RTE_ARCH_X86 int i; struct ice_tx_queue *txq; @@ -298,6 +303,9 @@ ice_tx_vec_dev_check_default(struct rte_eth_dev *dev) } return 0; +#else + return -1; +#endif } #endif