History

bonding: add support for xstats and export 3ad stats

This patch adds support for extended statistics (xstats) call to the bonding. The first user would be the 3ad code which counts the following events: - LACPDU Rx/Tx - LACPDU unknown type Rx - LACPDU illegal Rx - Marker Rx/Tx - Marker response Rx/Tx - Marker unknown type Rx All of these are exported via netlink as separate attributes to be easily extensible as we plan to add more in the future. Similar to how the bridge and other xstats exports, the structure inside is: [ IFLA_STATS_LINK_XSTATS ] -> [ LINK_XSTATS_TYPE_BOND ] -> [ BOND_XSTATS_3AD ] -> [ 3ad stats attributes ] With this structure it's easy to add more stat types later.

Nikolay Aleksandrov committed 7 years ago

Commit a258aea1 parent 267c0955 files · +182 −0Browse files

Showing the changes to include/uapi/linux (2 of 5 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/if_bonding.h +24 −0
  2. include/uapi/linux/if_link.h +1 −0
include/uapi/linux/if_bonding.h+24−0
@@ -117,6 +117,30 @@ struct ad_info { · 116 unmodified lines
117117 __u8 partner_system[ETH_ALEN];
118118 };
119119
120+/* Embedded inside LINK_XSTATS_TYPE_BOND */
121+enum {
122+ BOND_XSTATS_UNSPEC,
123+ BOND_XSTATS_3AD,
124+ __BOND_XSTATS_MAX
125+};
126+#define BOND_XSTATS_MAX (__BOND_XSTATS_MAX - 1)
127+
128+/* Embedded inside BOND_XSTATS_3AD */
129+enum {
130+ BOND_3AD_STAT_LACPDU_RX,
131+ BOND_3AD_STAT_LACPDU_TX,
132+ BOND_3AD_STAT_LACPDU_UNKNOWN_RX,
133+ BOND_3AD_STAT_LACPDU_ILLEGAL_RX,
134+ BOND_3AD_STAT_MARKER_RX,
135+ BOND_3AD_STAT_MARKER_TX,
136+ BOND_3AD_STAT_MARKER_RESP_RX,
137+ BOND_3AD_STAT_MARKER_RESP_TX,
138+ BOND_3AD_STAT_MARKER_UNKNOWN_RX,
139+ BOND_3AD_STAT_PAD,
140+ __BOND_3AD_STAT_MAX
141+};
142+#define BOND_3AD_STAT_MAX (__BOND_3AD_STAT_MAX - 1)
143+
120144 #endif /* _LINUX_IF_BONDING_H */
121145
122146 /*
include/uapi/linux/if_link.h+1−0
@@ -925,6 +925,7 @@ enum { · 924 unmodified lines
925925 enum {
926926 LINK_XSTATS_TYPE_UNSPEC,
927927 LINK_XSTATS_TYPE_BRIDGE,
928+ LINK_XSTATS_TYPE_BOND,
928929 __LINK_XSTATS_TYPE_MAX
929930 };
930931 #define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)