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

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

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Xing, Beilei Dec. 8, 2022, 7: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/idpf_common_virtchnl.h |  3 ---
 drivers/common/idpf/version.map            |  4 +---
 drivers/net/idpf/idpf_ethdev.c             | 26 ----------------------
 5 files changed, 28 insertions(+), 32 deletions(-)
  

Patch

diff --git a/drivers/common/idpf/idpf_common_device.c b/drivers/common/idpf/idpf_common_device.c
index 2aad9bcdd3..19d638824d 100644
--- a/drivers/common/idpf/idpf_common_device.c
+++ b/drivers/common/idpf/idpf_common_device.c
@@ -286,4 +286,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 1f7483fd85..026d852de4 100644
--- a/drivers/common/idpf/idpf_common_device.h
+++ b/drivers/common/idpf/idpf_common_device.h
@@ -150,5 +150,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/idpf_common_virtchnl.h b/drivers/common/idpf/idpf_common_virtchnl.h
index e9e1c172eb..182a6a4490 100644
--- a/drivers/common/idpf/idpf_common_virtchnl.h
+++ b/drivers/common/idpf/idpf_common_virtchnl.h
@@ -12,11 +12,8 @@  int idpf_vc_get_caps(struct idpf_adapter *adapter);
 int idpf_vc_create_vport(struct idpf_vport *vport,
 			 struct virtchnl2_create_vport *vport_info);
 int idpf_vc_destroy_vport(struct idpf_vport *vport);
-__rte_internal
 int idpf_vc_set_rss_key(struct idpf_vport *vport);
-__rte_internal
 int idpf_vc_set_rss_lut(struct idpf_vport *vport);
-__rte_internal
 int idpf_vc_set_rss_hash(struct idpf_vport *vport);
 __rte_internal
 int idpf_switch_queue(struct idpf_vport *vport, uint16_t qid,
diff --git a/drivers/common/idpf/version.map b/drivers/common/idpf/version.map
index 172906fcfa..62ea6579e3 100644
--- a/drivers/common/idpf/version.map
+++ b/drivers/common/idpf/version.map
@@ -7,9 +7,6 @@  INTERNAL {
 	idpf_ctlq_recv;
 	idpf_ctlq_send;
 	idpf_ctlq_post_rx_buffs;
-	idpf_vc_set_rss_key;
-	idpf_vc_set_rss_lut;
-	idpf_vc_set_rss_hash;
 	idpf_switch_queue;
 	idpf_vc_ena_dis_queues;
 	idpf_vc_ena_dis_vport;
@@ -23,6 +20,7 @@  INTERNAL {
 	idpf_adapter_deinit;
 	idpf_vport_init;
 	idpf_vport_deinit;
+	idpf_config_rss;
 
 	local: *;
 };
diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index f56d1171c9..ca920bef85 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -169,32 +169,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)
 {