printk(KERN_WARNING DRV_NAME ": Warning: No 802.3ad response from the link partner " "for any adapters in the bond\n"); 
printk(KERN_WARNING DRV_NAME ": %s: Warning: No 802.3ad response from " "the link partner for any adapters in the bond\n", best_aggregator->slave->dev->master->name); 
static void ad_agg_selection_logic(struct aggregator *aggregator){	struct aggregator *best_aggregator = NULL, *active_aggregator = NULL;	struct aggregator *last_active_aggregator = NULL, *origin_aggregator;	struct port *port;	u16 num_of_aggs=0;	origin_aggregator = aggregator;	//get current active aggregator	last_active_aggregator = __get_active_agg(aggregator);	// search for the aggregator with the most ports attached to it.	do {		// count how many candidate lag's we have		if (aggregator->lag_ports) {			num_of_aggs++;		}		if (aggregator->is_active && !aggregator->is_individual &&   // if current aggregator is the active aggregator		    MAC_ADDRESS_COMPARE(&(aggregator->partner_system), &(null_mac_addr))) {   // and partner answers to 802.3ad PDUs			if (aggregator->num_of_ports) {	// if any ports attached to the current aggregator				best_aggregator=NULL;	 // disregard the best aggregator that was chosen by now				break;		 // stop the selection of other aggregator if there are any ports attached to this active aggregator			} else { // no ports attached to this active aggregator				aggregator->is_active = 0; // mark this aggregator as not active anymore			}		}		if (aggregator->num_of_ports) {	// if any ports attached			if (best_aggregator) {	// if there is a candidte aggregator				//The reasons for choosing new best aggregator:				// 1. if current agg is NOT individual and the best agg chosen so far is individual OR				// current and best aggs are both individual or both not individual, AND				// 2a.  current agg partner reply but best agg partner do not reply OR				// 2b.  current agg partner reply OR current agg partner do not reply AND best agg partner also do not reply AND				//      current has more ports/bandwidth, or same amount of ports but current has faster ports, THEN				//      current agg become best agg so far				//if current agg is NOT individual and the best agg chosen so far is individual change best_aggregator				if (!aggregator->is_individual && best_aggregator->is_individual) {					best_aggregator=aggregator;				}				// current and best aggs are both individual or both not individual				else if ((aggregator->is_individual && best_aggregator->is_individual) ||					 (!aggregator->is_individual && !best_aggregator->is_individual)) {					//  current and best aggs are both individual or both not individual AND					//  current agg partner reply but best agg partner do not reply					if ((MAC_ADDRESS_COMPARE(&(aggregator->partner_system), &(null_mac_addr)) &&					     !MAC_ADDRESS_COMPARE(&(best_aggregator->partner_system), &(null_mac_addr)))) {						best_aggregator=aggregator;					}					//  current agg partner reply OR current agg partner do not reply AND best agg partner also do not reply					else if (! (!MAC_ADDRESS_COMPARE(&(aggregator->partner_system), &(null_mac_addr)) &&						    MAC_ADDRESS_COMPARE(&(best_aggregator->partner_system), &(null_mac_addr)))) {						if ((__get_agg_selection_mode(aggregator->lag_ports) == AD_BANDWIDTH)&&						    (__get_agg_bandwidth(aggregator) > __get_agg_bandwidth(best_aggregator))) {							best_aggregator=aggregator;						} else if (__get_agg_selection_mode(aggregator->lag_ports) == AD_COUNT) {							if (((aggregator->num_of_ports > best_aggregator->num_of_ports) &&							     (aggregator->actor_oper_aggregator_key & AD_SPEED_KEY_BITS))||							    ((aggregator->num_of_ports == best_aggregator->num_of_ports) &&							     ((u16)(aggregator->actor_oper_aggregator_key & AD_SPEED_KEY_BITS) >							      (u16)(best_aggregator->actor_oper_aggregator_key & AD_SPEED_KEY_BITS)))) {								best_aggregator=aggregator;							}						}					}				}			} else {				best_aggregator=aggregator;			}		}		aggregator->is_active = 0; // mark all aggregators as not active anymore	} while ((aggregator = __get_next_agg(aggregator)));	// if we have new aggregator selected, don't replace the old aggregator if it has an answering partner,	// or if both old aggregator and new aggregator don't have answering partner	if (best_aggregator) {		if (last_active_aggregator && last_active_aggregator->lag_ports && last_active_aggregator->lag_ports->is_enabled &&		    (MAC_ADDRESS_COMPARE(&(last_active_aggregator->partner_system), &(null_mac_addr)) ||   // partner answers OR		     (!MAC_ADDRESS_COMPARE(&(last_active_aggregator->partner_system), &(null_mac_addr)) &&	// both old and new		      !MAC_ADDRESS_COMPARE(&(best_aggregator->partner_system), &(null_mac_addr))))     // partner do not answer		   ) {			// if new aggregator has link, and old aggregator does not, replace old aggregator.(do nothing)			// -> don't replace otherwise.			if (!(!last_active_aggregator->actor_oper_aggregator_key && best_aggregator->actor_oper_aggregator_key)) {				best_aggregator=NULL;				last_active_aggregator->is_active = 1; // don't replace good old aggregator			}		}	}	// if there is new best aggregator, activate it	if (best_aggregator) {		for (aggregator = __get_first_agg(best_aggregator->lag_ports);		    aggregator;		    aggregator = __get_next_agg(aggregator)) {			dprintk("Agg=%d; Ports=%d; a key=%d; p key=%d; Indiv=%d; Active=%d\n",					aggregator->aggregator_identifier, aggregator->num_of_ports,					aggregator->actor_oper_aggregator_key, aggregator->partner_oper_aggregator_key,					aggregator->is_individual, aggregator->is_active);		}		// check if any partner replys		if (best_aggregator->is_individual) {			printk(KERN_WARNING DRV_NAME ": Warning: No 802.3ad response from the link partner "					"for any adapters in the bond\n");		}		// check if there are more than one aggregator		if (num_of_aggs > 1) {			dprintk("Warning: More than one Link Aggregation Group was "				"found in the bond. Only one group will function in the bond\n");		}		best_aggregator->is_active = 1;		dprintk("LAG %d choosed as the active LAG\n", best_aggregator->aggregator_identifier);		dprintk("Agg=%d; Ports=%d; a key=%d; p key=%d; Indiv=%d; Active=%d\n",				best_aggregator->aggregator_identifier, best_aggregator->num_of_ports,				best_aggregator->actor_oper_aggregator_key, best_aggregator->partner_oper_aggregator_key,				best_aggregator->is_individual, best_aggregator->is_active);		// disable the ports that were related to the former active_aggregator		if (last_active_aggregator) {			for (port=last_active_aggregator->lag_ports; port; port=port->next_port_in_aggregator) {				__disable_port(port);			}		}	}	// if the selected aggregator is of join individuals(partner_system is NULL), enable their ports	active_aggregator = __get_active_agg(origin_aggregator);	if (active_aggregator) {		if (!MAC_ADDRESS_COMPARE(&(active_aggregator->partner_system), &(null_mac_addr))) {			for (port=active_aggregator->lag_ports; port; port=port->next_port_in_aggregator) {				__enable_port(port);			}		}	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/4e0952c74ee450ded86e8946ce58ea8dfd05b007/bond_3ad.c/buggy/drivers/net/bonding/bond_3ad.c