mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
net: rtnetlink: add linkxstats callbacks and attribute
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. Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e8872a25a0
commit
97a47facf3
3 changed files with 49 additions and 0 deletions
|
@ -810,6 +810,7 @@ struct if_stats_msg {
|
|||
enum {
|
||||
IFLA_STATS_UNSPEC, /* also used as 64bit pad attribute */
|
||||
IFLA_STATS_LINK_64,
|
||||
IFLA_STATS_LINK_XSTATS,
|
||||
__IFLA_STATS_MAX,
|
||||
};
|
||||
|
||||
|
@ -817,4 +818,15 @@ enum {
|
|||
|
||||
#define IFLA_STATS_FILTER_BIT(ATTR) (1 << (ATTR - 1))
|
||||
|
||||
/* These are embedded into IFLA_STATS_LINK_XSTATS:
|
||||
* [IFLA_STATS_LINK_XSTATS]
|
||||
* -> [LINK_XSTATS_TYPE_xxx]
|
||||
* -> [rtnl link type specific attributes]
|
||||
*/
|
||||
enum {
|
||||
LINK_XSTATS_TYPE_UNSPEC,
|
||||
__LINK_XSTATS_TYPE_MAX
|
||||
};
|
||||
#define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)
|
||||
|
||||
#endif /* _UAPI_LINUX_IF_LINK_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue