[dpdk-stable] patch 'net/nfp: expand device info get' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 28 11:43:16 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/30/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.

Thanks.

Luca Boccassi

---
>From c7f41e206d1219ab92f79a0d53c048e604ffb491 Mon Sep 17 00:00:00 2001
From: Heinrich Kuhn <heinrich.kuhn at netronome.com>
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 <heinrich.kuhn at netronome.com>
Signed-off-by: Simon Horman <simon.horman at netronome.com>
---
 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 082aa46825..54ea66b9d4 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -1250,6 +1250,20 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		.tx_rs_thresh = DEFAULT_TX_RSBIT_THRESH,
 	};
 
+	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 |
 					   ETH_RSS_NONFRAG_IPV4_UDP |
@@ -1513,15 +1527,17 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev,
 	const struct rte_memzone *tz;
 	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);
 
 	PMD_INIT_FUNC_TRACE();
 
 	/* 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;
 	}
@@ -1660,15 +1676,17 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	struct nfp_net_txq *txq;
 	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);
 
 	PMD_INIT_FUNC_TRACE();
 
 	/* 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 cc1055c49a..466a11aca2 100644
--- a/drivers/net/nfp/nfp_net_pmd.h
+++ b/drivers/net/nfp/nfp_net_pmd.h
@@ -33,6 +33,12 @@ struct nfp_net_adapter;
 #define NFP_NET_MAX_RX_DESC (32 * 1024)
 #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
 #define NFP_NET_TX_BAR          2
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:12.941426071 +0000
+++ 0037-net-nfp-expand-device-info-get.patch	2020-10-28 10:35:11.484829729 +0000
@@ -1,15 +1,15 @@
-From 69a0f8750aa349ed27fa7b635e2b47f74f11431a Mon Sep 17 00:00:00 2001
+From c7f41e206d1219ab92f79a0d53c048e604ffb491 Mon Sep 17 00:00:00 2001
 From: Heinrich Kuhn <heinrich.kuhn at netronome.com>
 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.
 
-Cc: stable at dpdk.org
-
 Signed-off-by: Heinrich Kuhn <heinrich.kuhn at netronome.com>
 Signed-off-by: Simon Horman <simon.horman at netronome.com>
 ---
@@ -18,7 +18,7 @@
  2 files changed, 30 insertions(+), 6 deletions(-)
 
 diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
-index 2d20d4ce94..f5e4cd339d 100644
+index 082aa46825..54ea66b9d4 100644
 --- a/drivers/net/nfp/nfp_net.c
 +++ b/drivers/net/nfp/nfp_net.c
 @@ -1250,6 +1250,20 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
@@ -85,7 +85,7 @@
  		return -EINVAL;
  	}
 diff --git a/drivers/net/nfp/nfp_net_pmd.h b/drivers/net/nfp/nfp_net_pmd.h
-index cb2d19afe6..1295c5959e 100644
+index cc1055c49a..466a11aca2 100644
 --- a/drivers/net/nfp/nfp_net_pmd.h
 +++ b/drivers/net/nfp/nfp_net_pmd.h
 @@ -33,6 +33,12 @@ struct nfp_net_adapter;


More information about the stable mailing list