From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 3E4FAC40C for ; Fri, 24 Jul 2015 15:59:04 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 24 Jul 2015 06:59:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,538,1432623600"; d="scan'208";a="612155628" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 24 Jul 2015 06:59:02 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t6ODx14l026255; Fri, 24 Jul 2015 14:59:01 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t6ODx1m8012250; Fri, 24 Jul 2015 14:59:01 +0100 Received: (from kananye1@localhost) by sivswdev02.ir.intel.com with id t6ODx1ka012246; Fri, 24 Jul 2015 14:59:01 +0100 From: Konstantin Ananyev To: dev@dpdk.org Date: Fri, 24 Jul 2015 14:58:11 +0100 Message-Id: <1437746295-12184-2-git-send-email-konstantin.ananyev@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1437746295-12184-1-git-send-email-konstantin.ananyev@intel.com> References: <1437667506-3890-2-git-send-email-bruce.richardson@intel.com> <1437746295-12184-1-git-send-email-konstantin.ananyev@intel.com> In-Reply-To: <1437667506-3890-2-git-send-email-bruce.richardson@intel.com> References: <1437667506-3890-2-git-send-email-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCHv2 1/5] Revert "ixgbe: check mbuf refcnt when clearing a ring" 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: Fri, 24 Jul 2015 13:59:04 -0000 This reverts commit b35d0d80f0a809939549ddde99c1a76b7e38bff3. The bug fix was incorrect as it did not take account of the fact that the mbufs that were previously freed may have since be re-allocated. Signed-off-by: Bruce Richardson Signed-off-by: Konstantin Ananyev --- drivers/net/ixgbe/ixgbe_rxtx.c | 3 +-- drivers/net/ixgbe/ixgbe_rxtx_vec.c | 8 +------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index af7e222..75c5555 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -2272,8 +2272,7 @@ ixgbe_rx_queue_release_mbufs(struct ixgbe_rx_queue *rxq) if (rxq->sw_ring != NULL) { for (i = 0; i < rxq->nb_rx_desc; i++) { - if (rxq->sw_ring[i].mbuf != NULL && - rte_mbuf_refcnt_read(rxq->sw_ring[i].mbuf)) { + if (rxq->sw_ring[i].mbuf != NULL) { rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf); rxq->sw_ring[i].mbuf = NULL; } diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c b/drivers/net/ixgbe/ixgbe_rxtx_vec.c index d3ac74a..47ff990 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c @@ -736,13 +736,7 @@ ixgbe_tx_queue_release_mbufs(struct ixgbe_tx_queue *txq) nb_free < max_desc && i != txq->tx_tail; i = (i + 1) & max_desc) { txe = (struct ixgbe_tx_entry_v *)&txq->sw_ring[i]; - /* - * Check for already freed packets. - * Note: ixgbe_tx_free_bufs does not NULL after free, - * so we actually have to check the reference count. - */ - if (txe->mbuf != NULL && - rte_mbuf_refcnt_read(txe->mbuf) != 0) + if (txe->mbuf != NULL) rte_pktmbuf_free_seg(txe->mbuf); } /* reset tx_entry */ -- 1.8.3.1