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

Andrew Rybchenko arybchenko at solarflare.com
Wed Aug 28 09:06:37 CEST 2019


On 8/27/19 11:17 PM, Stephen Hemminger wrote:
> 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.

Got it. We'll change hn_vf_info_merge() and hn_vf_info_get() to return
int in this patch, but the return value will be ignored hn_dev_info_get()
before the patch which changes dev_infos_get prototype to return int
(that patch will be huge since it should update all drivers at once, so
it is better to preparation here).

Thanks.



More information about the dev mailing list