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 D98DBA034F; Fri, 15 Oct 2021 18:28:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3DBE4411CE; Fri, 15 Oct 2021 18:27:54 +0200 (CEST) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mails.dpdk.org (Postfix) with ESMTP id 51F944115F for ; Fri, 15 Oct 2021 18:27:51 +0200 (CEST) Received: by mail-lf1-f52.google.com with SMTP id x27so43649999lfa.9 for ; Fri, 15 Oct 2021 09:27:51 -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=3iwXqWQPuyX9OMz0Cy/i37RGmE9RJZ10GdeOHpa+074=; b=kgPNfxXNoj2l4XdrJVyGu6wOp/1xjI2d15dr8Jqj+NorWTe5aaU1hcwMgD4J8UFRcW xJ6q5znqSNxgM3lf0e3mL3iioK0z3mr2INa+Ny/brJM7BdSJ7yipOynFd/XkC/FCak8G wez391F2JHLaBWRa1P/AqYmk5zRV3CqIvbru1fiV8w/AR808nP/tGW1d8ntojGtVvW33 7ZN3bGs0bBQy8a+81KUD486r7v50wz5hkR28mjXU2UrcgN7SOZ+9GE48EJsO6cWdHJj6 CazzcOKP37H5GPx3a6pwSG4fZ3SGW/mu823mPhsY4RVER7XI+vRP+7+PfRHxJZu5NNsu NyVw== 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=3iwXqWQPuyX9OMz0Cy/i37RGmE9RJZ10GdeOHpa+074=; b=zC/wFrDVKAi7RLajjXCQwa21QZQ+XcIzlRByOTvOnJgoLjeJcgna3bAlhJSWOywQjO 01RGQ1ZjyAoFrmq6cmvhPZjYfiaAyM2XBFFLSoqnetjIul5GQvCLh1X43ok6BMsJbRgO poK+ui+6MplDc01Uq788DxuHMgeupA+OJZyH2Fb4NS4iXPWb7QGejM41/X1n5yR4WWsN AiNRwJtMbCFwUQcKQhJ5crMsLazOjzzTtgnrL9PHQbVo8l6rxOE7LCww+gp+rBDi7Vuy 91PyPEcCYOcWglJycEyPu9jQwSxRgMv2Yi2Goh83Wl8vxMY9t4S3Ip7WgIorGholHdLQ /scg== X-Gm-Message-State: AOAM530aujkGpqZ5ylfrQqiwI2CwmTR8P+fEo2L7Fql8yCmCg/VfgaQy UG2dXqfLhdS71JvdG3+i2k+hag== X-Google-Smtp-Source: ABdhPJx+u1112J0Tzczfhi0oXjH5TEODE9lLHRjrMkpqn+GabupbAQr74jN6wB7PtgnuEF9jkXYHCg== X-Received: by 2002:a05:6512:984:: with SMTP id w4mr12117413lft.141.1634315270626; Fri, 15 Oct 2021 09:27:50 -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 b3sm559219lfe.58.2021.10.15.09.27.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 09:27:50 -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: Fri, 15 Oct 2021 18:26:59 +0200 Message-Id: <20211015162701.16324-6-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211015162701.16324-1-mk@semihalf.com> References: <20211014201858.9571-1-mk@semihalf.com> <20211015162701.16324-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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 35db2e8356..e31cb0b65c 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