[v5,22/40] net/ionic: check RSS hash algorithms

Message ID 20231011092805.693171-23-haijie1@huawei.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers
Series support setting and querying RSS algorithms |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Jie Hai Oct. 11, 2023, 9:27 a.m. UTC
  A new field 'algorithm' has been added to rss_conf, check it
in case of ignoring unsupported values.

Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/ionic/ionic_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Patch

diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 340fd0cd5923..e2e4d23c069b 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -642,6 +642,9 @@  ionic_dev_rss_hash_update(struct rte_eth_dev *eth_dev,
 	if (rss_conf->rss_key)
 		key = rss_conf->rss_key;
 
+	if (rss_conf->algorithm != RTE_ETH_HASH_FUNCTION_DEFAULT)
+		return -EINVAL;
+
 	if ((rss_conf->rss_hf & IONIC_ETH_RSS_OFFLOAD_ALL) == 0) {
 		/*
 		 * Can't disable rss through hash flags,
@@ -826,6 +829,9 @@  ionic_dev_configure(struct rte_eth_dev *eth_dev)
 
 	IONIC_PRINT_CALL();
 
+	if (eth_dev->data->dev_conf.rx_adv_conf.rss_conf.algorithm !=
+	    RTE_ETH_HASH_FUNCTION_DEFAULT)
+		return -EINVAL;
 	ionic_lif_configure(lif);
 
 	return 0;