Add callbacks to calculate the size and fill link extended statistics which can be split into multiple messages and are dumped via the new rtnl stats API (RTM_GETSTATS) with the IFLA_STATS_LINK_XSTATS attribute. Also add that attribute to the idx mask check since it is expected to be able to save state and resume dumping (e.g. future bridge per-vlan stats will be dumped via this attribute and callbacks). Each link type should nest its private attributes under the per-link type attribute. This allows to have any number of separated private attributes and to avoid one call to get the dev link type.
Showing the changes to include/uapi (1 of 3 files). Show all
Unified · Split
| @@ -810,6 +810,7 @@ struct if_stats_msg { · 809 unmodified lines | ||
| 810 | 810 | enum { |
| 811 | 811 | IFLA_STATS_UNSPEC, /* also used as 64bit pad attribute */ |
| 812 | 812 | IFLA_STATS_LINK_64, |
| 813 | + IFLA_STATS_LINK_XSTATS, | |
| 813 | 814 | __IFLA_STATS_MAX, |
| 814 | 815 | }; |
| 815 | 816 | |
| @@ -817,4 +818,15 @@ enum { · 1 unmodified line | ||
| 817 | 818 | |
| 818 | 819 | #define IFLA_STATS_FILTER_BIT(ATTR) (1 << (ATTR - 1)) |
| 819 | 820 | |
| 821 | +/* These are embedded into IFLA_STATS_LINK_XSTATS: | |
| 822 | + * [IFLA_STATS_LINK_XSTATS] | |
| 823 | + * -> [LINK_XSTATS_TYPE_xxx] | |
| 824 | + * -> [rtnl link type specific attributes] | |
| 825 | + */ | |
| 826 | +enum { | |
| 827 | + LINK_XSTATS_TYPE_UNSPEC, | |
| 828 | + __LINK_XSTATS_TYPE_MAX | |
| 829 | +}; | |
| 830 | +#define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1) | |
| 831 | + | |
| 820 | 832 | #endif /* _UAPI_LINUX_IF_LINK_H */ |