DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jin Liu <jin.liu@corigine.com>
To: dev@dpdk.org
Cc: niklas.soderlund@corigine.com, Jin Liu <jin.liu@corigine.com>,
	Diana Wang <na.wang@corigine.com>,
	Peng Zhang <peng.zhang@corigine.com>,
	Chaoyong He <chaoyong.he@corigine.com>
Subject: [PATCH v4 13/13] net/nfp: modify RSS logic
Date: Thu, 23 Jun 2022 04:26:15 +0200	[thread overview]
Message-ID: <20220623022615.3628093-14-jin.liu@corigine.com> (raw)
In-Reply-To: <20220623022615.3628093-1-jin.liu@corigine.com>

Now NFP NIC support two type of RSS logic, NFP_NET_CFG_CTRL_RSS and
NFP_NET_CFG_CTRL_RSS2, use NFP_NET_CFG_CTRL_RSS2 if NIC capability
support, otherwise use NFP_NET_CFG_CTRL_RSS.

Signed-off-by: Jin Liu <jin.liu@corigine.com>
Signed-off-by: Diana Wang <na.wang@corigine.com>
Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_common.c    | 12 ++++++------
 drivers/net/nfp/nfp_ctrl.h      |  1 +
 drivers/net/nfp/nfp_ethdev.c    |  5 ++++-
 drivers/net/nfp/nfp_ethdev_vf.c |  5 ++++-
 drivers/net/nfp/nfp_rxtx.c      |  2 +-
 5 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c
index 755c5ec4d9..0e55f0c792 100644
--- a/drivers/net/nfp/nfp_common.c
+++ b/drivers/net/nfp/nfp_common.c
@@ -171,7 +171,7 @@ nfp_net_configure(struct rte_eth_dev *dev)
 
 	/* Checking RX mode */
 	if (rxmode->mq_mode & RTE_ETH_MQ_RX_RSS &&
-	    !(hw->cap & NFP_NET_CFG_CTRL_RSS)) {
+	    !(hw->cap & NFP_NET_CFG_CTRL_RSS_ANY)) {
 		PMD_INIT_LOG(INFO, "RSS not supported");
 		return -EINVAL;
 	}
@@ -769,7 +769,7 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		.nb_mtu_seg_max = NFP_TX_MAX_MTU_SEG,
 	};
 
-	if (hw->cap & NFP_NET_CFG_CTRL_RSS) {
+	if (hw->cap & NFP_NET_CFG_CTRL_RSS_ANY) {
 		dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_RSS_HASH;
 
 		dev_info->flow_type_rss_offloads = RTE_ETH_RSS_IPV4 |
@@ -1080,7 +1080,7 @@ nfp_net_reta_update(struct rte_eth_dev *dev,
 	uint32_t update;
 	int ret;
 
-	if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS))
+	if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY))
 		return -EINVAL;
 
 	ret = nfp_net_rss_reta_write(dev, reta_conf, reta_size);
@@ -1108,7 +1108,7 @@ nfp_net_reta_query(struct rte_eth_dev *dev,
 
 	hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
-	if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS))
+	if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY))
 		return -EINVAL;
 
 	if (reta_size != NFP_NET_CFG_RSS_ITBL_SZ) {
@@ -1206,7 +1206,7 @@ nfp_net_rss_hash_update(struct rte_eth_dev *dev,
 	rss_hf = rss_conf->rss_hf;
 
 	/* Checking if RSS is enabled */
-	if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS)) {
+	if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY)) {
 		if (rss_hf != 0) { /* Enable RSS? */
 			PMD_DRV_LOG(ERR, "RSS unsupported");
 			return -EINVAL;
@@ -1241,7 +1241,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
 
 	hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
-	if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS))
+	if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY))
 		return -EINVAL;
 
 	rss_hf = rss_conf->rss_hf;
diff --git a/drivers/net/nfp/nfp_ctrl.h b/drivers/net/nfp/nfp_ctrl.h
index e73715e2aa..372d537462 100644
--- a/drivers/net/nfp/nfp_ctrl.h
+++ b/drivers/net/nfp/nfp_ctrl.h
@@ -119,6 +119,7 @@
 #define NFP_NET_CFG_MACADDR             0x0024
 
 #define NFP_NET_CFG_CTRL_LSO_ANY (NFP_NET_CFG_CTRL_LSO | NFP_NET_CFG_CTRL_LSO2)
+#define NFP_NET_CFG_CTRL_RSS_ANY (NFP_NET_CFG_CTRL_RSS | NFP_NET_CFG_CTRL_RSS2)
 
 /*
  * Read-only words (0x0030 - 0x0050):
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index b6817c10da..673a17c26c 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -123,7 +123,10 @@ nfp_net_start(struct rte_eth_dev *dev)
 	if (rxmode->mq_mode & RTE_ETH_MQ_RX_RSS) {
 		nfp_net_rss_config_default(dev);
 		update |= NFP_NET_CFG_UPDATE_RSS;
-		new_ctrl |= NFP_NET_CFG_CTRL_RSS;
+		if (hw->cap & NFP_NET_CFG_CTRL_RSS2)
+			new_ctrl |= NFP_NET_CFG_CTRL_RSS2;
+		else
+			new_ctrl |= NFP_NET_CFG_CTRL_RSS;
 	}
 
 	/* Enable device */
diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index 66a1c0a36b..3f4ad3e7ab 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -95,7 +95,10 @@ nfp_netvf_start(struct rte_eth_dev *dev)
 	if (rxmode->mq_mode & RTE_ETH_MQ_RX_RSS) {
 		nfp_net_rss_config_default(dev);
 		update |= NFP_NET_CFG_UPDATE_RSS;
-		new_ctrl |= NFP_NET_CFG_CTRL_RSS;
+		if (hw->cap & NFP_NET_CFG_CTRL_RSS2)
+			new_ctrl |= NFP_NET_CFG_CTRL_RSS2;
+		else
+			new_ctrl |= NFP_NET_CFG_CTRL_RSS;
 	}
 
 	/* Enable device */
diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index 63729261c8..8429b44de0 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -138,7 +138,7 @@ nfp_net_set_hash(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxd,
 	uint32_t hash = 0;
 	uint32_t hash_type = 0;
 
-	if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS))
+	if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS_ANY))
 		return;
 
 	/* this is true for new firmwares */
-- 
2.27.0


  parent reply	other threads:[~2022-06-23  2:28 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02  1:52 [PATCH 00/14] Add support of NFP3800 chip and firmware with NFDk Jin Liu
2022-06-02  1:52 ` [PATCH 01/14] net/nfp: change the coding style Jin Liu
2022-06-02 22:52   ` Ferruh Yigit
2022-06-14  8:50     ` Kevin Liu
2022-06-02  1:52 ` [PATCH 02/14] net/nfp: remove unnecessary forward function declaration Jin Liu
2022-06-02  1:52 ` [PATCH 03/14] net/nfp: remove pessimistic limit Jin Liu
2022-06-02  1:52 ` [PATCH 04/14] net/nfp: rename set MAC function Jin Liu
2022-06-02  1:52 ` [PATCH 05/14] net/nfp: rename function and struct Jin Liu
2022-06-02  1:52 ` [PATCH 06/14] net/nfp: support NFP3800 card Jin Liu
2022-06-02 22:52   ` Ferruh Yigit
2022-06-14  8:50     ` Kevin Liu
2022-06-02  1:52 ` [PATCH 07/14] net/nfp: support NFDK firmware Jin Liu
2022-06-02 22:53   ` Ferruh Yigit
2022-06-14  8:49     ` Kevin Liu
2022-06-14  9:21       ` Ferruh Yigit
2022-06-14  9:30         ` Kevin Liu
2022-06-02  1:52 ` [PATCH 08/14] net/nfp: structure adjustment Jin Liu
2022-06-02 22:54   ` Ferruh Yigit
2022-06-14  8:49     ` Kevin Liu
2022-06-02  1:52 ` [PATCH 09/14] net/nfp: nfdk netdev option and queue function Jin Liu
2022-06-02  1:53 ` [PATCH 10/14] net/nfp: add queue stop and close helper function Jin Liu
2022-06-02  1:53 ` [PATCH 11/14] net/nfp: nfdk stop and close function Jin Liu
2022-06-02  1:53 ` [PATCH 12/14] net/nfp: move macro from C file to head file Jin Liu
2022-06-02  1:53 ` [PATCH 13/14] net/nfp: nfdk packet xmit function Jin Liu
2022-06-02  1:53 ` [PATCH 14/14] net/nfp: modify RSS logic Jin Liu
2022-06-02 22:56   ` Ferruh Yigit
2022-06-14  8:50     ` Kevin Liu
2022-06-02 22:51 ` [PATCH 00/14] Add support of NFP3800 chip and firmware with NFDk Ferruh Yigit
2022-06-14  8:48   ` Kevin Liu
2022-06-16  2:39 ` [PATCH v2 00/15] " Jin Liu
2022-06-16  2:39   ` [PATCH v2 01/15] doc: update release note Jin Liu
2022-06-16 15:04     ` Ferruh Yigit
2022-06-16  2:39   ` [PATCH v2 02/15] doc: update nfp documentation Jin Liu
2022-06-16 15:04     ` Ferruh Yigit
2022-06-16  2:39   ` [PATCH v2 03/15] net/nfp: change the coding style Jin Liu
2022-06-16  2:39   ` [PATCH v2 04/15] net/nfp: remove unnecessary forward function declaration Jin Liu
2022-06-16  2:39   ` [PATCH v2 05/15] net/nfp: remove pessimistic limit Jin Liu
2022-06-16  2:39   ` [PATCH v2 06/15] net/nfp: rename set MAC function Jin Liu
2022-06-16  2:39   ` [PATCH v2 07/15] net/nfp: rename function and struct Jin Liu
2022-06-16  2:39   ` [PATCH v2 08/15] net/nfp: support NFP3800 card Jin Liu
2022-06-16 15:04     ` Ferruh Yigit
2022-06-16  2:39   ` [PATCH v2 09/15] net/nfp: support firmware with NFDk Jin Liu
2022-06-16  2:39   ` [PATCH v2 10/15] net/nfp: structure adjustment Jin Liu
2022-06-16  2:39   ` [PATCH v2 11/15] net/nfp: nfdk netdev option and queue function Jin Liu
2022-06-16  2:39   ` [PATCH v2 12/15] net/nfp: add queue stop and close helper function Jin Liu
2022-06-16  2:39   ` [PATCH v2 13/15] net/nfp: move macro from C file to head file Jin Liu
2022-06-16  2:39   ` [PATCH v2 14/15] net/nfp: nfdk packet xmit function Jin Liu
2022-06-16  2:39   ` [PATCH v2 15/15] net/nfp: modify RSS logic Jin Liu
2022-06-16 15:06   ` [PATCH v2 00/15] Add support of NFP3800 chip and firmware with NFDk Ferruh Yigit
2022-06-17  9:34   ` [PATCH v3 00/13] " Jin Liu
2022-06-17  9:34     ` [PATCH v3 01/13] net/nfp: change the coding style Jin Liu
2022-06-17  9:34     ` [PATCH v3 02/13] net/nfp: remove unnecessary forward function declaration Jin Liu
2022-06-17  9:34     ` [PATCH v3 03/13] net/nfp: remove pessimistic limit Jin Liu
2022-06-17  9:34     ` [PATCH v3 04/13] net/nfp: rename set MAC function Jin Liu
2022-06-17  9:34     ` [PATCH v3 05/13] net/nfp: rename function and struct Jin Liu
2022-06-17  9:34     ` [PATCH v3 06/13] net/nfp: support NFP3800 card Jin Liu
2022-06-17  9:34     ` [PATCH v3 07/13] net/nfp: support firmware with NFDk Jin Liu
2022-06-17  9:34     ` [PATCH v3 08/13] net/nfp: structure adjustment Jin Liu
2022-06-17  9:34     ` [PATCH v3 09/13] net/nfp: nfdk netdev option and queue function Jin Liu
2022-06-17  9:34     ` [PATCH v3 10/13] net/nfp: add queue stop and close helper function Jin Liu
2022-06-17  9:34     ` [PATCH v3 11/13] net/nfp: move macro from C file to head file Jin Liu
2022-06-17  9:34     ` [PATCH v3 12/13] net/nfp: nfdk packet xmit function Jin Liu
2022-06-22 16:03       ` Thomas Monjalon
2022-06-22 16:29         ` Ferruh Yigit
2022-06-17  9:34     ` [PATCH v3 13/13] net/nfp: modify RSS logic Jin Liu
2022-06-17 13:33     ` [PATCH v3 00/13] Add support of NFP3800 chip and firmware with NFDk Ferruh Yigit
2022-06-23  2:26     ` [PATCH v4 " Jin Liu
2022-06-23  2:26       ` [PATCH v4 01/13] net/nfp: change the coding style Jin Liu
2022-06-23  2:26       ` [PATCH v4 02/13] net/nfp: remove unnecessary forward function declaration Jin Liu
2022-06-23  2:26       ` [PATCH v4 03/13] net/nfp: remove pessimistic limit Jin Liu
2022-06-23  2:26       ` [PATCH v4 04/13] net/nfp: rename set MAC function Jin Liu
2022-06-23  2:26       ` [PATCH v4 05/13] net/nfp: rename function and struct Jin Liu
2022-06-23  2:26       ` [PATCH v4 06/13] net/nfp: support NFP3800 card Jin Liu
2022-06-23  2:26       ` [PATCH v4 07/13] net/nfp: support firmware with NFDk Jin Liu
2022-06-23  2:26       ` [PATCH v4 08/13] net/nfp: structure adjustment Jin Liu
2022-06-23  2:26       ` [PATCH v4 09/13] net/nfp: nfdk netdev option and queue function Jin Liu
2022-06-23  2:26       ` [PATCH v4 10/13] net/nfp: add queue stop and close helper function Jin Liu
2022-06-23  2:26       ` [PATCH v4 11/13] net/nfp: move macro from C file to head file Jin Liu
2022-06-23  2:26       ` [PATCH v4 12/13] net/nfp: nfdk packet xmit function Jin Liu
2022-06-23  2:26       ` Jin Liu [this message]
2022-06-23  9:11       ` [PATCH v4 00/13] Add support of NFP3800 chip and firmware with NFDk Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220623022615.3628093-14-jin.liu@corigine.com \
    --to=jin.liu@corigine.com \
    --cc=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=na.wang@corigine.com \
    --cc=niklas.soderlund@corigine.com \
    --cc=peng.zhang@corigine.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).