Subject: Re: [patch net-next] net: devlink: expose the info about version representing a component

From: Jiri Pirko <[email-masked]>
Date: Sat, 5 Nov 2022 10:26:33 +0100

Sat, Nov 05, 2022 at 03:25:10AM CET, [email-masked] wrote:
>On Fri,  4 Nov 2022 16:24:25 +0100 Jiri Pirko wrote:
>> If certain version exposed by a driver is marked to be representing a
>> component, expose this info to the user.
>> 
>> Example:
>> $ devlink dev info
>> netdevsim/netdevsim10:
>>   driver netdevsim
>>   versions:
>>       running:
>>         fw.mgmt 10.20.30
>>       flash_components:
>>         fw.mgmt
>
>Didn't I complain that this makes no practical sense because
>user needs to know what file to flash, to which component?
>Or was that a different flag that I was complaining about?

Different. That was about exposing a default component.

>
>> diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
>> index 2f24b53a87a5..7f2874189188 100644
>> --- a/include/uapi/linux/devlink.h
>> +++ b/include/uapi/linux/devlink.h
>> @@ -607,6 +607,8 @@ enum devlink_attr {
>>  
>>  	DEVLINK_ATTR_SELFTESTS,			/* nested */
>>  
>> +	DEVLINK_ATTR_INFO_VERSION_IS_COMPONENT,	/* u8 0 or 1 */
>
>In the interest of fairness I should complain about the use of u8/u16
>
>devlink is genetlink so user will know kernel supports the attribute 
>(by looking at family->maxattr). So this can be a flag.

Okay, makes sense.