[PATCH v5 17/40] net/i40e: check RSS hash algorithms

Jie Hai haijie1 at huawei.com
Wed Oct 11 11:27:42 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/i40e/i40e_ethdev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 50ba9aac9498..fcd6d4eb0495 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -7749,6 +7749,9 @@ i40e_dev_rss_hash_update(struct rte_eth_dev *dev,
 	if (rss_hf == 0) /* Disable RSS */
 		return -EINVAL;
 
+	if (rss_conf->algorithm != RTE_ETH_HASH_FUNCTION_DEFAULT)
+		return -EINVAL;
+
 	return i40e_hw_rss_hash_set(pf, rss_conf);
 }
 
@@ -8986,6 +8989,10 @@ i40e_pf_config_rss(struct i40e_pf *pf)
 	    !(mq_mode & RTE_ETH_MQ_RX_RSS_FLAG))
 		return 0;
 
+	if (pf->dev_data->dev_conf.rx_adv_conf.rss_conf.algorithm !=
+	    RTE_ETH_HASH_FUNCTION_DEFAULT)
+		return -EINVAL;
+
 	hw = I40E_PF_TO_HW(pf);
 	hena = i40e_config_hena(pf->adapter, rss_hf);
 	i40e_write_rx_ctl(hw, I40E_PFQF_HENA(0), (uint32_t)hena);
-- 
2.30.0



More information about the dev mailing list