From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by dpdk.org (Postfix) with ESMTP id A21DAC11A for ; Tue, 21 Jun 2016 14:06:22 +0200 (CEST) Received: by mail-lf0-f48.google.com with SMTP id l188so20327341lfe.2 for ; Tue, 21 Jun 2016 05:06:22 -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=wqQH761NxoXyG1sTrQlJTz6dx1x1jxQ/K2MxCGe1WTisprRpUF0h8nB39/CFUVu7P+ P5WRZ6cc8GPWLRoO9UPMGB1PGaIHqZI267i+YQz5atkhBIrJGWl9m28PEIHNIsaQ1/KB ANrR3Tk/M+3zQVsHr7l/Nu37nqVkR8qTyKskw3AkUYqFQb1sGjRaPjLiWN0FaqygSbI2 Jro5zbH1A48Dk/Lmh0Q43XCeHrBQHipT5URIx0O1V1cvqvdWzcTSuAhr4PI8VOQQSj9u NW573Slego/HyEZE8eMgJwX+6//S3Rb0UklZe5foWR64TWhzoyCIYu2LL3B7l532sFip tamg== 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=Ofy75NCnhn71Vy5fpdZTSgrwXRMxXL2vdbHBzbTYzpo0nFkIT/An7UKV3HvKEXVF+S OzvmmEZtAWdvBlJHdjUOZQkay9qLgFCHHubpdxI9TmtBiJteQOedtsILmv/JUe+C0A+u gHVn4faM9Pjjnw/78wDeN9f5Muj5TN5vIS3Kbs6BtgMWh+5MkFxaAKoSJbVqX9GJ+cQe SO1WOO3LcLa+mFBvYvkxS8sWWAjL8AzH3/NANryCc5kH0qn76ppC/K9Sm/TsJsmH5Qwl 9rPmuLMKpfyIxNz8v/2ihym7Wy+/Fv2ZyP1iv5dn19Dt8MNvMCW8HGOvwlNq6pEcBAyN OD2w== X-Gm-Message-State: ALyK8tJkVwj/g+Ds+mw8daRcdNH8INicTEAH9yfdxnIbHzliHPq+usa5w1kC4B5H+NujUQ== X-Received: by 10.25.42.18 with SMTP id q18mr3338559lfq.102.1466510782027; Tue, 21 Jun 2016 05:06:22 -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 t10sm6613629lfd.18.2016.06.21.05.06.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Jun 2016 05:06:21 -0700 (PDT) From: Jan Medala To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Jan Medala , Alexander Matushevsky , Jakub Palider Date: Tue, 21 Jun 2016 14:06:02 +0200 Message-Id: <1466510763-19569-6-git-send-email-jan@semihalf.com> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1466510763-19569-1-git-send-email-jan@semihalf.com> References: <1466099690-28085-1-git-send-email-jan@semihalf.com> <1466510763-19569-1-git-send-email-jan@semihalf.com> Subject: [dpdk-dev] [PATCH v2 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: Tue, 21 Jun 2016 12:06:22 -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