From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) by dpdk.org (Postfix) with ESMTP id D796A2C51 for ; Thu, 30 Jun 2016 17:05:15 +0200 (CEST) Received: by mail-lf0-f49.google.com with SMTP id l188so57587165lfe.2 for ; Thu, 30 Jun 2016 08:05:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+oKnpBimSm8Zdkd8Ilk1NtiAW+qgFqiNsZjQ2/r/S3M=; b=O2UT07qW06GBc1WyqDs7jxymrpzBcSjWlJzS4amO/5cLMIolHgT3IAJX7f5zWUQyAJ F1I4NUCa26Xzv37cQbwfyO2lw9Hcv+SoWwgvXAUrkLenuCgXMa+dVnooJ4ZzwveRLaNY 73b2Bk5g++W/nOZWa1Ldyl5BxKl3mfx9QV3tPVZIR7/qg4MF0npE97kMPysUFf6ft85a pUbjFftx1XZVgXhHU9Jvq1qz+po1YaxbjVpIxo3+4izr7MDJCVGtJCrkB1CE0hJR/yQI 88y2LowVnEQ140bAES6cxZBnlnlQ5KD75j4JTLnZU5OTmo7qjRncCZh0ttovUOr/Xclm 9w4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+oKnpBimSm8Zdkd8Ilk1NtiAW+qgFqiNsZjQ2/r/S3M=; b=Wr4C+4F4U5DoIbxYQQLw3gGKJr4feLL+UOao/wHkFKGO45A8Q2QFKbjeHJ4fyMTQD/ fM8Lwk9V6STxvZ0hqRZfYiBDoXUAvQVdpQ9YQaj3H4YCUI8VxigDmP1Y1YfrdqZ6L8lx IDQCVieA24yr0OGf854deT8jQmxCF8iRLJcZtTQoZgegVAnqOedYQsJw+ICWM3Z74Ao2 k8uSMXNnhLXhhXsHrbLICQiIobng9OmgYMUNvY6A1bwInYwbOYSNAZIea1g1sWVdJvDJ 4eMFSoSCcOD0V+I++zN0NPV/bEsJ0mH5xpS5q57XsbuMXahM4KswNlHACFe5xdKIsOAl 1vKg== X-Gm-Message-State: ALyK8tKwmuDFSSpJRjDX/ZzdZ4mV3oeO/PEY+ADP0N15vdJ3cDtnx781ttgxJMEfRwpa2w== X-Received: by 10.25.159.8 with SMTP id i8mr5370011lfe.74.1467299115505; Thu, 30 Jun 2016 08:05:15 -0700 (PDT) Received: from anpa-dpdk-2.lab.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id 206sm1635339ljj.0.2016.06.30.08.05.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Jun 2016 08:05:14 -0700 (PDT) From: Jan Medala To: dev@dpdk.org Cc: ferruh.yigit@intel.com, bruce.richardson@intel.com, Jan Medala , Alexander Matushevsky , Jakub Palider Date: Thu, 30 Jun 2016 17:04:58 +0200 Message-Id: <1467299099-32498-6-git-send-email-jan@semihalf.com> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1467299099-32498-1-git-send-email-jan@semihalf.com> References: <1466510763-19569-6-git-send-email-jan@semihalf.com> <1467299099-32498-1-git-send-email-jan@semihalf.com> Subject: [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: Thu, 30 Jun 2016 15:05:16 -0000 After allocating memzone it's required to zeroize memory in it. Freeing memzone with function dedicated for memoryzones. 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