From: Beilei Xing Date: Thu, 20 Apr 2017 08:51:36 +0000 (+0800) Subject: net/i40e: fix setup when bulk is disabled X-Git-Tag: spdx-start~3358 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c00f307f850a888f887688e88cb13be7e6964bd7;p=dpdk.git net/i40e: fix setup when bulk is disabled 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 --- diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index e5471b1437..9f697d788c 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 =