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
117 __u8 partner_system[ETH_ALEN];117 __u8 partner_system[ETH_ALEN];
118};118};
119 119
120/* Embedded inside LINK_XSTATS_TYPE_BOND */
121enum {
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 */
129enum {
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
120#endif /* _LINUX_IF_BONDING_H */144#endif /* _LINUX_IF_BONDING_H */
121 145
122/*146/*
include/uapi/linux/if_link.h+1−0
@@ -925,6 +925,7 @@ enum { · 924 unmodified lines
925enum {925enum {
926 LINK_XSTATS_TYPE_UNSPEC,926 LINK_XSTATS_TYPE_UNSPEC,
927 LINK_XSTATS_TYPE_BRIDGE,927 LINK_XSTATS_TYPE_BRIDGE,
928 LINK_XSTATS_TYPE_BOND,
928 __LINK_XSTATS_TYPE_MAX929 __LINK_XSTATS_TYPE_MAX
929};930};
930#define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)931#define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)