[dpdk-dev] [PATCH 13/51] net/netvsc: check status of getting ethdev info

Stephen Hemminger stephen at networkplumber.org
Tue Aug 27 22:17:16 CEST 2019


On Tue, 27 Aug 2019 15:25:24 +0100
Andrew Rybchenko <arybchenko at solarflare.com> wrote:

> From: Ivan Ilchenko <Ivan.Ilchenko at oktetlabs.ru>
> 
> rte_eth_dev_info_get() return value was changed from void to int,
> so this patch modify rte_eth_dev_info_get() usage across
> net/netvsc according to its new return type.
> 
> Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko at oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
> ---
>  drivers/net/netvsc/hn_vf.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c
> index 03f855b..b6b1e5d 100644
> --- a/drivers/net/netvsc/hn_vf.c
> +++ b/drivers/net/netvsc/hn_vf.c
> @@ -176,8 +176,16 @@ static void hn_vf_info_merge(struct rte_eth_dev *vf_dev,
>  			     struct rte_eth_dev_info *info)
>  {
>  	struct rte_eth_dev_info vf_info;
> +	int ret;
> +
> +	ret = rte_eth_dev_info_get(vf_dev->data->port_id, &vf_info);
> +	if (ret != 0) {
> +		PMD_DRV_LOG(ERR,
> +			"Error during getting device (port %u) info: %s\n",
> +			vf_dev->data->port_id, strerror(-ret));
>  
> -	rte_eth_dev_info_get(vf_dev->data->port_id, &vf_info);
> +		return;
> +	}
>  

I would prefer that the driver api callback change to return an
error and not add more log messages.

Or maybe this patch is temporary until you get there in the patchset.


More information about the dev mailing list