From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhe Tao Subject: [PATCH] i40e: Fix the clean up function for i40e, the DD bits are multiplex with descriptor type field. so cannot use "not zero" as the rule for the completion of Tx descriptor Date: Sat, 4 Jul 2015 01:11:47 +0800 Message-ID: <1435943507-2679-1-git-send-email-zhe.tao@intel.com> To: dev@dpdk.org Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CB0762716 for ; Fri, 3 Jul 2015 19:11:57 +0200 (CEST) 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" If the descriptor in the position desc_to_clean_to is the context descriptor its type will be 0x1, so using the not expression, the device driver will consider the descriptor has been complete for transmission even its DTYPE field is still 0x1 which means NIC has't finished the operation on this descriptor. Signed-off-by: Zhe Tao --- drivers/net/i40e/i40e_rxtx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 2de0ac4..5d33f62 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -574,8 +574,9 @@ i40e_xmit_cleanup(struct i40e_tx_queue *txq) desc_to_clean_to = (uint16_t)(desc_to_clean_to - nb_tx_desc); desc_to_clean_to = sw_ring[desc_to_clean_to].last_id; - if (!(txd[desc_to_clean_to].cmd_type_offset_bsz & - rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE))) { + if ((txd[desc_to_clean_to].cmd_type_offset_bsz & + rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) != + rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE)) { PMD_TX_FREE_LOG(DEBUG, "TX descriptor %4u is not done " "(port=%d queue=%d)", desc_to_clean_to, txq->port_id, txq->queue_id); -- 1.8.4.2