From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 0DB0DFFA for ; Wed, 8 Jul 2015 11:29:27 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 08 Jul 2015 02:29:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,431,1432623600"; d="scan'208";a="758231298" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 08 Jul 2015 02:29:27 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t689TOvH020805; Wed, 8 Jul 2015 17:29:24 +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 t689TMta031950; Wed, 8 Jul 2015 17:29:24 +0800 Received: (from zhetao@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t689TMw3031946; Wed, 8 Jul 2015 17:29:22 +0800 From: Zhe Tao To: dev@dpdk.org Date: Wed, 8 Jul 2015 17:29:19 +0800 Message-Id: <1436347759-31915-1-git-send-email-zhe.tao@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1435943507-2679-1-git-send-email-zhe.tao@intel.com> References: <1435943507-2679-1-git-send-email-zhe.tao@intel.com> Subject: [dpdk-dev] [PATCH v2] i40e:Fix the Description Done check mechanism for i40e 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: , X-List-Received-Date: Wed, 08 Jul 2015 09:29:28 -0000 If the descriptor the device derive is handling is the context descriptor its type will be 0x1, so using the not expression, the device driver will consider the descriptor has been completed for transmission even its DD field is still 0x1 which means NIC has't finished the operation on this descriptor. Signed-off-by: Zhe Tao --- drivers/net/i40e/i40e_fdir.c | 3 ++- drivers/net/i40e/i40e_rxtx.c | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index 4bf98d0..f3cb757 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -1110,7 +1110,8 @@ i40e_fdir_filter_programming(struct i40e_pf *pf, for (i = 0; i < I40E_FDIR_WAIT_COUNT; i++) { rte_delay_us(I40E_FDIR_WAIT_INTERVAL_US); - if (txdp->cmd_type_offset_bsz & + if ((txdp->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)) break; } diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 2de0ac4..7c0c684 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); @@ -1431,8 +1432,9 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq) struct i40e_tx_entry *txep; uint16_t i; - if (!(txq->tx_ring[txq->tx_next_dd].cmd_type_offset_bsz & - rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE))) + if ((txq->tx_ring[txq->tx_next_dd].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)) return 0; txep = &(txq->sw_ring[txq->tx_next_dd - (txq->tx_rs_thresh - 1)]); -- 1.8.4.2