diff for duplicates of <20110506115037.GA3299@x61.tchesoft.com> diff --git a/a/1.txt b/N1/1.txt index dc20520..070165a 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -95,8 +95,8 @@ index 31912f1..fdb07be 100644 static const u8 lacpdu_mcast_addr[ETH_ALEN] = MULTICAST_LACPDU_ADDR; --// ========= main 802.3ad protocol functions ========= -+/* ========= main 802.3ad protocol functions ========= */ +-// ================= main 802.3ad protocol functions ================== ++/* ================= main 802.3ad protocol functions ================== */ static int ad_lacpdu_send(struct port *port); static int ad_marker_send(struct port *port, struct bond_marker *marker); static void ad_mux_machine(struct port *port); @@ -109,14 +109,14 @@ index 31912f1..fdb07be 100644 - - -///////////////////////////////////////////////////////////////////////////////// --// ========= api to bonding and kernel code ========= +-// ================= api to bonding and kernel code ================== -///////////////////////////////////////////////////////////////////////////////// +static void ad_marker_info_received(struct bond_marker *marker_info, + struct port *port); +static void ad_marker_response_received(struct bond_marker *marker, + struct port *port); -+/* ========= api to bonding and kernel code ========= */ ++/* ================= api to bonding and kernel code ================== */ /** * __get_bond_by_port - get the port's bonding struct * @port: the port we're looking at @@ -126,7 +126,7 @@ index 31912f1..fdb07be 100644 - // If there's no bond for this port, or this is the last slave + /* If there's no bond for this port, or this is the last slave */ - if ((bond = NULL) || (slave->next = bond->first_slave)) + if ((bond == NULL) || (slave->next == bond->first_slave)) return NULL; @@ -179,7 +175,7 @@ static inline struct aggregator *__get_first_agg(struct port *port) @@ -135,7 +135,7 @@ index 31912f1..fdb07be 100644 - // If there's no bond for this port, or bond has no slaves + /* If there's no bond for this port, or bond has no slaves */ - if ((bond = NULL) || (bond->slave_cnt = 0)) + if ((bond == NULL) || (bond->slave_cnt == 0)) return NULL; @@ -198,7 +194,7 @@ static inline struct aggregator *__get_next_agg(struct aggregator *aggregator) @@ -144,7 +144,7 @@ index 31912f1..fdb07be 100644 - // If there's no bond for this aggregator, or this is the last slave + /* If there's no bond for this aggregator, or this is the last slave */ - if ((bond = NULL) || (slave->next = bond->first_slave)) + if ((bond == NULL) || (slave->next == bond->first_slave)) return NULL; @@ -316,10 +312,9 @@ static u16 __get_link_speed(struct port *port) @@ -237,10 +237,10 @@ index 31912f1..fdb07be 100644 - -///////////////////////////////////////////////////////////////////////////////// --// ========= ad_rx_machine helper functions ========= +-// ================= ad_rx_machine helper functions ================== -///////////////////////////////////////////////////////////////////////////////// - -+/* ========= ad_rx_machine helper functions ========= */ ++/* ================= ad_rx_machine helper functions ================== */ /** * __choose_matched - update a port's matched variable from a received lacpdu * @lacpdu: the lacpdu we've received @@ -250,16 +250,16 @@ index 31912f1..fdb07be 100644 { - // check if all parameters are alike + /* check if all parameters are alike */ - if (((ntohs(lacpdu->partner_port) = port->actor_port_number) && - (ntohs(lacpdu->partner_port_priority) = port->actor_port_priority) && + if (((ntohs(lacpdu->partner_port) == port->actor_port_number) && + (ntohs(lacpdu->partner_port_priority) == port->actor_port_priority) && - !MAC_ADDRESS_COMPARE(&(lacpdu->partner_system), &(port->actor_system)) && + !compare_ether_addr((const u8 *)&(lacpdu->partner_system), (const u8 *)&(port->actor_system)) && - (ntohs(lacpdu->partner_system_priority) = port->actor_system_priority) && - (ntohs(lacpdu->partner_key) = port->actor_oper_port_key) && - ((lacpdu->partner_state & AD_STATE_AGGREGATION) = (port->actor_oper_port_state & AD_STATE_AGGREGATION))) || -- // or this is individual link(aggregation = FALSE) -+ /* or this is individual link(aggregation = FALSE) */ - ((lacpdu->actor_state & AD_STATE_AGGREGATION) = 0) + (ntohs(lacpdu->partner_system_priority) == port->actor_system_priority) && + (ntohs(lacpdu->partner_key) == port->actor_oper_port_key) && + ((lacpdu->partner_state & AD_STATE_AGGREGATION) == (port->actor_oper_port_state & AD_STATE_AGGREGATION))) || +- // or this is individual link(aggregation == FALSE) ++ /* or this is individual link(aggregation == FALSE) */ + ((lacpdu->actor_state & AD_STATE_AGGREGATION) == 0) ) { - // update the state machine Matched variable + /* update the state machine Matched variable */ @@ -415,10 +415,10 @@ index 31912f1..fdb07be 100644 } -////////////////////////////////////////////////////////////////////////////////////// --// ========= main 802.3ad protocol code =================== +-// ================= main 802.3ad protocol code ====================================== -////////////////////////////////////////////////////////////////////////////////////// - -+/* ========= main 802.3ad protocol code ========= */ ++/* ================= main 802.3ad protocol code ================= */ /** * ad_lacpdu_send - send out a lacpdu packet on a given port * @port: the port we're looking at @@ -468,9 +468,9 @@ index 31912f1..fdb07be 100644 + port->sm_mux_state = AD_MUX_WAITING; break; case AD_MUX_WAITING: -- // if SELECTED = FALSE return to DETACH state +- // if SELECTED == FALSE return to DETACH state - if (!(port->sm_vars & AD_PORT_SELECTED)) { // if UNSELECTED -+ /* if SELECTED = FALSE return to DETACH state */ ++ /* if SELECTED == FALSE return to DETACH state */ + if (!(port->sm_vars & AD_PORT_SELECTED)) { port->sm_vars &= ~AD_PORT_READY_N; - // in order to withhold the Selection Logic to check all ports READY_N value @@ -532,7 +532,8 @@ index 31912f1..fdb07be 100644 + (port->partner_oper.port_state & + AD_STATE_SYNCHRONIZATION) && + !__check_agg_selection_timer(port)) { -+ port->sm_mux_state + AD_MUX_COLLECTING_DISTRIBUTING; ++ port->sm_mux_state = ++ AD_MUX_COLLECTING_DISTRIBUTING; + } else if (!(port->sm_vars & AD_PORT_SELECTED) || + (port->sm_vars & AD_PORT_STANDBY)) { + /* if UNSELECTED or STANDBY */ @@ -595,7 +596,8 @@ index 31912f1..fdb07be 100644 case AD_MUX_DETACHED: __detach_bond_from_agg(port); - port->actor_oper_port_state &= ~AD_STATE_SYNCHRONIZATION; -+ port->actor_oper_port_state &+ ~AD_STATE_SYNCHRONIZATION; ++ port->actor_oper_port_state &= ++ ~AD_STATE_SYNCHRONIZATION; ad_disable_collecting_distributing(port); port->actor_oper_port_state &= ~AD_STATE_COLLECTING; port->actor_oper_port_state &= ~AD_STATE_DISTRIBUTING; @@ -603,7 +605,8 @@ index 31912f1..fdb07be 100644 break; case AD_MUX_WAITING: - port->sm_mux_timer_counter = __ad_timer_to_ticks(AD_WAIT_WHILE_TIMER, 0); -+ port->sm_mux_timer_counter + __ad_timer_to_ticks(AD_WAIT_WHILE_TIMER, 0); ++ port->sm_mux_timer_counter = ++ __ad_timer_to_ticks(AD_WAIT_WHILE_TIMER, 0); break; case AD_MUX_ATTACHED: __attach_bond_to_agg(port); @@ -640,12 +643,12 @@ index 31912f1..fdb07be 100644 /* next state */ port->sm_rx_state = AD_RX_PORT_DISABLED; - // check if new lacpdu arrived -- else if (lacpdu && ((port->sm_rx_state = AD_RX_EXPIRED) || (port->sm_rx_state = AD_RX_DEFAULTED) || (port->sm_rx_state = AD_RX_CURRENT))) { +- else if (lacpdu && ((port->sm_rx_state == AD_RX_EXPIRED) || (port->sm_rx_state == AD_RX_DEFAULTED) || (port->sm_rx_state == AD_RX_CURRENT))) { - port->sm_rx_timer_counter = 0; // zero timer + /* check if new lacpdu arrived */ -+ else if (lacpdu && ((port->sm_rx_state = AD_RX_EXPIRED) || -+ (port->sm_rx_state = AD_RX_DEFAULTED) || -+ (port->sm_rx_state = AD_RX_CURRENT))) { ++ else if (lacpdu && ((port->sm_rx_state == AD_RX_EXPIRED) || ++ (port->sm_rx_state == AD_RX_DEFAULTED) || ++ (port->sm_rx_state == AD_RX_CURRENT))) { + port->sm_rx_timer_counter = 0; /* zero timer */ port->sm_rx_state = AD_RX_CURRENT; } else { @@ -680,7 +683,7 @@ index 31912f1..fdb07be 100644 - port->sm_rx_state = AD_RX_EXPIRED; // next state - else if (port->is_enabled - && ((port->sm_vars -- & AD_PORT_LACP_ENABLED) = 0)) +- & AD_PORT_LACP_ENABLED) == 0)) - port->sm_rx_state = AD_RX_LACP_DISABLED; // next state + port->sm_rx_state = AD_RX_INITIALIZE; + else if (port->is_enabled && @@ -689,7 +692,7 @@ index 31912f1..fdb07be 100644 + port->sm_rx_state = AD_RX_EXPIRED; + else if (port->is_enabled && + ((port->sm_vars & -+ AD_PORT_LACP_ENABLED) = 0)) ++ AD_PORT_LACP_ENABLED) == 0)) + port->sm_rx_state = AD_RX_LACP_DISABLED; break; - default: //to silence the compiler @@ -728,11 +731,14 @@ index 31912f1..fdb07be 100644 + * in case of EXPIRED even if LINK_DOWN didn't arrive + * for the port. + */ -+ port->partner_oper.port_state &+ ~AD_STATE_SYNCHRONIZATION; ++ port->partner_oper.port_state &= ++ ~AD_STATE_SYNCHRONIZATION; port->sm_vars &= ~AD_PORT_MATCHED; - port->partner_oper.port_state | AD_STATE_LACP_ACTIVITY; + port->partner_oper.port_state |= + AD_STATE_LACP_ACTIVITY; - port->sm_rx_timer_counter = __ad_timer_to_ticks(AD_CURRENT_WHILE_TIMER, (u16)(AD_SHORT_TIMEOUT)); -+ port->sm_rx_timer_counter + __ad_timer_to_ticks(AD_CURRENT_WHILE_TIMER, ++ port->sm_rx_timer_counter = ++ __ad_timer_to_ticks(AD_CURRENT_WHILE_TIMER, + (u16)(AD_SHORT_TIMEOUT)); port->actor_oper_port_state |= AD_STATE_EXPIRED; break; @@ -809,7 +815,8 @@ index 31912f1..fdb07be 100644 + /* restart tx timer + * to verify that we won't exceed AD_MAX_TX_IN_SECOND + */ - port->sm_tx_timer_counter - ad_ticks_per_sec/AD_MAX_TX_IN_SECOND; + port->sm_tx_timer_counter = +- ad_ticks_per_sec/AD_MAX_TX_IN_SECOND; + ad_ticks_per_sec/AD_MAX_TX_IN_SECOND; } } @@ -910,13 +917,15 @@ index 31912f1..fdb07be 100644 case AD_FAST_PERIODIC: - port->sm_periodic_timer_counter = __ad_timer_to_ticks(AD_PERIODIC_TIMER, (u16)(AD_FAST_PERIODIC_TIME))-1; // decrement 1 tick we lost in the PERIODIC_TX cycle + /* decrement 1 tick we lost in PERIODIC_TX cycle */ -+ port->sm_periodic_timer_counter + __ad_timer_to_ticks(AD_PERIODIC_TIMER, ++ port->sm_periodic_timer_counter = ++ __ad_timer_to_ticks(AD_PERIODIC_TIMER, + (u16)(AD_FAST_PERIODIC_TIME))-1; break; case AD_SLOW_PERIODIC: - port->sm_periodic_timer_counter = __ad_timer_to_ticks(AD_PERIODIC_TIMER, (u16)(AD_SLOW_PERIODIC_TIME))-1; // decrement 1 tick we lost in the PERIODIC_TX cycle + /* decrement 1 tick we lost in PERIODIC_TX cycle */ -+ port->sm_periodic_timer_counter + __ad_timer_to_ticks(AD_PERIODIC_TIMER, ++ port->sm_periodic_timer_counter = ++ __ad_timer_to_ticks(AD_PERIODIC_TIMER, + (u16)(AD_SLOW_PERIODIC_TIME))-1; break; case AD_PERIODIC_TX: @@ -951,18 +960,20 @@ index 31912f1..fdb07be 100644 for (curr_port = temp_aggregator->lag_ports; curr_port; last_port = curr_port, curr_port = curr_port->next_port_in_aggregator) { - if (curr_port = port) { + if (curr_port == port) { temp_aggregator->num_of_ports--; - if (!last_port) {// if it is the first port attached to the aggregator + if (!last_port) { + /* if it is the first port attached + to the aggregator */ - temp_aggregator->lag_ports port->next_port_in_aggregator; + temp_aggregator->lag_ports = + port->next_port_in_aggregator; - } else {// not the first port attached to the aggregator + } else { + /* not the first port attached + to the aggregator */ - last_port->next_port_in_aggregator port->next_port_in_aggregator; + last_port->next_port_in_aggregator = + port->next_port_in_aggregator; } - // clear the port's relations to this aggregator @@ -1012,7 +1023,7 @@ index 31912f1..fdb07be 100644 continue; } - // check if current aggregator suits us -- if (((aggregator->actor_oper_aggregator_key = port->actor_oper_port_key) && // if all parameters match AND +- if (((aggregator->actor_oper_aggregator_key == port->actor_oper_port_key) && // if all parameters match AND - !MAC_ADDRESS_COMPARE(&(aggregator->partner_system), &(port->partner_oper.system)) && + + /* check if current aggregator suits us @@ -1022,10 +1033,10 @@ index 31912f1..fdb07be 100644 + * ii. has partner answers; + * iii. it is not individual + */ -+ if (((aggregator->actor_oper_aggregator_key = port->actor_oper_port_key) && ++ if (((aggregator->actor_oper_aggregator_key == port->actor_oper_port_key) && + !compare_ether_addr((const u8 *)&(aggregator->partner_system), (const u8 *)&(port->partner_oper.system)) && - (aggregator->partner_system_priority = port->partner_oper.system_priority) && - (aggregator->partner_oper_aggregator_key = port->partner_oper.key) + (aggregator->partner_system_priority == port->partner_oper.system_priority) && + (aggregator->partner_oper_aggregator_key == port->partner_oper.key) ) && - ((MAC_ADDRESS_COMPARE(&(port->partner_oper.system), &(null_mac_addr)) && // partner answers - !aggregator->is_individual) // but is not individual OR @@ -1036,7 +1047,8 @@ index 31912f1..fdb07be 100644 - // attach to the founded aggregator + /* attach to the founded aggregator */ port->aggregator = aggregator; - port->actor_port_aggregator_identifier port->aggregator->aggregator_identifier; + port->actor_port_aggregator_identifier = + port->aggregator->aggregator_identifier; @@ -1352,42 +1410,45 @@ static void ad_port_selection_logic(struct port *port) port->actor_port_number, port->aggregator->aggregator_identifier); @@ -1056,7 +1068,8 @@ index 31912f1..fdb07be 100644 - // assign port a new aggregator + /* assign port a new aggregator */ port->aggregator = free_aggregator; - port->actor_port_aggregator_identifier port->aggregator->aggregator_identifier; + port->actor_port_aggregator_identifier = + port->aggregator->aggregator_identifier; - // update the new aggregator's parameters - // if port was responsed from the end-user @@ -1070,14 +1083,19 @@ index 31912f1..fdb07be 100644 - port->aggregator->actor_admin_aggregator_key = port->actor_admin_port_key; - port->aggregator->actor_oper_aggregator_key = port->actor_oper_port_key; -+ port->aggregator->actor_admin_aggregator_key + port->actor_admin_port_key; -+ port->aggregator->actor_oper_aggregator_key + port->actor_oper_port_key; - port->aggregator->partner_system - port->partner_oper.system; ++ port->aggregator->actor_admin_aggregator_key = ++ port->actor_admin_port_key; ++ port->aggregator->actor_oper_aggregator_key = ++ port->actor_oper_port_key; + port->aggregator->partner_system = +- port->partner_oper.system; + port->partner_oper.system; - port->aggregator->partner_system_priority - port->partner_oper.system_priority; + port->aggregator->partner_system_priority = +- port->partner_oper.system_priority; - port->aggregator->partner_oper_aggregator_key = port->partner_oper.key; + port->partner_oper.system_priority; -+ port->aggregator->partner_oper_aggregator_key + port->partner_oper.key; ++ port->aggregator->partner_oper_aggregator_key = ++ port->partner_oper.key; port->aggregator->receive_state = 1; port->aggregator->transmit_state = 1; port->aggregator->lag_ports = port; @@ -1092,12 +1110,12 @@ index 31912f1..fdb07be 100644 port->actor_port_number, port->slave->dev->name); } } -- // if all aggregator's ports are READY_N = TRUE, set ready=TRUE in all aggregator's ports -- // else set readyúLSE in all aggregator's ports +- // if all aggregator's ports are READY_N == TRUE, set ready=TRUE in all aggregator's ports +- // else set ready=FALSE in all aggregator's ports - __set_agg_ports_ready(port->aggregator, __agg_ports_are_ready(port->aggregator)); -+ /* if all aggregator's ports are READY_N = TRUE, ++ /* if all aggregator's ports are READY_N == TRUE, + * set ready=TRUE in all aggregator's ports -+ * else set readyúLSE in all aggregator's ports ++ * else set ready=FALSE in all aggregator's ports + */ + __set_agg_ports_ready(port->aggregator, + __agg_ports_are_ready(port->aggregator)); @@ -1115,7 +1133,7 @@ index 31912f1..fdb07be 100644 @@ -1533,16 +1596,15 @@ static void ad_agg_selection_logic(struct aggregator *agg) if (best && - __get_agg_selection_mode(best->lag_ports) = BOND_AD_STABLE) { + __get_agg_selection_mode(best->lag_ports) == BOND_AD_STABLE) { - /* - * For the STABLE policy, don't replace the old active - * aggregator if it's still active (it has an answering @@ -1179,8 +1197,10 @@ index 31912f1..fdb07be 100644 port->actor_oper_port_key = 1; - port->actor_admin_port_state = AD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY; - port->actor_oper_port_state = AD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY; -+ port->actor_admin_port_state + AD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY; -+ port->actor_oper_port_state + AD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY; ++ port->actor_admin_port_state = ++ AD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY; ++ port->actor_oper_port_state = ++ AD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY; if (lacp_fast) port->actor_oper_port_state |= AD_STATE_LACP_TIMEOUT; @@ -1222,7 +1242,8 @@ index 31912f1..fdb07be 100644 marker.requester_system = port->actor_system; - // convert requester_port(u32) to Big Endian + /* convert requester_port(u32) to Big Endian */ - marker.requester_transaction_id - (((++port->transaction_id & 0xFF) << 24) + marker.requester_transaction_id = +- (((++port->transaction_id & 0xFF) << 24) - | ((port->transaction_id & 0xFF00) << 8) - | ((port->transaction_id & 0xFF0000) >> 8) - | ((port->transaction_id & 0xFF000000) >> 24)); @@ -1271,9 +1292,9 @@ index 31912f1..fdb07be 100644 } -////////////////////////////////////////////////////////////////////////////////////// --// ========= AD exported functions to the main bonding code ========= +-// ================= AD exported functions to the main bonding code ================== -////////////////////////////////////////////////////////////////////////////////////// -+/* ======= AD exported functions to the main bonding code ====== */ ++/* ============= AD exported functions to the main bonding code ============ */ -// Check aggregators status in team every T seconds +/* Check aggregators status in team every T seconds */ @@ -1295,7 +1316,8 @@ index 31912f1..fdb07be 100644 BOND_AD_INFO(bond).lacp_fast = lacp_fast; BOND_AD_INFO(bond).system.sys_priority = 0xFFFF; - BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr); -+ BOND_AD_INFO(bond).system.sys_mac_addr + *((struct mac_addr *)bond->dev->dev_addr); ++ BOND_AD_INFO(bond).system.sys_mac_addr = ++ *((struct mac_addr *)bond->dev->dev_addr); - // initialize how many times this module is called in one second(should be about every 100ms) + /* initialize how many times this module is @@ -1364,7 +1386,8 @@ index 31912f1..fdb07be 100644 ad_initialize_agg(aggregator); - aggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr); -+ aggregator->aggregator_mac_address + *((struct mac_addr *)bond->dev->dev_addr); ++ aggregator->aggregator_mac_address = ++ *((struct mac_addr *)bond->dev->dev_addr); aggregator->aggregator_identifier = (++aggregator_identifier); aggregator->slave = slave; aggregator->is_active = 0; @@ -1409,34 +1432,34 @@ index 31912f1..fdb07be 100644 - for (; new_aggregator; new_aggregator = __get_next_agg(new_aggregator)) { - // if the new aggregator is empty, or it is connected to our port only - if (!new_aggregator->lag_ports -- || ((new_aggregator->lag_ports = port) +- || ((new_aggregator->lag_ports == port) - && !new_aggregator->lag_ports->next_port_in_aggregator)) + for (; new_aggregator; + new_aggregator = __get_next_agg(new_aggregator)) { + /* if the new aggregator is empty, + or it is connected to our port only */ + if (!new_aggregator->lag_ports || -+ ((new_aggregator->lag_ports = port) && ++ ((new_aggregator->lag_ports == port) && + !new_aggregator->lag_ports->next_port_in_aggregator)) break; } - // if new aggregator found, copy the aggregator's parameters - // and connect the related lag_ports to the new aggregator -- if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports = port) && !new_aggregator->lag_ports->next_port_in_aggregator))) { +- if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) { + /* if new aggregator found, copy the aggregator's + * parameters and connect the related lag_ports to the + * new aggregator + */ + if ((new_aggregator) && + ((!new_aggregator->lag_ports) || -+ ((new_aggregator->lag_ports = port) && ++ ((new_aggregator->lag_ports == port) && + !new_aggregator->lag_ports->next_port_in_aggregator))) { pr_debug("Some port(s) related to LAG %d - replacing with LAG %d\n", aggregator->aggregator_identifier, new_aggregator->aggregator_identifier); -- if ((new_aggregator->lag_ports = port) && new_aggregator->is_active) { -+ if ((new_aggregator->lag_ports = port) && +- if ((new_aggregator->lag_ports == port) && new_aggregator->is_active) { ++ if ((new_aggregator->lag_ports == port) && + new_aggregator->is_active) { pr_info("%s: Removing an active aggregator\n", aggregator->slave->dev->master->name); @@ -1501,18 +1524,20 @@ index 31912f1..fdb07be 100644 for (temp_port = temp_aggregator->lag_ports; temp_port; prev_port = temp_port, temp_port = temp_port->next_port_in_aggregator) { -- if (temp_port = port) { // the aggregator found - detach the port from this aggregator -+ if (temp_port = port) { +- if (temp_port == port) { // the aggregator found - detach the port from this aggregator ++ if (temp_port == port) { + /* the aggregator found + detach the port from this aggregator */ if (prev_port) - prev_port->next_port_in_aggregator = temp_port->next_port_in_aggregator; -+ prev_port->next_port_in_aggregator + temp_port->next_port_in_aggregator; ++ prev_port->next_port_in_aggregator = ++ temp_port->next_port_in_aggregator; else - temp_aggregator->lag_ports = temp_port->next_port_in_aggregator; -+ temp_aggregator->lag_ports + temp_port->next_port_in_aggregator; ++ temp_aggregator->lag_ports = ++ temp_port->next_port_in_aggregator; temp_aggregator->num_of_ports--; - if (temp_aggregator->num_of_ports = 0) { + if (temp_aggregator->num_of_ports == 0) { select_new_active_agg = temp_aggregator->is_active; - // clear the aggregator + /* clear the aggregator */ @@ -1531,7 +1556,7 @@ index 31912f1..fdb07be 100644 - //check if there are any slaves + /* check if there are any slaves */ - if (bond->slave_cnt = 0) + if (bond->slave_cnt == 0) goto re_arm; - // check if agg_select_timer timer after initialize is timed out @@ -1613,7 +1638,8 @@ index 31912f1..fdb07be 100644 } port->actor_admin_port_key &= ~AD_SPEED_KEY_BITS; - port->actor_oper_port_key = port->actor_admin_port_key | (__get_link_speed(port) << 1); + port->actor_oper_port_key = port->actor_admin_port_key |= + (__get_link_speed(port) << 1); + pr_debug("Port %d changed speed\n", port->actor_port_number); - // there is no need to reselect a new aggregator, just signal the @@ -1639,7 +1665,8 @@ index 31912f1..fdb07be 100644 } port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS; - port->actor_oper_port_key = port->actor_admin_port_key | __get_duplex(port); + port->actor_oper_port_key = port->actor_admin_port_key |= + __get_duplex(port); + pr_debug("Port %d changed duplex\n", port->actor_port_number); - // there is no need to reselect a new aggregator, just signal the @@ -1671,19 +1698,20 @@ index 31912f1..fdb07be 100644 + * instead of N/A (duplex) / 0(speed) + * on link up we are forcing recheck on the duplex and speed + */ - if (link = BOND_LINK_UP) { + if (link == BOND_LINK_UP) { port->is_enabled = true; port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS; @@ -2329,9 +2440,15 @@ void bond_3ad_handle_link_change(struct slave *slave, char link) - port->actor_oper_port_key = (port->actor_admin_port_key & ~AD_SPEED_KEY_BITS); + port->actor_oper_port_key = (port->actor_admin_port_key &= + ~AD_SPEED_KEY_BITS); } -- //BOND_PRINT_DBG(("Port %d changed link status to %s", port->actor_port_number, ((link = BOND_LINK_UP)?"UP":"DOWN"))); +- //BOND_PRINT_DBG(("Port %d changed link status to %s", port->actor_port_number, ((link == BOND_LINK_UP)?"UP":"DOWN"))); - // there is no need to reselect a new aggregator, just signal the - // state machines to reinitialize + + /* BOND_PRINT_DBG(("Port %d changed link status to %s", + * port->actor_port_number, -+ * ((link = BOND_LINK_UP)?"UP":"DOWN"))); ++ * ((link == BOND_LINK_UP)?"UP":"DOWN"))); + */ + + /* there is no need to reselect a new aggregator, @@ -1994,8 +2022,8 @@ index b28baff..83b0961 100644 #pragma pack() #endif --// ========= AD Exported structures to the main bonding code ========= -+/* ====== AD Exported structures to the main bonding code ====== */ +-// ================= AD Exported structures to the main bonding code ================== ++/* =========== AD Exported structures to the main bonding code ============ */ #define BOND_AD_INFO(bond) ((bond)->ad_info) #define SLAVE_AD_INFO(slave) ((slave)->ad_info) @@ -2025,10 +2053,10 @@ index b28baff..83b0961 100644 u16 id; }; --// ========= AD Exported functions to the main bonding code ========= +-// ================= AD Exported functions to the main bonding code ================== -void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution, int lacp_fast); -int bond_3ad_bind_slave(struct slave *slave); -+/* ===== AD Exported functions to the main bonding code ===== */ ++/* ========= AD Exported functions to the main bonding code ========== */ +void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution, + int lacp_fast); +int bond_3ad_bind_slave(struct slave *slave); @@ -2053,7 +2081,3 @@ index b28baff..83b0961 100644 -- Rafael Aquini <aquini@linux.com> --- -To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/a/content_digest b/N1/content_digest index 78bde8f..4175832 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,6 +1,6 @@ "From\0Rafael Aquini <aquini@linux.com>\0" "Subject\0[PATCH] net/bonding: adjust codingstyle for bond_3ad files.\0" - "Date\0Fri, 06 May 2011 11:50:53 +0000\0" + "Date\0Fri, 6 May 2011 08:50:53 -0300\0" "To\0kernel-janitors@vger.kernel.org\0" "Cc\0David Miller <davem@davemloft.net>" Joe Perches <joe@perches.com> @@ -107,8 +107,8 @@ " \n" " static const u8 lacpdu_mcast_addr[ETH_ALEN] = MULTICAST_LACPDU_ADDR;\n" " \n" - "-// ========= main 802.3ad protocol functions =========\n" - "+/* ========= main 802.3ad protocol functions ========= */\n" + "-// ================= main 802.3ad protocol functions ==================\n" + "+/* ================= main 802.3ad protocol functions ================== */\n" " static int ad_lacpdu_send(struct port *port);\n" " static int ad_marker_send(struct port *port, struct bond_marker *marker);\n" " static void ad_mux_machine(struct port *port);\n" @@ -121,14 +121,14 @@ "-\n" "-\n" "-/////////////////////////////////////////////////////////////////////////////////\n" - "-// ========= api to bonding and kernel code =========\n" + "-// ================= api to bonding and kernel code ==================\n" "-/////////////////////////////////////////////////////////////////////////////////\n" "+static void ad_marker_info_received(struct bond_marker *marker_info,\n" "+\t\t\t\t struct port *port);\n" "+static void ad_marker_response_received(struct bond_marker *marker,\n" "+\t\t\t\t\tstruct port *port);\n" " \n" - "+/* ========= api to bonding and kernel code ========= */\n" + "+/* ================= api to bonding and kernel code ================== */\n" " /**\n" " * __get_bond_by_port - get the port's bonding struct\n" " * @port: the port we're looking at\n" @@ -138,7 +138,7 @@ " \n" "-\t// If there's no bond for this port, or this is the last slave\n" "+\t/* If there's no bond for this port, or this is the last slave */\n" - " \tif ((bond = NULL) || (slave->next = bond->first_slave))\n" + " \tif ((bond == NULL) || (slave->next == bond->first_slave))\n" " \t\treturn NULL;\n" " \n" "@@ -179,7 +175,7 @@ static inline struct aggregator *__get_first_agg(struct port *port)\n" @@ -147,7 +147,7 @@ " \n" "-\t// If there's no bond for this port, or bond has no slaves\n" "+\t/* If there's no bond for this port, or bond has no slaves */\n" - " \tif ((bond = NULL) || (bond->slave_cnt = 0))\n" + " \tif ((bond == NULL) || (bond->slave_cnt == 0))\n" " \t\treturn NULL;\n" " \n" "@@ -198,7 +194,7 @@ static inline struct aggregator *__get_next_agg(struct aggregator *aggregator)\n" @@ -156,7 +156,7 @@ " \n" "-\t// If there's no bond for this aggregator, or this is the last slave\n" "+\t/* If there's no bond for this aggregator, or this is the last slave */\n" - " \tif ((bond = NULL) || (slave->next = bond->first_slave))\n" + " \tif ((bond == NULL) || (slave->next == bond->first_slave))\n" " \t\treturn NULL;\n" " \n" "@@ -316,10 +312,9 @@ static u16 __get_link_speed(struct port *port)\n" @@ -249,10 +249,10 @@ " \n" "-\n" "-/////////////////////////////////////////////////////////////////////////////////\n" - "-// ========= ad_rx_machine helper functions =========\n" + "-// ================= ad_rx_machine helper functions ==================\n" "-/////////////////////////////////////////////////////////////////////////////////\n" "-\n" - "+/* ========= ad_rx_machine helper functions ========= */\n" + "+/* ================= ad_rx_machine helper functions ================== */\n" " /**\n" " * __choose_matched - update a port's matched variable from a received lacpdu\n" " * @lacpdu: the lacpdu we've received\n" @@ -262,16 +262,16 @@ " {\n" "-\t// check if all parameters are alike\n" "+\t/* check if all parameters are alike */\n" - " \tif (((ntohs(lacpdu->partner_port) = port->actor_port_number) &&\n" - " \t (ntohs(lacpdu->partner_port_priority) = port->actor_port_priority) &&\n" + " \tif (((ntohs(lacpdu->partner_port) == port->actor_port_number) &&\n" + " \t (ntohs(lacpdu->partner_port_priority) == port->actor_port_priority) &&\n" "-\t !MAC_ADDRESS_COMPARE(&(lacpdu->partner_system), &(port->actor_system)) &&\n" "+\t !compare_ether_addr((const u8 *)&(lacpdu->partner_system), (const u8 *)&(port->actor_system)) &&\n" - " \t (ntohs(lacpdu->partner_system_priority) = port->actor_system_priority) &&\n" - " \t (ntohs(lacpdu->partner_key) = port->actor_oper_port_key) &&\n" - " \t ((lacpdu->partner_state & AD_STATE_AGGREGATION) = (port->actor_oper_port_state & AD_STATE_AGGREGATION))) ||\n" - "-\t // or this is individual link(aggregation = FALSE)\n" - "+\t /* or this is individual link(aggregation = FALSE) */\n" - " \t ((lacpdu->actor_state & AD_STATE_AGGREGATION) = 0)\n" + " \t (ntohs(lacpdu->partner_system_priority) == port->actor_system_priority) &&\n" + " \t (ntohs(lacpdu->partner_key) == port->actor_oper_port_key) &&\n" + " \t ((lacpdu->partner_state & AD_STATE_AGGREGATION) == (port->actor_oper_port_state & AD_STATE_AGGREGATION))) ||\n" + "-\t // or this is individual link(aggregation == FALSE)\n" + "+\t /* or this is individual link(aggregation == FALSE) */\n" + " \t ((lacpdu->actor_state & AD_STATE_AGGREGATION) == 0)\n" " \t\t) {\n" "-\t\t// update the state machine Matched variable\n" "+\t\t/* update the state machine Matched variable */\n" @@ -427,10 +427,10 @@ " }\n" " \n" "-//////////////////////////////////////////////////////////////////////////////////////\n" - "-// ========= main 802.3ad protocol code ===================\n" + "-// ================= main 802.3ad protocol code ======================================\n" "-//////////////////////////////////////////////////////////////////////////////////////\n" "-\n" - "+/* ========= main 802.3ad protocol code ========= */\n" + "+/* ================= main 802.3ad protocol code ================= */\n" " /**\n" " * ad_lacpdu_send - send out a lacpdu packet on a given port\n" " * @port: the port we're looking at\n" @@ -480,9 +480,9 @@ "+\t\t\t\tport->sm_mux_state = AD_MUX_WAITING;\n" " \t\t\tbreak;\n" " \t\tcase AD_MUX_WAITING:\n" - "-\t\t\t// if SELECTED = FALSE return to DETACH state\n" + "-\t\t\t// if SELECTED == FALSE return to DETACH state\n" "-\t\t\tif (!(port->sm_vars & AD_PORT_SELECTED)) { // if UNSELECTED\n" - "+\t\t\t/* if SELECTED = FALSE return to DETACH state */\n" + "+\t\t\t/* if SELECTED == FALSE return to DETACH state */\n" "+\t\t\tif (!(port->sm_vars & AD_PORT_SELECTED)) {\n" " \t\t\t\tport->sm_vars &= ~AD_PORT_READY_N;\n" "-\t\t\t\t// in order to withhold the Selection Logic to check all ports READY_N value\n" @@ -544,7 +544,8 @@ "+\t\t\t (port->partner_oper.port_state &\n" "+\t\t\t AD_STATE_SYNCHRONIZATION) &&\n" "+\t\t\t !__check_agg_selection_timer(port)) {\n" - "+\t\t\t\tport->sm_mux_state +\t\t\t\t\tAD_MUX_COLLECTING_DISTRIBUTING;\n" + "+\t\t\t\tport->sm_mux_state =\n" + "+\t\t\t\t\tAD_MUX_COLLECTING_DISTRIBUTING;\n" "+\t\t\t} else if (!(port->sm_vars & AD_PORT_SELECTED) ||\n" "+\t\t\t\t (port->sm_vars & AD_PORT_STANDBY)) {\n" "+\t\t\t\t/* if UNSELECTED or STANDBY */\n" @@ -607,7 +608,8 @@ " \t\tcase AD_MUX_DETACHED:\n" " \t\t\t__detach_bond_from_agg(port);\n" "-\t\t\tport->actor_oper_port_state &= ~AD_STATE_SYNCHRONIZATION;\n" - "+\t\t\tport->actor_oper_port_state &+\t\t\t\t\t~AD_STATE_SYNCHRONIZATION;\n" + "+\t\t\tport->actor_oper_port_state &=\n" + "+\t\t\t\t\t~AD_STATE_SYNCHRONIZATION;\n" " \t\t\tad_disable_collecting_distributing(port);\n" " \t\t\tport->actor_oper_port_state &= ~AD_STATE_COLLECTING;\n" " \t\t\tport->actor_oper_port_state &= ~AD_STATE_DISTRIBUTING;\n" @@ -615,7 +617,8 @@ " \t\t\tbreak;\n" " \t\tcase AD_MUX_WAITING:\n" "-\t\t\tport->sm_mux_timer_counter = __ad_timer_to_ticks(AD_WAIT_WHILE_TIMER, 0);\n" - "+\t\t\tport->sm_mux_timer_counter +\t\t\t\t__ad_timer_to_ticks(AD_WAIT_WHILE_TIMER, 0);\n" + "+\t\t\tport->sm_mux_timer_counter =\n" + "+\t\t\t\t__ad_timer_to_ticks(AD_WAIT_WHILE_TIMER, 0);\n" " \t\t\tbreak;\n" " \t\tcase AD_MUX_ATTACHED:\n" " \t\t\t__attach_bond_to_agg(port);\n" @@ -652,12 +655,12 @@ " \t\t/* next state */\n" " \t\tport->sm_rx_state = AD_RX_PORT_DISABLED;\n" "-\t// check if new lacpdu arrived\n" - "-\telse if (lacpdu && ((port->sm_rx_state = AD_RX_EXPIRED) || (port->sm_rx_state = AD_RX_DEFAULTED) || (port->sm_rx_state = AD_RX_CURRENT))) {\n" + "-\telse if (lacpdu && ((port->sm_rx_state == AD_RX_EXPIRED) || (port->sm_rx_state == AD_RX_DEFAULTED) || (port->sm_rx_state == AD_RX_CURRENT))) {\n" "-\t\tport->sm_rx_timer_counter = 0; // zero timer\n" "+\t/* check if new lacpdu arrived */\n" - "+\telse if (lacpdu && ((port->sm_rx_state = AD_RX_EXPIRED) ||\n" - "+\t\t (port->sm_rx_state = AD_RX_DEFAULTED) ||\n" - "+\t\t (port->sm_rx_state = AD_RX_CURRENT))) {\n" + "+\telse if (lacpdu && ((port->sm_rx_state == AD_RX_EXPIRED) ||\n" + "+\t\t (port->sm_rx_state == AD_RX_DEFAULTED) ||\n" + "+\t\t (port->sm_rx_state == AD_RX_CURRENT))) {\n" "+\t\tport->sm_rx_timer_counter = 0; /* zero timer */\n" " \t\tport->sm_rx_state = AD_RX_CURRENT;\n" " \t} else {\n" @@ -692,7 +695,7 @@ "-\t\t\t\t\tport->sm_rx_state = AD_RX_EXPIRED;\t// next state\n" "-\t\t\t\telse if (port->is_enabled\n" "-\t\t\t\t\t && ((port->sm_vars\n" - "-\t\t\t\t\t & AD_PORT_LACP_ENABLED) = 0))\n" + "-\t\t\t\t\t & AD_PORT_LACP_ENABLED) == 0))\n" "-\t\t\t\t\tport->sm_rx_state = AD_RX_LACP_DISABLED; // next state\n" "+\t\t\t\t\tport->sm_rx_state = AD_RX_INITIALIZE;\n" "+\t\t\t\telse if (port->is_enabled &&\n" @@ -701,7 +704,7 @@ "+\t\t\t\t\tport->sm_rx_state = AD_RX_EXPIRED;\n" "+\t\t\t\telse if (port->is_enabled &&\n" "+\t\t\t\t\t ((port->sm_vars &\n" - "+\t\t\t\t\t AD_PORT_LACP_ENABLED) = 0))\n" + "+\t\t\t\t\t AD_PORT_LACP_ENABLED) == 0))\n" "+\t\t\t\t\tport->sm_rx_state = AD_RX_LACP_DISABLED;\n" " \t\t\t\tbreak;\n" "-\t\t\tdefault: //to silence the compiler\n" @@ -740,11 +743,14 @@ "+\t\t\t * in case of EXPIRED even if LINK_DOWN didn't arrive\n" "+\t\t\t * for the port.\n" "+\t\t\t */\n" - "+\t\t\tport->partner_oper.port_state &+\t\t\t\t\t\t~AD_STATE_SYNCHRONIZATION;\n" + "+\t\t\tport->partner_oper.port_state &=\n" + "+\t\t\t\t\t\t~AD_STATE_SYNCHRONIZATION;\n" " \t\t\tport->sm_vars &= ~AD_PORT_MATCHED;\n" - " \t\t\tport->partner_oper.port_state | \t\t\t\tAD_STATE_LACP_ACTIVITY;\n" + " \t\t\tport->partner_oper.port_state |=\n" + " \t\t\t\tAD_STATE_LACP_ACTIVITY;\n" "-\t\t\tport->sm_rx_timer_counter = __ad_timer_to_ticks(AD_CURRENT_WHILE_TIMER, (u16)(AD_SHORT_TIMEOUT));\n" - "+\t\t\tport->sm_rx_timer_counter +\t\t\t\t__ad_timer_to_ticks(AD_CURRENT_WHILE_TIMER,\n" + "+\t\t\tport->sm_rx_timer_counter =\n" + "+\t\t\t\t__ad_timer_to_ticks(AD_CURRENT_WHILE_TIMER,\n" "+\t\t\t\t\t\t(u16)(AD_SHORT_TIMEOUT));\n" " \t\t\tport->actor_oper_port_state |= AD_STATE_EXPIRED;\n" " \t\t\tbreak;\n" @@ -821,7 +827,8 @@ "+\t\t/* restart tx timer\n" "+\t\t * to verify that we won't exceed AD_MAX_TX_IN_SECOND\n" "+\t\t */\n" - " \t\tport->sm_tx_timer_counter -\t\t\tad_ticks_per_sec/AD_MAX_TX_IN_SECOND;\n" + " \t\tport->sm_tx_timer_counter =\n" + "-\t\t\tad_ticks_per_sec/AD_MAX_TX_IN_SECOND;\n" "+\t\t\t\tad_ticks_per_sec/AD_MAX_TX_IN_SECOND;\n" " \t}\n" " }\n" @@ -922,13 +929,15 @@ " \t\tcase AD_FAST_PERIODIC:\n" "-\t\t\tport->sm_periodic_timer_counter = __ad_timer_to_ticks(AD_PERIODIC_TIMER, (u16)(AD_FAST_PERIODIC_TIME))-1; // decrement 1 tick we lost in the PERIODIC_TX cycle\n" "+\t\t\t/* decrement 1 tick we lost in PERIODIC_TX cycle */\n" - "+\t\t\tport->sm_periodic_timer_counter +\t\t\t\t\t__ad_timer_to_ticks(AD_PERIODIC_TIMER,\n" + "+\t\t\tport->sm_periodic_timer_counter =\n" + "+\t\t\t\t\t__ad_timer_to_ticks(AD_PERIODIC_TIMER,\n" "+\t\t\t\t\t\t(u16)(AD_FAST_PERIODIC_TIME))-1;\n" " \t\t\tbreak;\n" " \t\tcase AD_SLOW_PERIODIC:\n" "-\t\t\tport->sm_periodic_timer_counter = __ad_timer_to_ticks(AD_PERIODIC_TIMER, (u16)(AD_SLOW_PERIODIC_TIME))-1; // decrement 1 tick we lost in the PERIODIC_TX cycle\n" "+\t\t\t/* decrement 1 tick we lost in PERIODIC_TX cycle */\n" - "+\t\t\tport->sm_periodic_timer_counter +\t\t\t\t\t__ad_timer_to_ticks(AD_PERIODIC_TIMER,\n" + "+\t\t\tport->sm_periodic_timer_counter =\n" + "+\t\t\t\t\t__ad_timer_to_ticks(AD_PERIODIC_TIMER,\n" "+\t\t\t\t\t\t(u16)(AD_SLOW_PERIODIC_TIME))-1;\n" " \t\t\tbreak;\n" " \t\tcase AD_PERIODIC_TX:\n" @@ -963,18 +972,20 @@ " \t\tfor (curr_port = temp_aggregator->lag_ports; curr_port;\n" " \t\t last_port = curr_port,\n" " \t\t\t curr_port = curr_port->next_port_in_aggregator) {\n" - " \t\t\tif (curr_port = port) {\n" + " \t\t\tif (curr_port == port) {\n" " \t\t\t\ttemp_aggregator->num_of_ports--;\n" "-\t\t\t\tif (!last_port) {// if it is the first port attached to the aggregator\n" "+\t\t\t\tif (!last_port) {\n" "+\t\t\t\t\t/* if it is the first port attached\n" "+\t\t\t\t\t to the aggregator */\n" - " \t\t\t\t\ttemp_aggregator->lag_ports \t\t\t\t\t\tport->next_port_in_aggregator;\n" + " \t\t\t\t\ttemp_aggregator->lag_ports =\n" + " \t\t\t\t\t\tport->next_port_in_aggregator;\n" "-\t\t\t\t} else {// not the first port attached to the aggregator\n" "+\t\t\t\t} else {\n" "+\t\t\t\t\t/* not the first port attached\n" "+\t\t\t\t\t to the aggregator */\n" - " \t\t\t\t\tlast_port->next_port_in_aggregator \t\t\t\t\t\tport->next_port_in_aggregator;\n" + " \t\t\t\t\tlast_port->next_port_in_aggregator =\n" + " \t\t\t\t\t\tport->next_port_in_aggregator;\n" " \t\t\t\t}\n" " \n" "-\t\t\t\t// clear the port's relations to this aggregator\n" @@ -1024,7 +1035,7 @@ " \t\t\tcontinue;\n" " \t\t}\n" "-\t\t// check if current aggregator suits us\n" - "-\t\tif (((aggregator->actor_oper_aggregator_key = port->actor_oper_port_key) && // if all parameters match AND\n" + "-\t\tif (((aggregator->actor_oper_aggregator_key == port->actor_oper_port_key) && // if all parameters match AND\n" "-\t\t !MAC_ADDRESS_COMPARE(&(aggregator->partner_system), &(port->partner_oper.system)) &&\n" "+\n" "+\t\t/* check if current aggregator suits us\n" @@ -1034,10 +1045,10 @@ "+\t\t * ii. has partner answers;\n" "+\t\t * iii. it is not individual\n" "+\t\t */\n" - "+\t\tif (((aggregator->actor_oper_aggregator_key = port->actor_oper_port_key) &&\n" + "+\t\tif (((aggregator->actor_oper_aggregator_key == port->actor_oper_port_key) &&\n" "+\t\t !compare_ether_addr((const u8 *)&(aggregator->partner_system), (const u8 *)&(port->partner_oper.system)) &&\n" - " \t\t (aggregator->partner_system_priority = port->partner_oper.system_priority) &&\n" - " \t\t (aggregator->partner_oper_aggregator_key = port->partner_oper.key)\n" + " \t\t (aggregator->partner_system_priority == port->partner_oper.system_priority) &&\n" + " \t\t (aggregator->partner_oper_aggregator_key == port->partner_oper.key)\n" " \t\t ) &&\n" "-\t\t ((MAC_ADDRESS_COMPARE(&(port->partner_oper.system), &(null_mac_addr)) && // partner answers\n" "-\t\t !aggregator->is_individual) // but is not individual OR\n" @@ -1048,7 +1059,8 @@ "-\t\t\t// attach to the founded aggregator\n" "+\t\t\t/* attach to the founded aggregator */\n" " \t\t\tport->aggregator = aggregator;\n" - " \t\t\tport->actor_port_aggregator_identifier \t\t\t\tport->aggregator->aggregator_identifier;\n" + " \t\t\tport->actor_port_aggregator_identifier =\n" + " \t\t\t\tport->aggregator->aggregator_identifier;\n" "@@ -1352,42 +1410,45 @@ static void ad_port_selection_logic(struct port *port)\n" " \t\t\t\t port->actor_port_number,\n" " \t\t\t\t port->aggregator->aggregator_identifier);\n" @@ -1068,7 +1080,8 @@ "-\t\t\t// assign port a new aggregator\n" "+\t\t\t/* assign port a new aggregator */\n" " \t\t\tport->aggregator = free_aggregator;\n" - " \t\t\tport->actor_port_aggregator_identifier \t\t\t\tport->aggregator->aggregator_identifier;\n" + " \t\t\tport->actor_port_aggregator_identifier =\n" + " \t\t\t\tport->aggregator->aggregator_identifier;\n" " \n" "-\t\t\t// update the new aggregator's parameters\n" "-\t\t\t// if port was responsed from the end-user\n" @@ -1082,14 +1095,19 @@ " \n" "-\t\t\tport->aggregator->actor_admin_aggregator_key = port->actor_admin_port_key;\n" "-\t\t\tport->aggregator->actor_oper_aggregator_key = port->actor_oper_port_key;\n" - "+\t\t\tport->aggregator->actor_admin_aggregator_key +\t\t\t\t\t\tport->actor_admin_port_key;\n" - "+\t\t\tport->aggregator->actor_oper_aggregator_key +\t\t\t\t\t\tport->actor_oper_port_key;\n" - " \t\t\tport->aggregator->partner_system -\t\t\t\tport->partner_oper.system;\n" + "+\t\t\tport->aggregator->actor_admin_aggregator_key =\n" + "+\t\t\t\t\t\tport->actor_admin_port_key;\n" + "+\t\t\tport->aggregator->actor_oper_aggregator_key =\n" + "+\t\t\t\t\t\tport->actor_oper_port_key;\n" + " \t\t\tport->aggregator->partner_system =\n" + "-\t\t\t\tport->partner_oper.system;\n" "+\t\t\t\t\t\tport->partner_oper.system;\n" - " \t\t\tport->aggregator->partner_system_priority -\t\t\t\tport->partner_oper.system_priority;\n" + " \t\t\tport->aggregator->partner_system_priority =\n" + "-\t\t\t\tport->partner_oper.system_priority;\n" "-\t\t\tport->aggregator->partner_oper_aggregator_key = port->partner_oper.key;\n" "+\t\t\t\t\tport->partner_oper.system_priority;\n" - "+\t\t\tport->aggregator->partner_oper_aggregator_key +\t\t\t\t\t\tport->partner_oper.key;\n" + "+\t\t\tport->aggregator->partner_oper_aggregator_key =\n" + "+\t\t\t\t\t\tport->partner_oper.key;\n" " \t\t\tport->aggregator->receive_state = 1;\n" " \t\t\tport->aggregator->transmit_state = 1;\n" " \t\t\tport->aggregator->lag_ports = port;\n" @@ -1104,12 +1122,12 @@ " \t\t\t port->actor_port_number, port->slave->dev->name);\n" " \t\t}\n" " \t}\n" - "-\t// if all aggregator's ports are READY_N = TRUE, set ready=TRUE in all aggregator's ports\n" - "-\t// else set ready\303\272LSE in all aggregator's ports\n" + "-\t// if all aggregator's ports are READY_N == TRUE, set ready=TRUE in all aggregator's ports\n" + "-\t// else set ready=FALSE in all aggregator's ports\n" "-\t__set_agg_ports_ready(port->aggregator, __agg_ports_are_ready(port->aggregator));\n" - "+\t/* if all aggregator's ports are READY_N = TRUE,\n" + "+\t/* if all aggregator's ports are READY_N == TRUE,\n" "+\t * set ready=TRUE in all aggregator's ports\n" - "+\t * else set ready\303\272LSE in all aggregator's ports\n" + "+\t * else set ready=FALSE in all aggregator's ports\n" "+\t */\n" "+\t__set_agg_ports_ready(port->aggregator,\n" "+\t\t\t\t__agg_ports_are_ready(port->aggregator));\n" @@ -1127,7 +1145,7 @@ "@@ -1533,16 +1596,15 @@ static void ad_agg_selection_logic(struct aggregator *agg)\n" " \n" " \tif (best &&\n" - " \t __get_agg_selection_mode(best->lag_ports) = BOND_AD_STABLE) {\n" + " \t __get_agg_selection_mode(best->lag_ports) == BOND_AD_STABLE) {\n" "-\t\t/*\n" "-\t\t * For the STABLE policy, don't replace the old active\n" "-\t\t * aggregator if it's still active (it has an answering\n" @@ -1191,8 +1209,10 @@ " \t\tport->actor_oper_port_key = 1;\n" "-\t\tport->actor_admin_port_state = AD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY;\n" "-\t\tport->actor_oper_port_state = AD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY;\n" - "+\t\tport->actor_admin_port_state +\t\t\t\tAD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY;\n" - "+\t\tport->actor_oper_port_state +\t\t\t\tAD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY;\n" + "+\t\tport->actor_admin_port_state =\n" + "+\t\t\t\tAD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY;\n" + "+\t\tport->actor_oper_port_state =\n" + "+\t\t\t\tAD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY;\n" " \n" " \t\tif (lacp_fast)\n" " \t\t\tport->actor_oper_port_state |= AD_STATE_LACP_TIMEOUT;\n" @@ -1234,7 +1254,8 @@ " \tmarker.requester_system = port->actor_system;\n" "-\t// convert requester_port(u32) to Big Endian\n" "+\t/* convert requester_port(u32) to Big Endian */\n" - " \tmarker.requester_transaction_id -\t\t(((++port->transaction_id & 0xFF) << 24)\n" + " \tmarker.requester_transaction_id =\n" + "-\t\t(((++port->transaction_id & 0xFF) << 24)\n" "-\t\t | ((port->transaction_id & 0xFF00) << 8)\n" "-\t\t | ((port->transaction_id & 0xFF0000) >> 8)\n" "-\t\t | ((port->transaction_id & 0xFF000000) >> 24));\n" @@ -1283,9 +1304,9 @@ " }\n" " \n" "-//////////////////////////////////////////////////////////////////////////////////////\n" - "-// ========= AD exported functions to the main bonding code =========\n" + "-// ================= AD exported functions to the main bonding code ==================\n" "-//////////////////////////////////////////////////////////////////////////////////////\n" - "+/* ======= AD exported functions to the main bonding code ====== */\n" + "+/* ============= AD exported functions to the main bonding code ============ */\n" " \n" "-// Check aggregators status in team every T seconds\n" "+/* Check aggregators status in team every T seconds */\n" @@ -1307,7 +1328,8 @@ " \t\tBOND_AD_INFO(bond).lacp_fast = lacp_fast;\n" " \t\tBOND_AD_INFO(bond).system.sys_priority = 0xFFFF;\n" "-\t\tBOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr);\n" - "+\t\tBOND_AD_INFO(bond).system.sys_mac_addr +\t\t\t\t *((struct mac_addr *)bond->dev->dev_addr);\n" + "+\t\tBOND_AD_INFO(bond).system.sys_mac_addr =\n" + "+\t\t\t\t *((struct mac_addr *)bond->dev->dev_addr);\n" " \n" "-\t\t// initialize how many times this module is called in one second(should be about every 100ms)\n" "+\t\t/* initialize how many times this module is\n" @@ -1376,7 +1398,8 @@ " \t\tad_initialize_agg(aggregator);\n" " \n" "-\t\taggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr);\n" - "+\t\taggregator->aggregator_mac_address +\t\t\t\t *((struct mac_addr *)bond->dev->dev_addr);\n" + "+\t\taggregator->aggregator_mac_address =\n" + "+\t\t\t\t *((struct mac_addr *)bond->dev->dev_addr);\n" " \t\taggregator->aggregator_identifier = (++aggregator_identifier);\n" " \t\taggregator->slave = slave;\n" " \t\taggregator->is_active = 0;\n" @@ -1421,34 +1444,34 @@ "-\t\t\tfor (; new_aggregator; new_aggregator = __get_next_agg(new_aggregator)) {\n" "-\t\t\t\t// if the new aggregator is empty, or it is connected to our port only\n" "-\t\t\t\tif (!new_aggregator->lag_ports\n" - "-\t\t\t\t || ((new_aggregator->lag_ports = port)\n" + "-\t\t\t\t || ((new_aggregator->lag_ports == port)\n" "-\t\t\t\t\t&& !new_aggregator->lag_ports->next_port_in_aggregator))\n" "+\t\t\tfor (; new_aggregator;\n" "+\t\t\t new_aggregator = __get_next_agg(new_aggregator)) {\n" "+\t\t\t\t/* if the new aggregator is empty,\n" "+\t\t\t\t or it is connected to our port only */\n" "+\t\t\t\tif (!new_aggregator->lag_ports ||\n" - "+\t\t\t\t ((new_aggregator->lag_ports = port) &&\n" + "+\t\t\t\t ((new_aggregator->lag_ports == port) &&\n" "+\t\t\t\t !new_aggregator->lag_ports->next_port_in_aggregator))\n" " \t\t\t\t\tbreak;\n" " \t\t\t}\n" "-\t\t\t// if new aggregator found, copy the aggregator's parameters\n" "-\t\t\t// and connect the related lag_ports to the new aggregator\n" - "-\t\t\tif ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports = port) && !new_aggregator->lag_ports->next_port_in_aggregator))) {\n" + "-\t\t\tif ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) {\n" "+\t\t\t/* if new aggregator found, copy the aggregator's\n" "+\t\t\t * parameters and connect the related lag_ports to the\n" "+\t\t\t * new aggregator\n" "+\t\t\t */\n" "+\t\t\tif ((new_aggregator) &&\n" "+\t\t\t ((!new_aggregator->lag_ports) ||\n" - "+\t\t\t ((new_aggregator->lag_ports = port) &&\n" + "+\t\t\t ((new_aggregator->lag_ports == port) &&\n" "+\t\t\t !new_aggregator->lag_ports->next_port_in_aggregator))) {\n" " \t\t\t\tpr_debug(\"Some port(s) related to LAG %d - replacing with LAG %d\\n\",\n" " \t\t\t\t\t aggregator->aggregator_identifier,\n" " \t\t\t\t\t new_aggregator->aggregator_identifier);\n" " \n" - "-\t\t\t\tif ((new_aggregator->lag_ports = port) && new_aggregator->is_active) {\n" - "+\t\t\t\tif ((new_aggregator->lag_ports = port) &&\n" + "-\t\t\t\tif ((new_aggregator->lag_ports == port) && new_aggregator->is_active) {\n" + "+\t\t\t\tif ((new_aggregator->lag_ports == port) &&\n" "+\t\t\t\t new_aggregator->is_active) {\n" " \t\t\t\t\tpr_info(\"%s: Removing an active aggregator\\n\",\n" " \t\t\t\t\t\taggregator->slave->dev->master->name);\n" @@ -1513,18 +1536,20 @@ " \t\tfor (temp_port = temp_aggregator->lag_ports; temp_port;\n" " \t\t prev_port = temp_port,\n" " \t\t\t temp_port = temp_port->next_port_in_aggregator) {\n" - "-\t\t\tif (temp_port = port) { // the aggregator found - detach the port from this aggregator\n" - "+\t\t\tif (temp_port = port) {\n" + "-\t\t\tif (temp_port == port) { // the aggregator found - detach the port from this aggregator\n" + "+\t\t\tif (temp_port == port) {\n" "+\t\t\t\t/* the aggregator found\n" "+\t\t\t\t detach the port from this aggregator */\n" " \t\t\t\tif (prev_port)\n" "-\t\t\t\t\tprev_port->next_port_in_aggregator = temp_port->next_port_in_aggregator;\n" - "+\t\t\t\t\tprev_port->next_port_in_aggregator +\t\t\t\t\t temp_port->next_port_in_aggregator;\n" + "+\t\t\t\t\tprev_port->next_port_in_aggregator =\n" + "+\t\t\t\t\t temp_port->next_port_in_aggregator;\n" " \t\t\t\telse\n" "-\t\t\t\t\ttemp_aggregator->lag_ports = temp_port->next_port_in_aggregator;\n" - "+\t\t\t\t\ttemp_aggregator->lag_ports +\t\t\t\t\t temp_port->next_port_in_aggregator;\n" + "+\t\t\t\t\ttemp_aggregator->lag_ports =\n" + "+\t\t\t\t\t temp_port->next_port_in_aggregator;\n" " \t\t\t\ttemp_aggregator->num_of_ports--;\n" - " \t\t\t\tif (temp_aggregator->num_of_ports = 0) {\n" + " \t\t\t\tif (temp_aggregator->num_of_ports == 0) {\n" " \t\t\t\t\tselect_new_active_agg = temp_aggregator->is_active;\n" "-\t\t\t\t\t// clear the aggregator\n" "+\t\t\t\t\t/* clear the aggregator */\n" @@ -1543,7 +1568,7 @@ " \n" "-\t//check if there are any slaves\n" "+\t/* check if there are any slaves */\n" - " \tif (bond->slave_cnt = 0)\n" + " \tif (bond->slave_cnt == 0)\n" " \t\tgoto re_arm;\n" " \n" "-\t// check if agg_select_timer timer after initialize is timed out\n" @@ -1625,7 +1650,8 @@ " \t}\n" " \n" " \tport->actor_admin_port_key &= ~AD_SPEED_KEY_BITS;\n" - " \tport->actor_oper_port_key = port->actor_admin_port_key | \t\t(__get_link_speed(port) << 1);\n" + " \tport->actor_oper_port_key = port->actor_admin_port_key |=\n" + " \t\t(__get_link_speed(port) << 1);\n" "+\n" " \tpr_debug(\"Port %d changed speed\\n\", port->actor_port_number);\n" "-\t// there is no need to reselect a new aggregator, just signal the\n" @@ -1651,7 +1677,8 @@ " \t}\n" " \n" " \tport->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS;\n" - " \tport->actor_oper_port_key = port->actor_admin_port_key | \t\t__get_duplex(port);\n" + " \tport->actor_oper_port_key = port->actor_admin_port_key |=\n" + " \t\t__get_duplex(port);\n" "+\n" " \tpr_debug(\"Port %d changed duplex\\n\", port->actor_port_number);\n" "-\t// there is no need to reselect a new aggregator, just signal the\n" @@ -1683,19 +1710,20 @@ "+\t * instead of N/A (duplex) / 0(speed)\n" "+\t * on link up we are forcing recheck on the duplex and speed\n" "+\t */\n" - " \tif (link = BOND_LINK_UP) {\n" + " \tif (link == BOND_LINK_UP) {\n" " \t\tport->is_enabled = true;\n" " \t\tport->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS;\n" "@@ -2329,9 +2440,15 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)\n" - " \t\tport->actor_oper_port_key = (port->actor_admin_port_key & \t\t\t\t\t ~AD_SPEED_KEY_BITS);\n" + " \t\tport->actor_oper_port_key = (port->actor_admin_port_key &=\n" + " \t\t\t\t\t ~AD_SPEED_KEY_BITS);\n" " \t}\n" - "-\t//BOND_PRINT_DBG((\"Port %d changed link status to %s\", port->actor_port_number, ((link = BOND_LINK_UP)?\"UP\":\"DOWN\")));\n" + "-\t//BOND_PRINT_DBG((\"Port %d changed link status to %s\", port->actor_port_number, ((link == BOND_LINK_UP)?\"UP\":\"DOWN\")));\n" "-\t// there is no need to reselect a new aggregator, just signal the\n" "-\t// state machines to reinitialize\n" "+\n" "+\t/* BOND_PRINT_DBG((\"Port %d changed link status to %s\",\n" "+\t *\t\t port->actor_port_number,\n" - "+\t *\t\t ((link = BOND_LINK_UP)?\"UP\":\"DOWN\")));\n" + "+\t *\t\t ((link == BOND_LINK_UP)?\"UP\":\"DOWN\")));\n" "+\t */\n" "+\n" "+\t/* there is no need to reselect a new aggregator,\n" @@ -2006,8 +2034,8 @@ " #pragma pack()\n" " #endif\n" " \n" - "-// ========= AD Exported structures to the main bonding code =========\n" - "+/* ====== AD Exported structures to the main bonding code ====== */\n" + "-// ================= AD Exported structures to the main bonding code ==================\n" + "+/* =========== AD Exported structures to the main bonding code ============ */\n" " #define BOND_AD_INFO(bond) ((bond)->ad_info)\n" " #define SLAVE_AD_INFO(slave) ((slave)->ad_info)\n" " \n" @@ -2037,10 +2065,10 @@ " \tu16 id;\n" " };\n" " \n" - "-// ========= AD Exported functions to the main bonding code =========\n" + "-// ================= AD Exported functions to the main bonding code ==================\n" "-void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution, int lacp_fast);\n" "-int bond_3ad_bind_slave(struct slave *slave);\n" - "+/* ===== AD Exported functions to the main bonding code ===== */\n" + "+/* ========= AD Exported functions to the main bonding code ========== */\n" "+void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution,\n" "+\t\t\t int lacp_fast);\n" "+int bond_3ad_bind_slave(struct slave *slave);\n" @@ -2064,10 +2092,6 @@ "\n" "\n" "-- \n" - "Rafael Aquini <aquini@linux.com>\n" - "--\n" - "To unsubscribe from this list: send the line \"unsubscribe kernel-janitors\" in\n" - "the body of a message to majordomo@vger.kernel.org\n" - More majordomo info at http://vger.kernel.org/majordomo-info.html + Rafael Aquini <aquini@linux.com> -f85681fa64a36e3c75ce17c1a0bd7e71c3b919bbdc80302598110d6771e3bce0 +907c0792f956d01b6f698baabc17a135786ae888126cc048022a86072ec62a89
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.