> also 'enicpmd_dev_configure()' looks like can be updated.
Where would it be updated? With the patch, the check will be done at the bottom of the function in call to enic_init_rss_nic_cfg -> enic_set_niccfg
From:
Ferruh Yigit <ferruh.yigit@amd.com>
Date: Wednesday, October 11, 2023 at 10:32 AM
To: Jie Hai <haijie1@huawei.com>, dev@dpdk.org <dev@dpdk.org>, John Daley (johndale) <johndale@cisco.com>, Hyong Youb Kim (hyonkim) <hyonkim@cisco.com>
Cc: lihuisong@huawei.com <lihuisong@huawei.com>, fengchengwen@huawei.com <fengchengwen@huawei.com>, liudongdong3@huawei.com <liudongdong3@huawei.com>
Subject: Re: [PATCH v5 14/40] net/enic: check RSS hash algorithms
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@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);