From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id F0DA22A6C for ; Thu, 3 Nov 2016 11:23:12 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP; 03 Nov 2016 03:23:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,438,1473145200"; d="scan'208";a="187125073" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.210.137]) by fmsmga004.fm.intel.com with SMTP; 03 Nov 2016 03:23:10 -0700 Received: by (sSMTP sendmail emulation); Thu, 03 Nov 2016 10:23:09 +0000 Date: Thu, 3 Nov 2016 10:23:09 +0000 From: Bruce Richardson To: Dror Birkman Message-ID: <20161103102308.GA63552@bricha3-MOBL3.ger.corp.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?= =?iso-8859-1?Q?opment?= Ireland Ltd. User-Agent: Mutt/1.7.1 (2016-10-04) Cc: dev@dpdk.org, Nicolas Pernas Maradei , ferruh.yigit@intel.com Subject: Re: [dpdk-dev] PCAP memory leak in freeing jumbo frames 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: Thu, 03 Nov 2016 10:23:13 -0000 On Thu, Nov 03, 2016 at 11:35:14AM +0200, Dror Birkman wrote: > Hi, > > I have a huge memory leak when I release mbufs allocated > by eth_pcap_rx_jumbo(). > > I use rte_mempool_put_bulk() to release the mbufs. > To my horror I found out it puts back to the mempool only the head mbuf and > not its segments! > > I know rte_pktmbuf_free() frees the mbuf and all it segments, but afaik it > is not thread safe. > > What is the thread safe way to free mbufs (preferably in bulk) and their > segments? > I'm not aware of any thread-safety differences between mempool_put and pktmbuf_free - which in the end just calls mempool_put for each segment. For freeing mbufs with multiple segments, I think you'll have to use the regular mbuf_free function, or write your own special bulk version. /Bruce