From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 5740C1DB1 for ; Mon, 4 Jul 2016 18:27:54 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 04 Jul 2016 09:27:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,575,1459839600"; d="scan'208";a="1015502172" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.220.53]) by fmsmga002.fm.intel.com with SMTP; 04 Jul 2016 09:27:52 -0700 Received: by (sSMTP sendmail emulation); Mon, 04 Jul 2016 17:27:50 +0025 Date: Mon, 4 Jul 2016 17:27:50 +0100 From: Bruce Richardson To: Jan Medala Cc: dev@dpdk.org, ferruh.yigit@intel.com, Alexander Matushevsky , Jakub Palider Message-ID: <20160704162750.GB23380@bricha3-MOBL3> References: <1466510763-19569-6-git-send-email-jan@semihalf.com> <1467299099-32498-1-git-send-email-jan@semihalf.com> <1467299099-32498-6-git-send-email-jan@semihalf.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1467299099-32498-6-git-send-email-jan@semihalf.com> Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?= =?iso-8859-1?Q?opment?= Ireland Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v3 5/6] ena: fix memory management issue 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, 04 Jul 2016 16:27:54 -0000 On Thu, Jun 30, 2016 at 05:04:58PM +0200, Jan Medala wrote: > After allocating memzone it's required to zeroize memory in it. > Freeing memzone with function dedicated for memoryzones. > Can you provide a fixes line for this patch? > Signed-off-by: Alexander Matushevsky > Signed-off-by: Jakub Palider > Signed-off-by: Jan Medala > --- > drivers/net/ena/base/ena_plat_dpdk.h | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h > index b1ed80c..87c3bf1 100644 > --- a/drivers/net/ena/base/ena_plat_dpdk.h > +++ b/drivers/net/ena/base/ena_plat_dpdk.h > @@ -62,7 +62,7 @@ typedef uint64_t dma_addr_t; > #endif > > #define ena_atomic32_t rte_atomic32_t > -#define ena_mem_handle_t void * > +#define ena_mem_handle_t const struct rte_memzone * > > #define SZ_256 (256U) > #define SZ_4K (4096U) > @@ -188,13 +188,15 @@ typedef uint64_t dma_addr_t; > snprintf(z_name, sizeof(z_name), \ > "ena_alloc_%d", ena_alloc_cnt++); \ > mz = rte_memzone_reserve(z_name, size, SOCKET_ID_ANY, 0); \ > + memset(mz->addr, 0, size); \ > virt = mz->addr; \ > phys = mz->phys_addr; \ > + handle = mz; \ > } while (0) > #define ENA_MEM_FREE_COHERENT(dmadev, size, virt, phys, handle) \ > ({ ENA_TOUCH(size); ENA_TOUCH(phys); \ > ENA_TOUCH(dmadev); \ > - rte_free(virt); }) > + rte_memzone_free(handle); }) > > #define ENA_MEM_ALLOC_COHERENT_NODE(dmadev, size, virt, phys, node, dev_node) \ > do { \ > -- > 2.8.2 >