[v5,06/15] common/idpf: add config RSS

Message ID 20230202095357.37929-7-beilei.xing@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/idpf: introduce idpf common modle |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Xing, Beilei Feb. 2, 2023, 9:53 a.m. UTC
  From: Beilei Xing <beilei.xing@intel.com>

Move configure RSS to common module.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/common/idpf/idpf_common_device.c | 25 +++++++++++++++++++++++
 drivers/common/idpf/idpf_common_device.h |  2 ++
 drivers/common/idpf/version.map          |  1 +
 drivers/net/idpf/idpf_ethdev.c           | 26 ------------------------
 4 files changed, 28 insertions(+), 26 deletions(-)
  

Patch

diff --git a/drivers/common/idpf/idpf_common_device.c b/drivers/common/idpf/idpf_common_device.c
index 5628fb5c57..eee96b5083 100644
--- a/drivers/common/idpf/idpf_common_device.c
+++ b/drivers/common/idpf/idpf_common_device.c
@@ -273,4 +273,29 @@  idpf_vport_deinit(struct idpf_vport *vport)
 
 	return 0;
 }
+int
+idpf_config_rss(struct idpf_vport *vport)
+{
+	int ret;
+
+	ret = idpf_vc_set_rss_key(vport);
+	if (ret != 0) {
+		DRV_LOG(ERR, "Failed to configure RSS key");
+		return ret;
+	}
+
+	ret = idpf_vc_set_rss_lut(vport);
+	if (ret != 0) {
+		DRV_LOG(ERR, "Failed to configure RSS lut");
+		return ret;
+	}
+
+	ret = idpf_vc_set_rss_hash(vport);
+	if (ret != 0) {
+		DRV_LOG(ERR, "Failed to configure RSS hash");
+		return ret;
+	}
+
+	return ret;
+}
 RTE_LOG_REGISTER_SUFFIX(idpf_common_logtype, common, NOTICE);
diff --git a/drivers/common/idpf/idpf_common_device.h b/drivers/common/idpf/idpf_common_device.h
index 14d04268e5..1d3bb06fef 100644
--- a/drivers/common/idpf/idpf_common_device.h
+++ b/drivers/common/idpf/idpf_common_device.h
@@ -153,5 +153,7 @@  int idpf_vport_init(struct idpf_vport *vport,
 		    void *dev_data);
 __rte_internal
 int idpf_vport_deinit(struct idpf_vport *vport);
+__rte_internal
+int idpf_config_rss(struct idpf_vport *vport);
 
 #endif /* _IDPF_COMMON_DEVICE_H_ */
diff --git a/drivers/common/idpf/version.map b/drivers/common/idpf/version.map
index c1ae5affa4..fd56a9988f 100644
--- a/drivers/common/idpf/version.map
+++ b/drivers/common/idpf/version.map
@@ -3,6 +3,7 @@  INTERNAL {
 
 	idpf_adapter_deinit;
 	idpf_adapter_init;
+	idpf_config_rss;
 	idpf_execute_vc_cmd;
 	idpf_vc_alloc_vectors;
 	idpf_vc_check_api_version;
diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index 7a8fb6fd4a..f728318dad 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -178,32 +178,6 @@  idpf_init_vport_req_info(struct rte_eth_dev *dev,
 	return 0;
 }
 
-static int
-idpf_config_rss(struct idpf_vport *vport)
-{
-	int ret;
-
-	ret = idpf_vc_set_rss_key(vport);
-	if (ret != 0) {
-		PMD_INIT_LOG(ERR, "Failed to configure RSS key");
-		return ret;
-	}
-
-	ret = idpf_vc_set_rss_lut(vport);
-	if (ret != 0) {
-		PMD_INIT_LOG(ERR, "Failed to configure RSS lut");
-		return ret;
-	}
-
-	ret = idpf_vc_set_rss_hash(vport);
-	if (ret != 0) {
-		PMD_INIT_LOG(ERR, "Failed to configure RSS hash");
-		return ret;
-	}
-
-	return ret;
-}
-
 static int
 idpf_init_rss(struct idpf_vport *vport)
 {