static void bond_loadbalance_arp_mon(struct net_device *bond_dev) 
void bond_loadbalance_arp_mon(struct net_device *bond_dev) 
static void bond_loadbalance_arp_mon(struct net_device *bond_dev){	struct bonding *bond = bond_dev->priv;	struct slave *slave, *oldcurrent;	int do_failover = 0;	int delta_in_ticks;	int i;	read_lock(&bond->lock);	delta_in_ticks = (bond->params.arp_interval * HZ) / 1000;	if (bond->kill_timers) {		goto out;	}	if (bond->slave_cnt == 0) {		goto re_arm;	}	read_lock(&bond->curr_slave_lock);	oldcurrent = bond->curr_active_slave;	read_unlock(&bond->curr_slave_lock);	/* see if any of the previous devices are up now (i.e. they have	 * xmt and rcv traffic). the curr_active_slave does not come into	 * the picture unless it is null. also, slave->jiffies is not needed	 * here because we send an arp on each slave and give a slave as	 * long as it needs to get the tx/rx within the delta.	 * TODO: what about up/down delay in arp mode? it wasn't here before	 *       so it can wait	 */	bond_for_each_slave(bond, slave, i) {		if (slave->link != BOND_LINK_UP) {			if (((jiffies - slave->dev->trans_start) <= delta_in_ticks) &&			    ((jiffies - slave->dev->last_rx) <= delta_in_ticks)) {				slave->link  = BOND_LINK_UP;				slave->state = BOND_STATE_ACTIVE;				/* primary_slave has no meaning in round-robin				 * mode. the window of a slave being up and				 * curr_active_slave being null after enslaving				 * is closed.				 */				if (!oldcurrent) {					printk(KERN_INFO DRV_NAME					       ": %s: link status definitely "					       "up for interface %s, ",					       bond_dev->name,					       slave->dev->name);					do_failover = 1;				} else {					printk(KERN_INFO DRV_NAME					       ": %s: interface %s is now up\n",					       bond_dev->name,					       slave->dev->name);				}			}		} else {			/* slave->link == BOND_LINK_UP */			/* not all switches will respond to an arp request			 * when the source ip is 0, so don't take the link down			 * if we don't know our ip yet			 */			if (((jiffies - slave->dev->trans_start) >= (2*delta_in_ticks)) ||			    (((jiffies - slave->dev->last_rx) >= (2*delta_in_ticks)) &&			     bond_has_ip(bond))) {				slave->link  = BOND_LINK_DOWN;				slave->state = BOND_STATE_BACKUP;				if (slave->link_failure_count < UINT_MAX) {					slave->link_failure_count++;				}				printk(KERN_INFO DRV_NAME				       ": %s: interface %s is now down.\n",				       bond_dev->name,				       slave->dev->name);				if (slave == oldcurrent) {					do_failover = 1;				}			}		}		/* note: if switch is in round-robin mode, all links		 * must tx arp to ensure all links rx an arp - otherwise		 * links may oscillate or not come up at all; if switch is		 * in something like xor mode, there is nothing we can		 * do - all replies will be rx'ed on same link causing slaves		 * to be unstable during low/no traffic periods		 */		if (IS_UP(slave->dev)) {			bond_arp_send_all(bond, slave);		}	}	if (do_failover) {		write_lock(&bond->curr_slave_lock);		bond_select_active_slave(bond);		if (oldcurrent && !bond->curr_active_slave) {			printk(KERN_INFO DRV_NAME			       ": %s: now running without any active "			       "interface !\n",			       bond_dev->name);		}		write_unlock(&bond->curr_slave_lock);	}re_arm:	if (bond->params.arp_interval) {		mod_timer(&bond->arp_timer, jiffies + delta_in_ticks);	}out:	read_unlock(&bond->lock);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/a77b53258d76513c37e766dc0db1fc9db7c4ac1e/bond_main.c/clean/drivers/net/bonding/bond_main.c