From patchwork Thu Apr 20 08:51:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xing, Beilei" X-Patchwork-Id: 23786 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 A9BFC388F; Thu, 20 Apr 2017 10:54:47 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 2DEBC2BA4 for ; Thu, 20 Apr 2017 10:54:46 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Apr 2017 01:54:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,225,1488873600"; d="scan'208";a="90082558" Received: from dpdk9.sh.intel.com ([10.239.129.137]) by orsmga005.jf.intel.com with ESMTP; 20 Apr 2017 01:54:44 -0700 From: Beilei Xing To: jingjing.wu@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org Date: Thu, 20 Apr 2017 16:51:36 +0800 Message-Id: <1492678296-115636-1-git-send-email-beilei.xing@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dpdk-dev] [PATCH v2] net/i40e: fix testpmd setup error when bulk is disabled 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" Testpmd failed to start when CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC is disabled, the root cause is the length of sw_ring and queue are incorrect with the above configuration. Fixes: 0be295312966 ("net/i40e: fix compile error") Signed-off-by: Beilei Xing Acked-by: Qi Zhang --- v2 change: Correct the length of queue when BULK is disabled. drivers/net/i40e/i40e_rxtx.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index e5471b1..9f697d7 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -1791,13 +1791,11 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev, /* Allocate the maximun number of RX ring hardware descriptor. */ len = I40E_MAX_RING_DESC; -#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC /** * Allocating a little more memory because vectorized/bulk_alloc Rx * functions doesn't check boundaries each time. */ len += RTE_PMD_I40E_RX_MAX_BURST; -#endif ring_size = RTE_ALIGN(len * sizeof(union i40e_rx_desc), I40E_DMA_MEM_ALIGN); @@ -1816,11 +1814,7 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev, rxq->rx_ring_phys_addr = rte_mem_phy2mch(rz->memseg_id, rz->phys_addr); rxq->rx_ring = (union i40e_rx_desc *)rz->addr; -#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC len = (uint16_t)(nb_desc + RTE_PMD_I40E_RX_MAX_BURST); -#else - len = nb_desc; -#endif /* Allocate the software ring. */ rxq->sw_ring =