[PATCH v4 06/15] common/idpf: add config RSS
beilei.xing at intel.com
beilei.xing at intel.com
Tue Jan 17 09:06:13 CET 2023
From: Beilei Xing <beilei.xing at intel.com>
Move configure RSS to common module.
Signed-off-by: Beilei Xing <beilei.xing at 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(-)
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 680a69822c..d8d5275b1c 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_ctlq_clean_sq;
idpf_ctlq_deinit;
idpf_ctlq_init;
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)
{
--
2.26.2
More information about the dev
mailing list