From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by dpdk.org (Postfix) with ESMTP id 3B35D23A for ; Thu, 7 Jun 2018 11:44:21 +0200 (CEST) Received: by mail-lf0-f65.google.com with SMTP id j13-v6so13640503lfb.13 for ; Thu, 07 Jun 2018 02:44:21 -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=iuNYJm2f3Qqb0zkpxWGvb6JEx0BLKtjH6YhnsrScW00=; b=ihFQKSIv4Y9xj99jAz+5/HxB2aaMnqViQuAkLrki1MbZPMH/IJ51KUVtK5bN/M5WCa cDKpFqUt+LdIh5o9cQ9cYaX5POxQT4Out5V2SA1qzBIn5RAb8SckR+edpmNEQfK1BQY2 oe027MHUFdd7fGRijftIniqsNuZfe127QiZlhc8qAykp9Uzx/l45nZYwWOdsvfH8Qm1G uJi9U7pgnIaaqODCLpN6UHJbXT3DD0AeoQUrx7dC5Jgmi1PX+Nyqk2eadQKcJAmsWfDN NrR5RLcjn5UWMrnQhaNVc5AwmMoqyooQrO4A7VvGioz0rZIZHchio43zVaSFG83zIIlK ZzIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iuNYJm2f3Qqb0zkpxWGvb6JEx0BLKtjH6YhnsrScW00=; b=X2XS3o4Mdfivt/L/U41nhszzFbkTkwIKCIA55jTi9sx91nilf/4WLuHKquGNws4S5F c94rn4CPsoCTPXlRhSgLLOZz+IaI1Eevm1ndyzMag2Rk02Pt6op4dP2nFm2jb18CRjOV V7s19u+IX0v3yQRI/lEGS1oN8h9zJXsFCgsBahk/bg7LhRcoeeEX1fYG6HN6acgFzVZO DH68vCQ6I7fWNszrsgUdXWZLt/HiCDo/CHBYhTEzb9uVLfNtjQxhrVHHW1bHPXXuqLGM iBvRPcrIBAyJfmSILlAacPlVPcAsZxhAZeCodIcZaVEynxDeEtWvqmu8pU8SmZYxUCnJ liFA== X-Gm-Message-State: APt69E2IuzP52sEqC86wAI5Os7LsNMFt47NhiJbD8ugTjBw975nsAKW8 RMOWD2sEoJ0+wLD0FdnTaf5eAw== X-Google-Smtp-Source: ADUXVKJbJzwndzdBbv+sjVtRynVHwgeLQNBQPMzq+qksor8N8PezxyQDlWyBcLLhlUL9zwKP8yGd6Q== X-Received: by 2002:a19:1797:: with SMTP id 23-v6mr859921lfx.95.1528364660832; Thu, 07 Jun 2018 02:44:20 -0700 (PDT) Received: from mkPC.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id p28-v6sm3612368lfh.24.2018.06.07.02.44.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 02:44:18 -0700 (PDT) From: Michal Krawczyk To: Marcin Wojtas , Michal Krawczyk , Guy Tzalik , Evgeny Schemeilin Cc: dev@dpdk.org, matua@amazon.com, Rafal Kozik Date: Thu, 7 Jun 2018 11:43:19 +0200 Message-Id: <20180607094322.14312-24-mk@semihalf.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180607094322.14312-1-mk@semihalf.com> References: <20180607094322.14312-1-mk@semihalf.com> Subject: [dpdk-dev] [PATCH v3 24/27] net/ena: change memory type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 09:44:21 -0000 From: Rafal Kozik ENA_MEM_ALLOC_NODE not need to use contiguous physical memory. Also using memset without checking if allocation succeed can cause segmentation fault. To avoid both issue use rte_zmalloc_socket. Fixes: 3d3edc265fc8 ("net/ena: make coherent memory allocation NUMA-aware") Signed-off-by: Rafal Kozik Acked-by: Michal Krawczyk --- drivers/net/ena/base/ena_plat_dpdk.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h index d30153e92..22d7a9cb1 100644 --- a/drivers/net/ena/base/ena_plat_dpdk.h +++ b/drivers/net/ena/base/ena_plat_dpdk.h @@ -248,15 +248,8 @@ extern uint32_t ena_alloc_cnt; #define ENA_MEM_ALLOC_NODE(dmadev, size, virt, node, dev_node) \ do { \ - const struct rte_memzone *mz; \ - char z_name[RTE_MEMZONE_NAMESIZE]; \ ENA_TOUCH(dmadev); ENA_TOUCH(dev_node); \ - snprintf(z_name, sizeof(z_name), \ - "ena_alloc_%d", ena_alloc_cnt++); \ - mz = rte_memzone_reserve(z_name, size, node, \ - RTE_MEMZONE_IOVA_CONTIG); \ - memset(mz->addr, 0, size); \ - virt = mz->addr; \ + virt = rte_zmalloc_socket(NULL, size, 0, node); \ } while (0) #define ENA_MEM_ALLOC(dmadev, size) rte_zmalloc(NULL, size, 1) -- 2.14.1