[PATCH v5 27/40] net/netvsc: check RSS hash algorithms
Jie Hai
haijie1 at huawei.com
Wed Oct 11 11:27:52 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/netvsc/hn_ethdev.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index d0bbc0a4c0c0..9e4205816a6f 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -395,6 +395,9 @@ static int hn_rss_hash_update(struct rte_eth_dev *dev,
return err;
}
+ if (rss_conf->algorithm != RTE_ETH_HASH_FUNCTION_DEFAULT)
+ return -EINVAL;
+
hn_rss_hash_init(hv, rss_conf);
if (rss_conf->rss_hf != 0) {
@@ -756,6 +759,9 @@ static int hn_dev_configure(struct rte_eth_dev *dev)
for (i = 0; i < NDIS_HASH_INDCNT; i++)
hv->rss_ind[i] = i % dev->data->nb_rx_queues;
+ if (rss_conf->algorithm != RTE_ETH_HASH_FUNCTION_DEFAULT)
+ return -EINVAL;
+
hn_rss_hash_init(hv, rss_conf);
subchan = hv->num_queues - 1;
--
2.30.0
More information about the dev
mailing list