From patchwork Tue May 11 06:45:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Krawczyk X-Patchwork-Id: 93146 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5353EA0C41; Tue, 11 May 2021 08:48:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC41E41187; Tue, 11 May 2021 08:46:41 +0200 (CEST) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mails.dpdk.org (Postfix) with ESMTP id 39B744116A for ; Tue, 11 May 2021 08:46:36 +0200 (CEST) Received: by mail-lf1-f48.google.com with SMTP id a2so6043743lfc.9 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=rMOp4K829foEjY8PkQKxZEoM9FTfnFuvaLR6rrPYCGT7+DJRAD9ALlgzDVDmHqJcaM XyayNYpQWBG4dZvm4i4PPGpCryIQ22jp6bC9gbZGEsCiosYsWfzngQepF/weVYk+t9WD AqZwroA+cm5Ieqc2i9Qncb+H3SmrBAJaRF50ZbJfDY/gxI3SWbyoPbcIUt7lR8odXmB1 kBh3Tb+L3vUr0dZTjlu5KNwy6p0QEKygZnTs0wwPTYMe3wyDlGF3NSj94Wte/RtWLbLk GLMWWqivWSk5bm6p+lHm0f9s9lB7CK77nP2Bwq55PdtaS5YxvpxSsHTvTW6dzIZXs631 u4Qg== X-Gm-Message-State: AOAM533ZmuJ6hzvP4vuGUYR6pa+3gCzBIiRGlHepZCWFetRN+xwh/iE6 LLjbq65kzy/iVTfYEiadpfRnCg== 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 Subject: [dpdk-dev] [PATCH v4 18/19] net/ena: report default ring size 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" 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; }