[PATCH v5 14/40] net/enic: check RSS hash algorithms

Ferruh Yigit ferruh.yigit at amd.com
Wed Oct 11 19:32:44 CEST 2023


On 10/11/2023 10:27 AM, Jie Hai wrote:
> 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/enic/enic_ethdev.c | 1 +
>  drivers/net/enic/enic_main.c   | 3 +++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
> index cdf091559196..164f423a85c8 100644
> --- a/drivers/net/enic/enic_ethdev.c
> +++ b/drivers/net/enic/enic_ethdev.c
> @@ -834,6 +834,7 @@ static int enicpmd_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
>  	ENICPMD_FUNC_TRACE();
>  	if (rss_conf == NULL)
>  		return -EINVAL;
> +
>

unintended change.

also 'enicpmd_dev_configure()' looks like can be updated.


>  	if (rss_conf->rss_key != NULL &&
>  	    rss_conf->rss_key_len < ENIC_RSS_HASH_KEY_SIZE) {
>  		dev_err(enic, "rss_hash_conf_get: wrong rss_key_len. given=%u"
> diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
> index 19a99a82c501..2eafe7637b3a 100644
> --- a/drivers/net/enic/enic_main.c
> +++ b/drivers/net/enic/enic_main.c
> @@ -1428,6 +1428,9 @@ int enic_set_rss_conf(struct enic *enic, struct rte_eth_rss_conf *rss_conf)
>  		}
>  	}
>  
> +	if (rss_enable && rss_conf->algorithm != RTE_ETH_HASH_FUNCTION_DEFAULT)
> +		return -EINVAL;
> +
>  	ret = enic_set_niccfg(enic, ENIC_RSS_DEFAULT_CPU, rss_hash_type,
>  			      ENIC_RSS_HASH_BITS, ENIC_RSS_BASE_CPU,
>  			      rss_enable);



More information about the dev mailing list