On 2/25/16, 8:26 AM, David Miller wrote: > From: roopa <ro...@cumulusnetworks.com> > Date: Wed, 24 Feb 2016 21:25:50 -0800 > >> I did go back and forth on the attribute vs mask. >> cosmetic but, i guess i did not feel good about having to redefine every >> attribute again >> for the bitmap filter ...and i anticipate the list of stat attributes to >> grow overtime (maybe there is a better way). >> enum { >> IFLA_LINK_STATS64, >> IFLA_LINK_INET6_STATS, >> IFLA_LINK_MPLS_STATS, >> __IFLA_LINK_STATS_MAX, >> }; >> >> #define IFLA_LINK_STATS64_FILTER 0 >> #define IFLA_LINK_INET6_STATS_FILTER (1 << 0) >> #define IFLA_LINK_MPLS_STATS_FILTER (2 << 0) > The filter for X is always (1 << X), so we could work with something like: > > #define IFLA_LINK_FILTER_BIT(ATTR) (1 << (ATTR)) i like it > > Which seems to suggest that emitting no stats unless they are explicitly > requested in > the bitmask makes sense because: > > 1) You don't have to special case STATS64 in the filter mask > > 2) Application are forced to be aware of filtering and thus choose only > what they want to see > > How about this? I am ok with it. It keeps the filtering mask handling consistent. Its a bit inconsistent with the other dump functions, but this gives user full control of what combination of stats she wants. For something like stats, i think this makes sense.
Thanks again! Roopa