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 8D052A0C41 for ; Tue, 11 May 2021 08:46:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A4DBC41183; Tue, 11 May 2021 08:46:41 +0200 (CEST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mails.dpdk.org (Postfix) with ESMTP id 3AA244116B for ; Tue, 11 May 2021 08:46:36 +0200 (CEST) Received: by mail-lf1-f50.google.com with SMTP id x19so27078022lfa.2 for ; Mon, 10 May 2021 23:46:36 -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 :mime-version:content-transfer-encoding; bh=incR0NTCFG47GrErbWDRkiNmTglIzII58kgCssj2WvQ=; b=Tk0f73W1XV3UNzpQjy5je6jBOxIAIBIlUYSsRczQ6tgn6tFG51ByxdZMxFBWlFn7zk WnY9IgAn9YJLbgOy2nRYSw52CHZypKEMqGajbvAm5ymSwaouguD7h4TOrfirtswNBRSE sM3+P99+AfYmYwZzFOJqWEO4y84Cdl0/26yxB0+5l2DZQzufXORovS94Ug4qMxT4SvdA 4fMk3a6Un0QvuHy7bl9BJozLPCDHXvEnLtOeCAiEMxDFAVAMXojG1SEvVSXhTn8crQcJ 0EpjTkBCi/UGUyPxrJUSGVMw/Hwtz7q4Igl4BjG02zdJLE2D+18vwwytslQ49NVmsRrX 6qdw== 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=incR0NTCFG47GrErbWDRkiNmTglIzII58kgCssj2WvQ=; b=TgCySr4m2o4Acvf1ZPzio9PchX/MV+NyABE585SqOxh0mCLxpLg7B5mCqHeVNIaE/N QF9CNJOrqt2z/X8ImvvFgjF6VCWwm7o4D4axiWNsi8mHZEPv4VWpebfJfDDiPZXgM5eG Zqz/ZGCIK/L+GWgT0Hk4gy8Q9Cfyimn7ZWOB699q7x+mYQMcU5VYeD8uxxTktwkIFyLw 2hlU5MN/STRtMxlzvr2EwK9iaDubFW79GNwnj+ZnbX8pdKWhP3n+VFp05fdtpnLptFD9 2ktLYCQQX7PyS3GywxN+L824V2N2ZbBJ+DutHC+cJrD84cQjZ3c3jTtmg8m5XxMesfmF xxew== X-Gm-Message-State: AOAM532/FxrLH5fyoN7BhEU2o1N87UliUuHor5dkUwRjvwlZjg6GxRKn 4uN7yDp8nJnVvicWdZsHol+dWg== X-Google-Smtp-Source: ABdhPJztxfv4cKbudpx4Z5aeXalzJGeUHCo3mko3D7CjNYrBR7xGlZbIwZNjROo/5BrO0ZXPnUb3Fg== X-Received: by 2002:a05:6512:1190:: with SMTP id g16mr20747129lfr.342.1620715595903; Mon, 10 May 2021 23:46:35 -0700 (PDT) Received: from DESKTOP-U5LNN3J.localdomain (89-79-189-199.dynamic.chello.pl. [89.79.189.199]) by smtp.gmail.com with ESMTPSA id v20sm2496776lfd.92.2021.05.10.23.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 23:46:35 -0700 (PDT) From: Michal Krawczyk To: ferruh.yigit@intel.com Cc: dev@dpdk.org, ndagan@amazon.com, gtzalik@amazon.com, igorch@amazon.com, upstream@semihalf.com, Stanislaw Kardach , stable@dpdk.org, Michal Krawczyk , Shay Agroskin Date: Tue, 11 May 2021 08:45:53 +0200 Message-Id: <20210511064554.10656-19-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210511064554.10656-1-mk@semihalf.com> References: <87e65a42-4ae5-1a81-8f8e-74759fc14999@intel.com> <20210511064554.10656-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v4 18/19] net/ena: report default ring size X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Stanislaw Kardach Remove invalid ring size alignment logic and add default rx and tx port ring sizes to the device info spec. The logic in lines 1297 and 1371 is invalid. The RTE_ETH_DEV_FALLBACK_RX_RINGSIZE (and the TX counterpart) is a value that rte_eth_rx_queue_setup() will set if dev_info.default_rxportconf.ring_size is 0 and user provided 0 in nb_rx_desc argument. However the current code treats it as a hint for the PMD to change the ring size to internal defaults. Additionally since the ENA_DEFAULT_RING_SIZE is defined, report it in the device capabilities so that both rte_ethdev code and the user can utilize it for device configuration. Fixes: ea93d37eb49d ("net/ena: add HW queues depth setup") Cc: stable@dpdk.org Signed-off-by: Stanislaw Kardach Reviewed-by: Michal Krawczyk Reviewed-by: Igor Chauskin Reviewed-by: Shay Agroskin --- v4: * Add release notes. doc/guides/rel_notes/release_21_05.rst | 1 + drivers/net/ena/ena_ethdev.c | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst index 389a7a05ac..f6c566f05c 100644 --- a/doc/guides/rel_notes/release_21_05.rst +++ b/doc/guides/rel_notes/release_21_05.rst @@ -211,6 +211,7 @@ New Features * Updated ena_com (HAL) to the latest version. * Fixed bugs when requesting large LLQ headers using the devargs. * Added indication of the RSS hash presence in the mbuf. + * Fixed bug when the default ring size was set. * **Added support of multiple data-units in cryptodev API.** diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 21bea98007..cb2c93052a 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1300,9 +1300,6 @@ static int ena_tx_queue_setup(struct rte_eth_dev *dev, return -EINVAL; } - if (nb_desc == RTE_ETH_DEV_FALLBACK_TX_RINGSIZE) - nb_desc = adapter->max_tx_ring_size; - txq->port_id = dev->data->port_id; txq->next_to_clean = 0; txq->next_to_use = 0; @@ -1374,9 +1371,6 @@ static int ena_rx_queue_setup(struct rte_eth_dev *dev, return ENA_COM_FAULT; } - if (nb_desc == RTE_ETH_DEV_FALLBACK_RX_RINGSIZE) - nb_desc = adapter->max_rx_ring_size; - if (!rte_is_power_of_2(nb_desc)) { PMD_DRV_LOG(ERR, "Unsupported size of RX queue: %d is not a power of 2.\n", @@ -2096,6 +2090,9 @@ static int ena_infos_get(struct rte_eth_dev *dev, dev_info->tx_desc_lim.nb_mtu_seg_max = RTE_MIN(ENA_PKT_MAX_BUFS, adapter->max_tx_sgl_size); + dev_info->default_rxportconf.ring_size = ENA_DEFAULT_RING_SIZE; + dev_info->default_txportconf.ring_size = ENA_DEFAULT_RING_SIZE; + return 0; } -- 2.25.1