History

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.

Nikolay Aleksandrov committed 10 years ago

Commit 97a47fa1 parent e8872a23 files · +49 −0Browse files

Showing the changes to include/uapi (1 of 3 files). Show all

Unified · Split

include/uapi/linux/if_link.h+12−0
@@ -810,6 +810,7 @@ struct if_stats_msg { · 809 unmodified lines
810810 enum {
811811 IFLA_STATS_UNSPEC, /* also used as 64bit pad attribute */
812812 IFLA_STATS_LINK_64,
813+ IFLA_STATS_LINK_XSTATS,
813814 __IFLA_STATS_MAX,
814815 };
815816
@@ -817,4 +818,15 @@ enum { · 1 unmodified line
817818
818819 #define IFLA_STATS_FILTER_BIT(ATTR) (1 << (ATTR - 1))
819820
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+
820832 #endif /* _UAPI_LINUX_IF_LINK_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t