[dpdk-dev] [PATCH v5] ethdev: fix DCB set failure

Iremonger, Bernard bernard.iremonger at intel.com
Wed May 13 17:54:26 CEST 2020



> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Ting Xu
> Sent: Wednesday, May 13, 2020 6:16 PM
> To: dev at dpdk.org
> Cc: thomas at monjalon.net; Yigit, Ferruh <ferruh.yigit at intel.com>;
> arybchenko at solarflare.com; stable at dpdk.org
> Subject: [dpdk-dev] [PATCH v5] ethdev: fix DCB set failure
> 
> When rte_eth_dev_rss_hash_conf_get() is called, if the variable rss_conf is
> not initialized, the pointer member variable rss_key may have a random
> address, which leads to an error in the following processing. This patch
> initialized the variable rss_conf to avoid this situation.
> 
> Fixes: 16321de09396 ("ethdev: allow to get RSS hash functions and key")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Ting Xu <ting.xu at intel.com>
> 
> ---
> v4->v5: modify commit log
> V3->v4: fix build failure
> v2->v3: move memset to rte_eth_dev_rss_hash_conf_get from testpmd
> v1->v2: modify commit log, move memset to else leg
> ---
>  lib/librte_ethdev/rte_ethdev.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 8e10a6fc3..b20c6bb2d 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -3552,6 +3552,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
>  	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>  	dev = &rte_eth_devices[port_id];
>  	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rss_hash_conf_get,
> -ENOTSUP);
> +	memset(rss_conf, 0, sizeof(*rss_conf));
>  	return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
>  								   rss_conf));
>  }
> --
> 2.17.1

The commit line should probably be reworded to describe the revised fix.

Otherwise
Reviewed-by: Bernard Iremonger <bernard.iremonger at intel.com>



More information about the dev mailing list