Subject: Re: [PATCH net-next 1/2] rtnetlink: add new RTM_GETSTATS message to dump link stats

From: roopa <[email-masked]>
Date: Tue, 15 Mar 2016 01:08:44 -0700

On 3/15/16, 12:52 AM, Jiri Pirko wrote:
> Tue, Mar 15, 2016 at 08:38:51AM CET, [email-masked] wrote:
>>
[snip]
>> how does it matter if we have reached an agreement that the struct is required ?.
>> unlike other messages, a filter_mask is an important and must attribute for
>> stats. If you are worried about us running out of bits in u32, the netlink attribute you will
>> define for the filter_mask will also be u32 to begin with.
> No, you are missing the point:

I understood what you meant the first time...(to which i did comment if you really wanted a u8 for every filter attribute).

>
> enum {
> 	IFLA_STATS_UNSPEC,
> 	IFLA_STATS_FILTER, /* nest */
> 	IFLA_STATS_LINK64,
> 	IFLA_STATS_INET6,
> 	__IFLA_STATS_MAX,
> };
>
> #define IFLA_STATS_MAX (__IFLA_STATS_MAX - 1)
>
> enum {
> 	IFLA_STATS_FILTER_UNSPEC,
> 	IFLA_STATS_FILTER_LINK64, /* flag */
> 	IFLA_STATS_FILTER_INET6, /* flag */
> 	...
> 	IFLA_STATS_FILTER_WHATEVER, /* flag */
> 	__IFLA_STATS_FILTER_MAX,
> };
>
> #define IFLA_STATS_FILTERMAX (__IFLA_STATS_FILTER_MAX - 1)

Apart from the usability concern i have described earlier, this just seems an overkill ...having to redefine every attribute.