From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DE6C4A04B1 for ; Thu, 5 Nov 2020 13:41:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2DE48C818; Thu, 5 Nov 2020 13:41:01 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 03675C31D for ; Thu, 5 Nov 2020 13:40:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604580057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/m2mWQD/MtdBamqzz0ZuoUK+vDhhX5Gu+2EFbgq7kHk=; b=c/ILy8kBK44hMpqVkGiTFSiuk6/qv4R8fxvvcFeo+P/lVBZmXXHGFaoP94txv+aVLn0ruO 0M+QoipEf3cTKZIMKtvfIXi1IWa1Lr+eMICXRQgRTAppHsq1tkM5OdBuTZO5UeNz63Gqo1 xyQSIiljrYBEL+C+Nl4iVZw55IgNjgY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-404-93uERv1XPEW7ONQ6xAFhOg-1; Thu, 05 Nov 2020 07:40:54 -0500 X-MC-Unique: 93uERv1XPEW7ONQ6xAFhOg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C8F5D186DD32; Thu, 5 Nov 2020 12:40:53 +0000 (UTC) Received: from rh.redhat.com (ovpn-113-249.ams2.redhat.com [10.36.113.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id C15985C5FD; Thu, 5 Nov 2020 12:40:52 +0000 (UTC) From: Kevin Traynor To: Heinrich Kuhn Cc: Simon Horman , dpdk stable Date: Thu, 5 Nov 2020 12:39:21 +0000 Message-Id: <20201105124015.306404-14-ktraynor@redhat.com> In-Reply-To: <20201105124015.306404-1-ktraynor@redhat.com> References: <20201105124015.306404-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-stable] patch 'net/nfp: expand device info get' has been queued to LTS release 18.11.11 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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" Hi, FYI, your patch has been queued to LTS release 18.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/10/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/edcfebc80660df852fabf7bb7ef62c10b87c7d49 Thanks. Kevin. --- >From edcfebc80660df852fabf7bb7ef62c10b87c7d49 Mon Sep 17 00:00:00 2001 From: Heinrich Kuhn Date: Wed, 2 Sep 2020 13:52:27 +0200 Subject: [PATCH] net/nfp: expand device info get [ upstream commit 69a0f8750aa349ed27fa7b635e2b47f74f11431a ] Report Rx and Tx descriptor related limitations in the nfp dev_info_get callback function. This commit also adds NFP_ALIGN_RING_DESC to replace a static integer value used during rx/tx queue setups to validate descriptor alignment. Signed-off-by: Heinrich Kuhn Signed-off-by: Simon Horman --- drivers/net/nfp/nfp_net.c | 30 ++++++++++++++++++++++++------ drivers/net/nfp/nfp_net_pmd.h | 6 ++++++ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index e1034b2f43..c126084728 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1202,4 +1202,18 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) }; + dev_info->rx_desc_lim = (struct rte_eth_desc_lim) { + .nb_max = NFP_NET_MAX_RX_DESC, + .nb_min = NFP_NET_MIN_RX_DESC, + .nb_align = NFP_ALIGN_RING_DESC, + }; + + dev_info->tx_desc_lim = (struct rte_eth_desc_lim) { + .nb_max = NFP_NET_MAX_TX_DESC, + .nb_min = NFP_NET_MIN_TX_DESC, + .nb_align = NFP_ALIGN_RING_DESC, + .nb_seg_max = NFP_TX_MAX_SEG, + .nb_mtu_seg_max = NFP_TX_MAX_MTU_SEG, + }; + dev_info->flow_type_rss_offloads = ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP | @@ -1463,4 +1477,5 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev, struct nfp_net_rxq *rxq; struct nfp_net_hw *hw; + uint32_t rx_desc_sz; hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1469,7 +1484,8 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev, /* Validating number of descriptors */ - if (((nb_desc * sizeof(struct nfp_net_rx_desc)) % 128) != 0 || - (nb_desc > NFP_NET_MAX_RX_DESC) || - (nb_desc < NFP_NET_MIN_RX_DESC)) { + rx_desc_sz = nb_desc * sizeof(struct nfp_net_rx_desc); + if (rx_desc_sz % NFP_ALIGN_RING_DESC != 0 || + nb_desc > NFP_NET_MAX_RX_DESC || + nb_desc < NFP_NET_MIN_RX_DESC) { PMD_DRV_LOG(ERR, "Wrong nb_desc value"); return -EINVAL; @@ -1610,4 +1626,5 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t tx_free_thresh; struct nfp_net_hw *hw; + uint32_t tx_desc_sz; hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1616,7 +1633,8 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, /* Validating number of descriptors */ - if (((nb_desc * sizeof(struct nfp_net_tx_desc)) % 128) != 0 || - (nb_desc > NFP_NET_MAX_TX_DESC) || - (nb_desc < NFP_NET_MIN_TX_DESC)) { + tx_desc_sz = nb_desc * sizeof(struct nfp_net_tx_desc); + if (tx_desc_sz % NFP_ALIGN_RING_DESC != 0 || + nb_desc > NFP_NET_MAX_TX_DESC || + nb_desc < NFP_NET_MIN_TX_DESC) { PMD_DRV_LOG(ERR, "Wrong nb_desc value"); return -EINVAL; diff --git a/drivers/net/nfp/nfp_net_pmd.h b/drivers/net/nfp/nfp_net_pmd.h index d70cbc634c..c14da958c7 100644 --- a/drivers/net/nfp/nfp_net_pmd.h +++ b/drivers/net/nfp/nfp_net_pmd.h @@ -60,4 +60,10 @@ struct nfp_net_adapter; #define NFP_NET_MIN_RX_DESC 64 +/* Descriptor alignment */ +#define NFP_ALIGN_RING_DESC 128 + +#define NFP_TX_MAX_SEG UINT8_MAX +#define NFP_TX_MAX_MTU_SEG 8 + /* Bar allocation */ #define NFP_NET_CRTL_BAR 0 -- 2.26.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-05 12:38:54.528401356 +0000 +++ 0014-net-nfp-expand-device-info-get.patch 2020-11-05 12:38:54.175895969 +0000 @@ -1 +1 @@ -From 69a0f8750aa349ed27fa7b635e2b47f74f11431a Mon Sep 17 00:00:00 2001 +From edcfebc80660df852fabf7bb7ef62c10b87c7d49 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 69a0f8750aa349ed27fa7b635e2b47f74f11431a ] + @@ -11,2 +12,0 @@ -Cc: stable@dpdk.org - @@ -21 +21 @@ -index 2d20d4ce94..f5e4cd339d 100644 +index e1034b2f43..c126084728 100644 @@ -24 +24 @@ -@@ -1251,4 +1251,18 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) +@@ -1202,4 +1202,18 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) @@ -43 +43 @@ -@@ -1514,4 +1528,5 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev, +@@ -1463,4 +1477,5 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev, @@ -49 +49 @@ -@@ -1520,7 +1535,8 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev, +@@ -1469,7 +1484,8 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev, @@ -61 +61 @@ -@@ -1661,4 +1677,5 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, +@@ -1610,4 +1626,5 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, @@ -67 +67 @@ -@@ -1667,7 +1684,8 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, +@@ -1616,7 +1633,8 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, @@ -80 +80 @@ -index cb2d19afe6..1295c5959e 100644 +index d70cbc634c..c14da958c7 100644 @@ -83 +83 @@ -@@ -34,4 +34,10 @@ struct nfp_net_adapter; +@@ -60,4 +60,10 @@ struct nfp_net_adapter;