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 26EF6A0524; Thu, 6 May 2021 16:28:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1CF1B41198; Thu, 6 May 2021 16:26:16 +0200 (CEST) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by mails.dpdk.org (Postfix) with ESMTP id 65E314003F for ; Thu, 6 May 2021 16:26:11 +0200 (CEST) Received: by mail-lf1-f44.google.com with SMTP id z13so8101384lft.1 for ; Thu, 06 May 2021 07:26:11 -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=TZTIKLyavPOw4IMAhcUX7ZurVRsJzaPmEISAwtTj0vc8ePRrNL8DAEVOyHJK6Ze4DK zwk6q0FKYuG8h/VJmYQdIoM3KIezazmffLgxxClpxAgLBDy5zh5jUEM/7v63OAn2T5sh 23S1tnCSCMsaRS8BhlRUlTBCMKdxQ/pRV2H+XKiBNOjMPXuX9Cq5bD/o8oTit1lHPji0 Ck5SGtW0htknkCHa6yjWKBm8lY5F1c8MPLIgJr5IeNW05Jnv6ADI+NCeEnByqjJzNQCL h0lhfH5LlnXPIhM7jmNUBP4hvvADiHjjIcXAzUl+D9+4iRE4AjnBY1vkYRWJeGpIffhO YP8Q== 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=qJ75Owje3ZGkd2+ZMmYCYTRS1A2fRCilB6oToad2roHa6cSi73bvS2xxSjF0/fOv9w sskm4YdrbrXfyIg+TY4GZNIXiAocUUoQi8s2oAgzZGnfgu9INw9O7p8EvRpQl/Pa5HbA vMH0G2xhgkrwaF2/HmdGZ4uVyeRWUN3x9p/qxQGCfIER5hJVspH80lwjbPBzPAwbJtKs c8JgHvuDfM3sa92ipdDY9M3oUMZC/IIBQu6FF3RZUKQcPrrv9cSc72b9RzMhikFqGPys 5nAZNtZ5ZZ4gZbT2GT2tdeENYn1Cz9jEkqZXYlvrt/EsPBmhaeBd+5ukco7SqYZ3o25v vpAg== X-Gm-Message-State: AOAM5300KtqSq8U4my9shUqNJyGDHup68tIelaMxL1a7jaeoSam1E1Lp J/5zkCnpa+ws9oqtnwOua0NvdlpFdjjOpncC X-Google-Smtp-Source: ABdhPJyDZGMunzAuvua64pfnVubDUuK8d6jIHbdChe60zAo2f8j/wBISOYCdYPhBFrawDUnA2OyF6Q== X-Received: by 2002:ac2:5626:: with SMTP id b6mr3185499lff.147.1620311170742; Thu, 06 May 2021 07:26:10 -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 b40sm892908ljr.101.2021.05.06.07.26.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 07:26:10 -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: Thu, 6 May 2021 16:25:25 +0200 Message-Id: <20210506142526.28245-22-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210506142526.28245-1-mk@semihalf.com> References: <20210505073348.6394-1-mk@semihalf.com> <20210506142526.28245-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 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