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 85D2BA0C43; Tue, 19 Oct 2021 12:57:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 928934116C; Tue, 19 Oct 2021 12:56:58 +0200 (CEST) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by mails.dpdk.org (Postfix) with ESMTP id B1B0B40E2D for ; Tue, 19 Oct 2021 12:56:53 +0200 (CEST) Received: by mail-lf1-f41.google.com with SMTP id j21so6680720lfe.0 for ; Tue, 19 Oct 2021 03:56:53 -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=44YGPMrWQvHuqAHh4jzQz7mEbTtGS1t5NW47AO60PA8=; b=AkkHk9fS4muEgkUA+QuT04gXuG0t5AWrQBuKU5VdLMlOYVZUwTXZSb84BKgJnWfaJ/ X0EkvOMzVpul3dmnyNRgRGdnwaAwWVtQ/NjvsZs8FRYfZvUmZPrz/pd7Pb4pfUNtK9wS +wxnRF/Gk6AS+QXpmDYwnzC3u0pH/cU+llWSOGFqIZxlgarbERptAAas+bzvpS0qNTbX RhPdsZlJOTtiUUKD4eVNWXQ+cNFVcQEt31UyJx3EpQMcs/PD1OQZjGDKFmaot6sEazXh VKVGePss0zZhujpCuqO0Ts/DMZ6D9zQjLGDV6llV5TJV3J/dutGXNHHxJqOBzfltxYrW 2a6Q== 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=44YGPMrWQvHuqAHh4jzQz7mEbTtGS1t5NW47AO60PA8=; b=3/Rl+jSIZ2te6YEW+QGnHsf6dkL5+rCKc31kX9ILiSPE/zULckGoh9z/vzIEcfuhsH jllPYFkpjXN7IfkTYCFR1bVr9kIjny3TfXqpq1jEDJUQcdwVQaF8BfxFkrNre/E8xjcJ MVk0jKrfYFOESVif61eeGNKyLKeqZWPzqdd5NyA5oA4kqc5D1B/OCR7GM/1kbMjs3q0S H4Bnuviaw9HDOGErlDWMP5hgNjfAenl4k5lzi8zFxxoF7o2moozvL1nr63kWO8z32aN7 FNNWfCMa5X55KRYSQXSeohMwhIgPv7XDHMpm3de0rCULASh9aVdgxP7cL98/AOUnfNAN Hjxw== X-Gm-Message-State: AOAM530vd5yVbKsOfXBdVpQnb8HnySCtxoM/OYvbTFaaQgD89xLd0c5U MQheEtaCATrD6zFRq9kjCdT28Q== X-Google-Smtp-Source: ABdhPJxXMszRDX6qs2O6VENQ7HWvjz/emYQ659iFyMFzSTdO041+cezPU5szQrEbN1mk1WqnlyKPFw== X-Received: by 2002:ac2:5ed9:: with SMTP id d25mr5413895lfq.612.1634641013285; Tue, 19 Oct 2021 03:56:53 -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 bn17sm1496058ljb.4.2021.10.19.03.56.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Oct 2021 03:56:52 -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: Tue, 19 Oct 2021 12:56:27 +0200 Message-Id: <20211019105629.11731-6-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211019105629.11731-1-mk@semihalf.com> References: <20211015162701.16324-1-mk@semihalf.com> <20211019105629.11731-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 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 8341d979aa..6ac867321b 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -108,6 +108,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 94dbb3164e..4e9925b6be 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1165,19 +1165,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"); @@ -1186,9 +1187,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); @@ -1270,19 +1272,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"); @@ -1291,9 +1294,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