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 CA95629D1 for ; Mon, 29 Aug 2016 18:54:50 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP; 29 Aug 2016 09:54:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,597,1470726000"; d="scan'208";a="2376653" Received: from dpdk-test-2.inn.intel.com ([10.125.24.191]) by orsmga004.jf.intel.com with ESMTP; 29 Aug 2016 09:54:48 -0700 From: Yury Kylulin To: helin.zhang@intel.com, konstantin.ananyev@intel.com, jingjing.wu@intel.com Cc: wenzhuo.lu@intel.com, dev@dpdk.org, Yury Kylulin Date: Mon, 29 Aug 2016 19:50:47 +0300 Message-Id: <1472489448-15911-2-git-send-email-yury.kylulin@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472489448-15911-1-git-send-email-yury.kylulin@intel.com> References: <1472489448-15911-1-git-send-email-yury.kylulin@intel.com> Subject: [dpdk-dev] [PATCH 1/2] net/ixgbe: fix mbufs leakage during Rx queue release 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: Mon, 29 Aug 2016 16:54:51 -0000 For the vector PMD release all mbufs from the Rx queue if no packets received after device start. Fixes: 11b220c6498d ("ixgbe: fix release queue mbufs") Signed-off-by: Yury Kylulin --- drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h index 62b8201..3c3c009 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h @@ -204,8 +204,20 @@ _ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq) return; /* free all mbufs that are valid in the ring */ - for (i = rxq->rx_tail; i != rxq->rxrearm_start; i = (i + 1) & mask) - rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf); + if (rxq->rxrearm_nb == 0) { + for (i = 0; i < rxq->nb_rx_desc; i++) { + if (rxq->sw_ring[i].mbuf != NULL) + rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf); + } + } else { + for (i = rxq->rx_tail; + i != rxq->rxrearm_start; + i = (i + 1) & mask) { + if (rxq->sw_ring[i].mbuf != NULL) + rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf); + } + } + rxq->rxrearm_nb = rxq->nb_rx_desc; /* set all entries to NULL */ -- 2.7.4