From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7465BA0C47; Thu, 14 Oct 2021 22:20:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E06914117D; Thu, 14 Oct 2021 22:19:41 +0200 (CEST) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by mails.dpdk.org (Postfix) with ESMTP id BB62941168 for ; Thu, 14 Oct 2021 22:19:37 +0200 (CEST) Received: by mail-lf1-f44.google.com with SMTP id u21so28839083lff.8 for ; Thu, 14 Oct 2021 13:19:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uavg0vSpj0LmrzxQi9UyE5O6E7d3TZGmp/W5T/+IQFc=; b=DrBP9qZOKu1TGIBSYXHnvrZMrBfCCkqUO0DZGai8wNGGqyaNaGRXxwy1Ut3nW8hZpC LTNEMPuf/+llgVOcDmxtK3U2WH6fvFZdTUHwj9YcgpPHc5/3BN0kACHTLe3YgpAv7C+a sSmZW4lHKdDrPH5KRI+u+r9OsyKVLgq2ZXZL0d3R8eho/hUge0H1Y9ne3hkd3g3/tvSS LstcxQyQ4MZt/OwaKEwXiStAlNDIpL7FM3sVo5FwVt0tzRi7QGMsWF7qv9hu5GG8kSR5 YLcAb3kGqggR+olJT2g/i9lGqrFMkTe5iWwQYZ80AIAjF6tBzi8a4JEQQxuHxAEnsB1z vr9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uavg0vSpj0LmrzxQi9UyE5O6E7d3TZGmp/W5T/+IQFc=; b=1E9evM9EQR3WUIvaoMEOSC9QiBdVdnwyjkAh/+L91yxo2xiqabD0rsCwBKiIbvxjJN sKePDwllTwb1cQ1v6tmzbxlnR36l+DgdTMlNS5kAiT865ei5xFuIun4AK/6VS5/0bgRp 5psXYGmd0gfNnIJh6j1drRa3Pju2a9G8W0owSV8dFalE01ZZFEtzVH0XajHVgP3E3rj1 V9/uNPF+hHql4vgItVgiF24lAozClnY+i3TBnwmPpsDFCACW5eIvy2So3Jp8KKwqU+/a 25y8SCRipO4V6vZ+4c28Y1W/0tj6iRqtG9ibC3kJNxw4s0Eqwe900D4myJe6izJmrYJz R8LA== X-Gm-Message-State: AOAM530tb8l4oSdinRFUQCpaQmdWpNKfl2Ea1bu5k/43dOjuhNlNPU8S d9VJ2tEowe6iv5tt5wX2LRjRiQ== X-Google-Smtp-Source: ABdhPJxLoo3reYQ2P8U9QhgyicdAnl4jFnZGAauNO2fVy060t5z/IP7kv7NrKgZfj7k0VrOnxa8f3g== X-Received: by 2002:a05:651c:1596:: with SMTP id h22mr8641777ljq.405.1634242777427; Thu, 14 Oct 2021 13:19:37 -0700 (PDT) Received: from DESKTOP-U5LNN3J.localdomain (89-79-181-52.dynamic.chello.pl. [89.79.181.52]) by smtp.gmail.com with ESMTPSA id y25sm308073lfg.179.2021.10.14.13.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 13:19:36 -0700 (PDT) From: Michal Krawczyk To: ferruh.yigit@intel.com Cc: dev@dpdk.org, upstream@semihalf.com, shaibran@amazon.com, ndagan@amazon.com, igorch@amazon.com, Michal Krawczyk Date: Thu, 14 Oct 2021 22:18:56 +0200 Message-Id: <20211014201858.9571-6-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211014201858.9571-1-mk@semihalf.com> References: <20211014201858.9571-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 5/7] net/ena: add NUMA aware allocations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Only the IO rings memory was allocated with taking the socket ID into the respect, while the other structures was allocated using the regular rte_zmalloc() API. Ring specific structures are now being allocated using the ring's socket ID. Signed-off-by: Michal Krawczyk Reviewed-by: Igor Chauskin Reviewed-by: Shai Brandes --- doc/guides/rel_notes/release_21_11.rst | 1 + drivers/net/ena/ena_ethdev.c | 42 ++++++++++++++------------ 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 45d5cbdc78..c87862e713 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -99,6 +99,7 @@ New Features bug fixes and improvements, including: * Support for the tx_free_thresh and rx_free_thresh configuration parameters. + * NUMA aware allocations for the queue helper structures. * **Updated Broadcom bnxt PMD.** diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 628595e5f3..add6513a15 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1177,19 +1177,20 @@ static int ena_tx_queue_setup(struct rte_eth_dev *dev, txq->numa_socket_id = socket_id; txq->pkts_without_db = false; - txq->tx_buffer_info = rte_zmalloc("txq->tx_buffer_info", - sizeof(struct ena_tx_buffer) * - txq->ring_size, - RTE_CACHE_LINE_SIZE); + txq->tx_buffer_info = rte_zmalloc_socket("txq->tx_buffer_info", + sizeof(struct ena_tx_buffer) * txq->ring_size, + RTE_CACHE_LINE_SIZE, + socket_id); if (!txq->tx_buffer_info) { PMD_DRV_LOG(ERR, "Failed to allocate memory for Tx buffer info\n"); return -ENOMEM; } - txq->empty_tx_reqs = rte_zmalloc("txq->empty_tx_reqs", - sizeof(u16) * txq->ring_size, - RTE_CACHE_LINE_SIZE); + txq->empty_tx_reqs = rte_zmalloc_socket("txq->empty_tx_reqs", + sizeof(uint16_t) * txq->ring_size, + RTE_CACHE_LINE_SIZE, + socket_id); if (!txq->empty_tx_reqs) { PMD_DRV_LOG(ERR, "Failed to allocate memory for empty Tx requests\n"); @@ -1198,9 +1199,10 @@ static int ena_tx_queue_setup(struct rte_eth_dev *dev, } txq->push_buf_intermediate_buf = - rte_zmalloc("txq->push_buf_intermediate_buf", - txq->tx_max_header_size, - RTE_CACHE_LINE_SIZE); + rte_zmalloc_socket("txq->push_buf_intermediate_buf", + txq->tx_max_header_size, + RTE_CACHE_LINE_SIZE, + socket_id); if (!txq->push_buf_intermediate_buf) { PMD_DRV_LOG(ERR, "Failed to alloc push buffer for LLQ\n"); rte_free(txq->tx_buffer_info); @@ -1282,19 +1284,20 @@ static int ena_rx_queue_setup(struct rte_eth_dev *dev, rxq->numa_socket_id = socket_id; rxq->mb_pool = mp; - rxq->rx_buffer_info = rte_zmalloc("rxq->buffer_info", + rxq->rx_buffer_info = rte_zmalloc_socket("rxq->buffer_info", sizeof(struct ena_rx_buffer) * nb_desc, - RTE_CACHE_LINE_SIZE); + RTE_CACHE_LINE_SIZE, + socket_id); if (!rxq->rx_buffer_info) { PMD_DRV_LOG(ERR, "Failed to allocate memory for Rx buffer info\n"); return -ENOMEM; } - rxq->rx_refill_buffer = rte_zmalloc("rxq->rx_refill_buffer", - sizeof(struct rte_mbuf *) * nb_desc, - RTE_CACHE_LINE_SIZE); - + rxq->rx_refill_buffer = rte_zmalloc_socket("rxq->rx_refill_buffer", + sizeof(struct rte_mbuf *) * nb_desc, + RTE_CACHE_LINE_SIZE, + socket_id); if (!rxq->rx_refill_buffer) { PMD_DRV_LOG(ERR, "Failed to allocate memory for Rx refill buffer\n"); @@ -1303,9 +1306,10 @@ static int ena_rx_queue_setup(struct rte_eth_dev *dev, return -ENOMEM; } - rxq->empty_rx_reqs = rte_zmalloc("rxq->empty_rx_reqs", - sizeof(uint16_t) * nb_desc, - RTE_CACHE_LINE_SIZE); + rxq->empty_rx_reqs = rte_zmalloc_socket("rxq->empty_rx_reqs", + sizeof(uint16_t) * nb_desc, + RTE_CACHE_LINE_SIZE, + socket_id); if (!rxq->empty_rx_reqs) { PMD_DRV_LOG(ERR, "Failed to allocate memory for empty Rx requests\n"); -- 2.25.1