From patchwork Tue Apr 23 16:48:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 53008 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6CC511B467; Tue, 23 Apr 2019 18:48:30 +0200 (CEST) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id 158D51B416 for ; Tue, 23 Apr 2019 18:48:25 +0200 (CEST) Received: by mail-pl1-f193.google.com with SMTP id w23so7821942ply.4 for ; Tue, 23 Apr 2019 09:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e2OAOyI51TjoT/4QB1GtTC1iGYMT4d/z1QSisRfvmcw=; b=uImDr+iwD6BSWRhPbXJZ4fgeWwBr1V2hu5OcZ2nsb+HT+RRNdw7yMWCeq2hCGowDKd DXZxC041YOPkapvx1GMxe+VpcvBr4q5sfKw4wq6jkaP34xK+Fb6+lKsEUmPOQ4uI0zn5 dKFQfSZFuOYnqERWTtp9x1xXZy2rolwbZq/+yy1+yhA91UBHU/4Mvmg/6AOtUNC7JuAt sbgrfDv547goGgPrF2yJkkPFPtUy6RWIJdcH5tLOwLEZPa/4miu/fFgyPzidHfWlQVzC h2q/PjqpuP5iOiomvBBiPQLxscO4A4aRoUE4Kdbr7QMaspWc3uU6ylk6PUBaGasYbFi6 Vm2g== 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:mime-version:content-transfer-encoding; bh=e2OAOyI51TjoT/4QB1GtTC1iGYMT4d/z1QSisRfvmcw=; b=AT8fi80i9LXyhd7tV5fl40CgXLeTO71oy+hLFNnno4MUetrERr6XtvfWFYcxd/eG/l X7oPyuehGGCTsoUh1eZXr8AO8Va5oH91JqYD/Khm7vYBKEkWzit17qdR3jNn/tn6TEWT l5zj9JMX+U6SucWHeR8Rx+Dv0HbcB+CStloMKqXjUp9XLWMv5n3EDzKjhyqvNOn7bYDJ j820K6ZpYZRoBkGgfMAvgX9gqOxJ66o9EtSPckV9IlXn/wDL3CgU8jNG8uXSuSQDIfyj szQrgD+oQ3ZgXLS+FmE3dQMaK7H9QNbHEeb0wPOX1bCKtC1yuqAA3/AJQcg+YSjZF8E/ 0g1Q== X-Gm-Message-State: APjAAAVkbpjbG+0AjXaLEZMfqD2bN1ND+I3BhLxPPgu/f/R83UwkF5hR pbTjt2VV97GLHF+PIikK12zz0g== X-Google-Smtp-Source: APXvYqwiYqM7j5hu4DV6AcH1jSlAyaNnvYEXIuQgaMpPmee71iw6+EHk11WTPuiP7ld+cGVAOM7DBQ== X-Received: by 2002:a17:902:aa06:: with SMTP id be6mr4600314plb.224.1556038104254; Tue, 23 Apr 2019 09:48:24 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id h65sm58943277pfd.108.2019.04.23.09.48.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Apr 2019 09:48:22 -0700 (PDT) From: Stephen Hemminger To: bruce.richardson@intel.com Cc: dev@dpdk.org, Stephen Hemminger Date: Tue, 23 Apr 2019 09:48:11 -0700 Message-Id: <20190423164812.3427-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190423164812.3427-1-stephen@networkplumber.org> References: <20190423164812.3427-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 3/4] net/ring: use rte_calloc_socket 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use rte_calloc_socket instead of computing size. Signed-off-by: Stephen Hemminger --- drivers/net/ring/rte_eth_ring.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 2e4ca3b16a1c..0355f2b7c4d8 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -270,15 +270,15 @@ do_eth_dev_ring_create(const char *name, PMD_LOG(INFO, "Creating rings-backed ethdev on numa socket %u", numa_node); - rx_queues_local = rte_zmalloc_socket(name, - sizeof(void *) * nb_rx_queues, 0, numa_node); + rx_queues_local = rte_calloc_socket(name, nb_rx_queues, + sizeof(void *), 0, numa_node); if (rx_queues_local == NULL) { rte_errno = ENOMEM; goto error; } - tx_queues_local = rte_zmalloc_socket(name, - sizeof(void *) * nb_tx_queues, 0, numa_node); + tx_queues_local = rte_calloc_socket(name, nb_tx_queues, + sizeof(void *), 0, numa_node); if (tx_queues_local == NULL) { rte_errno = ENOMEM; goto error;