From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 6EE8B6CB7 for ; Wed, 12 Oct 2016 08:44:10 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 11 Oct 2016 23:44:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,332,1473145200"; d="scan'208";a="1069315216" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by fmsmga002.fm.intel.com with ESMTP; 11 Oct 2016 23:44:08 -0700 Date: Wed, 12 Oct 2016 14:44:24 +0800 From: Yuanhan Liu To: Yury Kylulin Cc: dpdk stable , Beilei Xing Message-ID: <57fddbc8.Q2bPXQyYUmfEKz7U%yuanhan.liu@linux.intel.com> User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [dpdk-stable] patch 'net/i40e: fix mbuf leak during Rx queue release' has been queued to stable release 16.07.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 06:44:10 -0000 Hi, FYI, your patch has been queued to stable release 16.07.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before this Friday. So please shutout if anyone has objections. Thanks. --yliu --- >>From 7a9369541af2773af06826ee3a61a572ab136a7a Mon Sep 17 00:00:00 2001 From: Yury Kylulin Date: Mon, 29 Aug 2016 19:50:48 +0300 Subject: [PATCH] net/i40e: fix mbuf leak during Rx queue release [ upstream commit 158efcdc5eed048f989c911ab372e78ceb1431bb ] For the vector PMD, release all mbufs from the Rx queue if no packets are received after device start. Fixes: 9ed94e5bb04e ("i40e: add vector Rx") Signed-off-by: Yury Kylulin Acked-by: Beilei Xing --- drivers/net/i40e/i40e_rxtx_vec.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_rxtx_vec.c b/drivers/net/i40e/i40e_rxtx_vec.c index 51fb282..82571ee 100644 --- a/drivers/net/i40e/i40e_rxtx_vec.c +++ b/drivers/net/i40e/i40e_rxtx_vec.c @@ -692,8 +692,20 @@ i40e_rx_queue_release_mbufs_vec(struct i40e_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 */ -- 1.9.0