aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorMahesh Bandewar <maheshb@google.com>2015-02-23 20:50:11 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-24 16:05:48 -0500
commit14c9551a32eba086c9f20c9d6a8e378481f15333 (patch)
tree22a0420c1ffd7ed7f996f1dedd675da7644a1d9b /include/net
parentbb54e58929f3ce9fe4da719ff2f3264f14214b3a (diff)
bonding: Implement port churn-machine (AD standard 43.4.17).
The Churn Detection machines detect the situation where a port is operable, but the Actor and Partner have not attached the link to an Aggregator and brought the link into operation within a bound time period. Under normal operation of the LACP, agreement between Actor and Partner should be reached very rapidly. Continued failure to reach agreement can be symptomatic of device failure. Actor-churn-detection state-machine Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com> =================================== BEGIN=True + PortEnable=False | v +------------------------+ ActorPort.Sync=True +------------------+ | ACTOR_CHURN_MONITOR | ---------------------> | NO_ACTOR_CHURN | |========================| |==================| | ActorChurn=False | ActorPort.Sync=False | ActorChurn=False | | ActorChurn.Timer=Start | <--------------------- | | +------------------------+ +------------------+ | ^ | | ActorChurn.Timer=Expired | | ActorPort.Sync=True | | | +-----------------+ | | | ACTOR_CHURN | | | |=================| | +--------------> | ActorChurn=True | ------------+ | | +-----------------+ Similar for the Partner-churn-detection. Signed-off-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bond_3ad.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/net/bond_3ad.h b/include/net/bond_3ad.h
index f04cdbb7848e..c2a40a172fcd 100644
--- a/include/net/bond_3ad.h
+++ b/include/net/bond_3ad.h
@@ -82,6 +82,13 @@ typedef enum {
82 AD_TRANSMIT /* tx Machine */ 82 AD_TRANSMIT /* tx Machine */
83} tx_states_t; 83} tx_states_t;
84 84
85/* churn machine states(43.4.17 in the 802.3ad standard) */
86typedef enum {
87 AD_CHURN_MONITOR, /* monitoring for churn */
88 AD_CHURN, /* churn detected (error) */
89 AD_NO_CHURN /* no churn (no error) */
90} churn_state_t;
91
85/* rx indication types */ 92/* rx indication types */
86typedef enum { 93typedef enum {
87 AD_TYPE_LACPDU = 1, /* type lacpdu */ 94 AD_TYPE_LACPDU = 1, /* type lacpdu */
@@ -229,6 +236,12 @@ typedef struct port {
229 u16 sm_mux_timer_counter; /* state machine mux timer counter */ 236 u16 sm_mux_timer_counter; /* state machine mux timer counter */
230 tx_states_t sm_tx_state; /* state machine tx state */ 237 tx_states_t sm_tx_state; /* state machine tx state */
231 u16 sm_tx_timer_counter; /* state machine tx timer counter(allways on - enter to transmit state 3 time per second) */ 238 u16 sm_tx_timer_counter; /* state machine tx timer counter(allways on - enter to transmit state 3 time per second) */
239 u16 sm_churn_actor_timer_counter;
240 u16 sm_churn_partner_timer_counter;
241 u32 churn_actor_count;
242 u32 churn_partner_count;
243 churn_state_t sm_churn_actor_state;
244 churn_state_t sm_churn_partner_state;
232 struct slave *slave; /* pointer to the bond slave that this port belongs to */ 245 struct slave *slave; /* pointer to the bond slave that this port belongs to */
233 struct aggregator *aggregator; /* pointer to an aggregator that this port related to */ 246 struct aggregator *aggregator; /* pointer to an aggregator that this port related to */
234 struct port *next_port_in_aggregator; /* Next port on the linked list of the parent aggregator */ 247 struct port *next_port_in_aggregator; /* Next port on the linked list of the parent aggregator */
@@ -262,6 +275,22 @@ struct ad_slave_info {
262 u16 id; 275 u16 id;
263}; 276};
264 277
278static inline const char *bond_3ad_churn_desc(churn_state_t state)
279{
280 static const char *const churn_description[] = {
281 "monitoring",
282 "churned",
283 "none",
284 "unknown"
285 };
286 int max_size = sizeof(churn_description) / sizeof(churn_description[0]);
287
288 if (state >= max_size)
289 state = max_size - 1;
290
291 return churn_description[state];
292}
293
265/* ========== AD Exported functions to the main bonding code ========== */ 294/* ========== AD Exported functions to the main bonding code ========== */
266void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution); 295void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution);
267void bond_3ad_bind_slave(struct slave *slave); 296void bond_3ad_bind_slave(struct slave *slave);