Subject: Re: [PATCH net-next v4] netlink: specs: devlink: add some(not all) missing attributes in devlink.yaml

From: Jakub Kicinski <[email-masked]>
Date: Mon, 27 Nov 2023 13:16:41 -0800

On Sun, 26 Nov 2023 16:22:46 +0530 Swarup Laxman Kotiaklapudi wrote:
> diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
> index b3c8383d342d..ddb689dd3d7e 100644
> --- a/include/uapi/linux/devlink.h
> +++ b/include/uapi/linux/devlink.h
> @@ -248,7 +248,7 @@ enum devlink_param_reset_dev_on_drv_probe_value {
>  	DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_DISK,
>  };
>  
> -enum {
> +enum devlink_stats {
>  	DEVLINK_ATTR_STATS_RX_PACKETS,		/* u64 */
>  	DEVLINK_ATTR_STATS_RX_BYTES,		/* u64 */
>  	DEVLINK_ATTR_STATS_RX_DROPPED,		/* u64 */

This change unfortunately breaks the kernel build. There's already
a struct called devlink_stats. You can change that later but that'd 
be a separate patch, after the spec changes are accepted.

For now just keep these enums unnamed.

If the C codegen tries to use them as named (which I don't see it doing
now, FWIW) you can add an empty enum-name: attribute to the appropriate
enum definition in the spec, this will make the C code generator use a
bare "int" to store the values.
-- 
pw-bot: cr