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 2050AA0524; Wed, 5 May 2021 09:37:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6121F41196; Wed, 5 May 2021 09:34:31 +0200 (CEST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mails.dpdk.org (Postfix) with ESMTP id EC47D41185 for ; Wed, 5 May 2021 09:34:26 +0200 (CEST) Received: by mail-wm1-f42.google.com with SMTP id g65so793704wmg.2 for ; Wed, 05 May 2021 00:34:26 -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=OVjiNi3rEM6c2TPW5cj3QlpdyHt7FsIV4QxsJDBzno0=; b=OE+k6kTZhBQFDhDvxraYlbAXb6mW4wI5NcBGUuIGbkBP/pF9PaI/opelQhVxglEZLT PbVpC3bbzRBlKZJp4YFqpYiqLHZsnyBfqL4JeUz6b/0u+mrSbel+tKyIyyIUjIbSKaHZ O2wDUBQviLlYQ4XrnE6IblzfAT3gHc1v/gyYybPre9+8EwMPHR8Dqp2zIoyH57POsb36 aRl2RIqrYfHpriKvWKtIvxXD/DXSzyj/LSNKiRXbvtIhi2halxzFbcwcq4EQJjfe+6nh FDGP8pQK1fmU/6xSEBsTQI0m4s+iG1Bqs0+qNX7HRB+IAXt5WmmGc4jeXoW0dO9YWw6D NGiw== 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=OVjiNi3rEM6c2TPW5cj3QlpdyHt7FsIV4QxsJDBzno0=; b=A6hXNZw10UawyRlZy3b4vXP47O/R+fNHF6BprlU5upvNUTDskF83MbRyW+KIbX94iF fQzt7a94jlBaZqUU8wqKjwIMt//TE9skWcdeTOPP65vkanLpG7gPe4QvIyiX881GVDIb BZwFScaMOr+60QFzpn0bsn1VY7uevkbMKgf4EX1cc/f1uqrgw2khhoHDxPJf7K1cf0PL bvobNwtRT89iG77zcbe9MDKoXUTBtOqu/nGJ2ermdsORkUX21SldzdJlpYp8zwEBXKBa YB+d8uiwVbrfwHiflyitTpPAOWerrZq59Pj++fOz99uuGfUMHNm66GNLQLe8V+a1bg7o Gb+Q== X-Gm-Message-State: AOAM533lhcJykseVARdMaWRhVuGiS4a+PUSJkZTnkJYn+X4EAUvOd5aD o/zwDVyPmojaehmQl6gVmJjZ8OyvUP2mHtTL X-Google-Smtp-Source: ABdhPJzceO0UOj/ZZt2sWc0kICWvRLnK0eNVvVaBrzKas9qKWqsXyiDWvYfudmoBWjdL/0E/vIN/UQ== X-Received: by 2002:a1c:5945:: with SMTP id n66mr32113501wmb.139.1620200066286; Wed, 05 May 2021 00:34:26 -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 t17sm4679856wmq.12.2021.05.05.00.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 00:34:25 -0700 (PDT) From: Michal Krawczyk To: dev@dpdk.org Cc: ndagan@amazon.com, gtzalik@amazon.com, igorch@amazon.com, upstream@semihalf.com, Stanislaw Kardach , stable@dpdk.org, Michal Krawczyk , Shay Agroskin Date: Wed, 5 May 2021 09:33:47 +0200 Message-Id: <20210505073348.6394-22-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505073348.6394-1-mk@semihalf.com> References: <20210430125725.28796-1-mk@semihalf.com> <20210505073348.6394-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 21/22] 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 --- drivers/net/ena/ena_ethdev.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 73e99e956a..c5d8e7d43e 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1294,9 +1294,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; @@ -1368,9 +1365,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", @@ -2130,6 +2124,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