[PATCH v5 18/40] net/iavf: check RSS hash algorithms
Jie Hai
haijie1 at huawei.com
Wed Oct 11 11:27:43 CEST 2023
A new field 'algorithm' has been added to rss_conf, check it
in case of ignoring unsupported values.
Signed-off-by: Jie Hai <haijie1 at huawei.com>
---
drivers/net/iavf/iavf_ethdev.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index f2fc5a56216d..9d6950d462a6 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -523,6 +523,9 @@ iavf_init_rss(struct iavf_adapter *adapter)
return -ENOTSUP;
}
+ if (rss_conf->algorithm != RTE_ETH_HASH_FUNCTION_DEFAULT)
+ return -EINVAL;
+
/* configure RSS key */
if (!rss_conf->rss_key) {
/* Calculate the default hash key */
@@ -1588,6 +1591,9 @@ iavf_dev_rss_hash_update(struct rte_eth_dev *dev,
if (!(vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF))
return -ENOTSUP;
+ if (rss_conf->algorithm != RTE_ETH_HASH_FUNCTION_DEFAULT)
+ return -EINVAL;
+
/* Set hash key. */
ret = iavf_set_rss_key(adapter, rss_conf->rss_key,
rss_conf->rss_key_len);
--
2.30.0
More information about the dev
mailing list