Commit 9fec364c authored by Shmulik Hen's avatar Shmulik Hen Committed by Jeff Garzik

[PATCH] bonding cleanup 2.6 - Re-org struct bonding members (re-send)

Change names/types for some of the members in struct bonding.
Change position of members.
parent 13d5d156
...@@ -363,9 +363,9 @@ mode ...@@ -363,9 +363,9 @@ mode
2. Base driver support for setting the hw address of a 2. Base driver support for setting the hw address of a
device also when it is open. This is required so that there device also when it is open. This is required so that there
will always be one slave in the team using the bond hw will always be one slave in the team using the bond hw
address (the current_slave) while having a unique hw address (the curr_active_slave) while having a unique hw
address for each slave in the bond. If the current_slave address for each slave in the bond. If the curr_active_slave
fails it's hw address is swapped with the new current_slave fails it's hw address is swapped with the new curr_active_slave
that was chosen. that was chosen.
primary primary
......
...@@ -1890,13 +1890,13 @@ static u16 aggregator_identifier; ...@@ -1890,13 +1890,13 @@ static u16 aggregator_identifier;
void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution, int lacp_fast) void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution, int lacp_fast)
{ {
// check that the bond is not initialized yet // check that the bond is not initialized yet
if (MAC_ADDRESS_COMPARE(&(BOND_AD_INFO(bond).system.sys_mac_addr), &(bond->device->dev_addr))) { if (MAC_ADDRESS_COMPARE(&(BOND_AD_INFO(bond).system.sys_mac_addr), &(bond->dev->dev_addr))) {
aggregator_identifier = 0; aggregator_identifier = 0;
BOND_AD_INFO(bond).lacp_fast = lacp_fast; BOND_AD_INFO(bond).lacp_fast = lacp_fast;
BOND_AD_INFO(bond).system.sys_priority = 0xFFFF; BOND_AD_INFO(bond).system.sys_priority = 0xFFFF;
BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->device->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 called in one second(should be about every 100ms)
ad_ticks_per_sec = tick_resolution; ad_ticks_per_sec = tick_resolution;
...@@ -1964,7 +1964,7 @@ int bond_3ad_bind_slave(struct slave *slave) ...@@ -1964,7 +1964,7 @@ int bond_3ad_bind_slave(struct slave *slave)
ad_initialize_agg(aggregator); ad_initialize_agg(aggregator);
aggregator->aggregator_mac_address = *((struct mac_addr *)bond->device->dev_addr); aggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr);
aggregator->aggregator_identifier = (++aggregator_identifier); aggregator->aggregator_identifier = (++aggregator_identifier);
aggregator->slave = slave; aggregator->slave = slave;
aggregator->is_active = 0; aggregator->is_active = 0;
...@@ -2399,7 +2399,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) ...@@ -2399,7 +2399,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
return 0; return 0;
} }
slave_agg_no = (data->h_dest[5]^bond->device->dev_addr[5]) % slaves_in_agg; slave_agg_no = (data->h_dest[5]^bond->dev->dev_addr[5]) % slaves_in_agg;
bond_for_each_slave(bond, slave, i) { bond_for_each_slave(bond, slave, i) {
struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator; struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator;
......
...@@ -191,7 +191,7 @@ static int tlb_initialize(struct bonding *bond) ...@@ -191,7 +191,7 @@ static int tlb_initialize(struct bonding *bond)
if (bond_info->tx_hashtbl == NULL) { if (bond_info->tx_hashtbl == NULL) {
printk(KERN_ERR DRV_NAME printk(KERN_ERR DRV_NAME
": Error: %s: Failed to allocate TLB hash table\n", ": Error: %s: Failed to allocate TLB hash table\n",
bond->device->name); bond->dev->name);
_unlock_tx_hashtbl(bond); _unlock_tx_hashtbl(bond);
return -1; return -1;
} }
...@@ -401,20 +401,20 @@ static struct slave *rlb_next_rx_slave(struct bonding *bond) ...@@ -401,20 +401,20 @@ static struct slave *rlb_next_rx_slave(struct bonding *bond)
/* teach the switch the mac of a disabled slave /* teach the switch the mac of a disabled slave
* on the primary for fault tolerance * on the primary for fault tolerance
* *
* Caller must hold bond->ptrlock for write or bond lock for write * Caller must hold bond->curr_slave_lock for write or bond lock for write
*/ */
static void rlb_teach_disabled_mac_on_primary(struct bonding *bond, u8 addr[]) static void rlb_teach_disabled_mac_on_primary(struct bonding *bond, u8 addr[])
{ {
if (!bond->current_slave) { if (!bond->curr_active_slave) {
return; return;
} }
if (!bond->alb_info.primary_is_promisc) { if (!bond->alb_info.primary_is_promisc) {
bond->alb_info.primary_is_promisc = 1; bond->alb_info.primary_is_promisc = 1;
dev_set_promiscuity(bond->current_slave->dev, 1); dev_set_promiscuity(bond->curr_active_slave->dev, 1);
} }
bond->alb_info.rlb_promisc_timeout_counter = 0; bond->alb_info.rlb_promisc_timeout_counter = 0;
alb_send_learning_packets(bond->current_slave, addr); alb_send_learning_packets(bond->curr_active_slave, addr);
} }
/* slave being removed should not be active at this point /* slave being removed should not be active at this point
...@@ -463,11 +463,11 @@ static void rlb_clear_slave(struct bonding *bond, struct slave *slave) ...@@ -463,11 +463,11 @@ static void rlb_clear_slave(struct bonding *bond, struct slave *slave)
_unlock_rx_hashtbl(bond); _unlock_rx_hashtbl(bond);
write_lock(&bond->ptrlock); write_lock(&bond->curr_slave_lock);
if (slave != bond->current_slave) { if (slave != bond->curr_active_slave) {
rlb_teach_disabled_mac_on_primary(bond, slave->dev->dev_addr); rlb_teach_disabled_mac_on_primary(bond, slave->dev->dev_addr);
} }
write_unlock(&bond->ptrlock); write_unlock(&bond->curr_slave_lock);
} }
static void rlb_update_client(struct rlb_client_info *client_info) static void rlb_update_client(struct rlb_client_info *client_info)
...@@ -570,12 +570,12 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, u32 src_ip) ...@@ -570,12 +570,12 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, u32 src_ip)
continue; continue;
} }
/*update all clients using this src_ip, that are not assigned /*update all clients using this src_ip, that are not assigned
* to the team's address (current_slave) and have a known * to the team's address (curr_active_slave) and have a known
* unicast mac address. * unicast mac address.
*/ */
if ((client_info->ip_src == src_ip) && if ((client_info->ip_src == src_ip) &&
memcmp(client_info->slave->dev->dev_addr, memcmp(client_info->slave->dev->dev_addr,
bond->device->dev_addr, ETH_ALEN) && bond->dev->dev_addr, ETH_ALEN) &&
memcmp(client_info->mac_dst, mac_bcast, ETH_ALEN)) { memcmp(client_info->mac_dst, mac_bcast, ETH_ALEN)) {
client_info->ntt = 1; client_info->ntt = 1;
bond_info->rx_ntt = 1; bond_info->rx_ntt = 1;
...@@ -616,12 +616,12 @@ struct slave *rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp) ...@@ -616,12 +616,12 @@ struct slave *rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp)
} }
} else { } else {
/* the entry is already assigned to some other client, /* the entry is already assigned to some other client,
* move the old client to primary (current_slave) so * move the old client to primary (curr_active_slave) so
* that the new client can be assigned to this entry. * that the new client can be assigned to this entry.
*/ */
if (bond->current_slave && if (bond->curr_active_slave &&
client_info->slave != bond->current_slave) { client_info->slave != bond->curr_active_slave) {
client_info->slave = bond->current_slave; client_info->slave = bond->curr_active_slave;
rlb_update_client(client_info); rlb_update_client(client_info);
} }
} }
...@@ -666,7 +666,7 @@ struct slave *rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp) ...@@ -666,7 +666,7 @@ struct slave *rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp)
/* chooses (and returns) transmit channel for arp reply /* chooses (and returns) transmit channel for arp reply
* does not choose channel for other arp types since they are * does not choose channel for other arp types since they are
* sent on the current_slave * sent on the curr_active_slave
*/ */
static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
{ {
...@@ -761,7 +761,7 @@ static int rlb_initialize(struct bonding *bond) ...@@ -761,7 +761,7 @@ static int rlb_initialize(struct bonding *bond)
if (bond_info->rx_hashtbl == NULL) { if (bond_info->rx_hashtbl == NULL) {
printk(KERN_ERR DRV_NAME printk(KERN_ERR DRV_NAME
": Error: %s: Failed to allocate RLB hash table\n", ": Error: %s: Failed to allocate RLB hash table\n",
bond->device->name); bond->dev->name);
_unlock_rx_hashtbl(bond); _unlock_rx_hashtbl(bond);
return -1; return -1;
} }
...@@ -775,7 +775,7 @@ static int rlb_initialize(struct bonding *bond) ...@@ -775,7 +775,7 @@ static int rlb_initialize(struct bonding *bond)
/*initialize packet type*/ /*initialize packet type*/
pk_type->type = __constant_htons(ETH_P_ARP); pk_type->type = __constant_htons(ETH_P_ARP);
pk_type->dev = bond->device; pk_type->dev = bond->dev;
pk_type->func = rlb_arp_recv; pk_type->func = rlb_arp_recv;
/* register to receive ARPs */ /* register to receive ARPs */
...@@ -860,7 +860,7 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw) ...@@ -860,7 +860,7 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw)
return 0; return 0;
} }
/* Caller must hold bond lock for write or ptrlock for write*/ /* Caller must hold bond lock for write or curr_slave_lock for write*/
static void alb_swap_mac_addr(struct bonding *bond, struct slave *slave1, struct slave *slave2) static void alb_swap_mac_addr(struct bonding *bond, struct slave *slave1, struct slave *slave2)
{ {
struct slave *disabled_slave = NULL; struct slave *disabled_slave = NULL;
...@@ -932,7 +932,7 @@ static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *sla ...@@ -932,7 +932,7 @@ static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *sla
slave->dev->dev_addr, slave->dev->dev_addr,
ETH_ALEN); ETH_ALEN);
perm_bond_diff = memcmp(slave->perm_hwaddr, perm_bond_diff = memcmp(slave->perm_hwaddr,
bond->device->dev_addr, bond->dev->dev_addr,
ETH_ALEN); ETH_ALEN);
if (perm_curr_diff && perm_bond_diff) { if (perm_curr_diff && perm_bond_diff) {
bond_for_each_slave(bond, tmp_slave, i) { bond_for_each_slave(bond, tmp_slave, i) {
...@@ -989,7 +989,7 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav ...@@ -989,7 +989,7 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav
* check uniqueness of slave's mac address against the other * check uniqueness of slave's mac address against the other
* slaves in the bond. * slaves in the bond.
*/ */
if (memcmp(slave->perm_hwaddr, bond->device->dev_addr, ETH_ALEN)) { if (memcmp(slave->perm_hwaddr, bond->dev->dev_addr, ETH_ALEN)) {
bond_for_each_slave(bond, tmp_slave1, i) { bond_for_each_slave(bond, tmp_slave1, i) {
if (!memcmp(tmp_slave1->dev->dev_addr, slave->dev->dev_addr, if (!memcmp(tmp_slave1->dev->dev_addr, slave->dev->dev_addr,
ETH_ALEN)) { ETH_ALEN)) {
...@@ -1103,8 +1103,8 @@ static int alb_set_mac_address(struct bonding *bond, void *addr) ...@@ -1103,8 +1103,8 @@ static int alb_set_mac_address(struct bonding *bond, void *addr)
return 0; return 0;
unwind: unwind:
memcpy(sa.sa_data, bond->device->dev_addr, bond->device->addr_len); memcpy(sa.sa_data, bond->dev->dev_addr, bond->dev->addr_len);
sa.sa_family = bond->device->type; sa.sa_family = bond->dev->type;
/* unwind from head to the slave that failed */ /* unwind from head to the slave that failed */
stop_at = slave; stop_at = slave;
...@@ -1169,7 +1169,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) ...@@ -1169,7 +1169,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
return 0; return 0;
} }
/* make sure that the current_slave and the slaves list do /* make sure that the curr_active_slave and the slaves list do
* not change during tx * not change during tx
*/ */
read_lock(&bond->lock); read_lock(&bond->lock);
...@@ -1181,7 +1181,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) ...@@ -1181,7 +1181,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
return 0; return 0;
} }
read_lock(&bond->ptrlock); read_lock(&bond->curr_slave_lock);
switch (ntohs(skb->protocol)) { switch (ntohs(skb->protocol)) {
case ETH_P_IP: case ETH_P_IP:
...@@ -1245,13 +1245,13 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) ...@@ -1245,13 +1245,13 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
if (!tx_slave) { if (!tx_slave) {
/* unbalanced or unassigned, send through primary */ /* unbalanced or unassigned, send through primary */
tx_slave = bond->current_slave; tx_slave = bond->curr_active_slave;
bond_info->unbalanced_load += skb->len; bond_info->unbalanced_load += skb->len;
} }
if (tx_slave && SLAVE_IS_OK(tx_slave)) { if (tx_slave && SLAVE_IS_OK(tx_slave)) {
skb->dev = tx_slave->dev; skb->dev = tx_slave->dev;
if (tx_slave != bond->current_slave) { if (tx_slave != bond->curr_active_slave) {
memcpy(eth_data->h_source, memcpy(eth_data->h_source,
tx_slave->dev->dev_addr, tx_slave->dev->dev_addr,
ETH_ALEN); ETH_ALEN);
...@@ -1265,7 +1265,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) ...@@ -1265,7 +1265,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
dev_kfree_skb(skb); dev_kfree_skb(skb);
} }
read_unlock(&bond->ptrlock); read_unlock(&bond->curr_slave_lock);
read_unlock(&bond->lock); read_unlock(&bond->lock);
return 0; return 0;
} }
...@@ -1294,44 +1294,44 @@ void bond_alb_monitor(struct bonding *bond) ...@@ -1294,44 +1294,44 @@ void bond_alb_monitor(struct bonding *bond)
/* send learning packets */ /* send learning packets */
if (bond_info->lp_counter >= BOND_ALB_LP_TICKS) { if (bond_info->lp_counter >= BOND_ALB_LP_TICKS) {
/* change of current_slave involves swapping of mac addresses. /* change of curr_active_slave involves swapping of mac addresses.
* in order to avoid this swapping from happening while * in order to avoid this swapping from happening while
* sending the learning packets, the ptrlock must be held for * sending the learning packets, the curr_slave_lock must be held for
* read. * read.
*/ */
read_lock(&bond->ptrlock); read_lock(&bond->curr_slave_lock);
bond_for_each_slave(bond, slave, i) { bond_for_each_slave(bond, slave, i) {
alb_send_learning_packets(slave,slave->dev->dev_addr); alb_send_learning_packets(slave,slave->dev->dev_addr);
} }
read_unlock(&bond->ptrlock); read_unlock(&bond->curr_slave_lock);
bond_info->lp_counter = 0; bond_info->lp_counter = 0;
} }
/* rebalance tx traffic */ /* rebalance tx traffic */
if (bond_info->tx_rebalance_counter >= BOND_TLB_REBALANCE_TICKS) { if (bond_info->tx_rebalance_counter >= BOND_TLB_REBALANCE_TICKS) {
read_lock(&bond->ptrlock); read_lock(&bond->curr_slave_lock);
bond_for_each_slave(bond, slave, i) { bond_for_each_slave(bond, slave, i) {
tlb_clear_slave(bond, slave, 1); tlb_clear_slave(bond, slave, 1);
if (slave == bond->current_slave) { if (slave == bond->curr_active_slave) {
SLAVE_TLB_INFO(slave).load = SLAVE_TLB_INFO(slave).load =
bond_info->unbalanced_load / bond_info->unbalanced_load /
BOND_TLB_REBALANCE_INTERVAL; BOND_TLB_REBALANCE_INTERVAL;
bond_info->unbalanced_load = 0; bond_info->unbalanced_load = 0;
} }
} }
read_unlock(&bond->ptrlock); read_unlock(&bond->curr_slave_lock);
bond_info->tx_rebalance_counter = 0; bond_info->tx_rebalance_counter = 0;
} }
/* handle rlb stuff */ /* handle rlb stuff */
if (bond_info->rlb_enabled) { if (bond_info->rlb_enabled) {
/* the following code changes the promiscuity of the /* the following code changes the promiscuity of the
* the current_slave. It needs to be locked with a * the curr_active_slave. It needs to be locked with a
* write lock to protect from other code that also * write lock to protect from other code that also
* sets the promiscuity. * sets the promiscuity.
*/ */
write_lock(&bond->ptrlock); write_lock(&bond->curr_slave_lock);
if (bond_info->primary_is_promisc && if (bond_info->primary_is_promisc &&
(++bond_info->rlb_promisc_timeout_counter >= (++bond_info->rlb_promisc_timeout_counter >=
RLB_PROMISC_TIMEOUT)) { RLB_PROMISC_TIMEOUT)) {
...@@ -1342,10 +1342,10 @@ void bond_alb_monitor(struct bonding *bond) ...@@ -1342,10 +1342,10 @@ void bond_alb_monitor(struct bonding *bond)
* because a slave was disabled then * because a slave was disabled then
* it can now leave promiscuous mode. * it can now leave promiscuous mode.
*/ */
dev_set_promiscuity(bond->current_slave->dev, -1); dev_set_promiscuity(bond->curr_active_slave->dev, -1);
bond_info->primary_is_promisc = 0; bond_info->primary_is_promisc = 0;
} }
write_unlock(&bond->ptrlock); write_unlock(&bond->curr_slave_lock);
if (bond_info->rlb_rebalance == 1) { if (bond_info->rlb_rebalance == 1) {
bond_info->rlb_rebalance = 0; bond_info->rlb_rebalance = 0;
...@@ -1373,7 +1373,7 @@ void bond_alb_monitor(struct bonding *bond) ...@@ -1373,7 +1373,7 @@ void bond_alb_monitor(struct bonding *bond)
read_unlock(&bond->lock); read_unlock(&bond->lock);
} }
/* assumption: called before the slave is attched to the bond /* assumption: called before the slave is attached to the bond
* and not locked by the bond lock * and not locked by the bond lock
*/ */
int bond_alb_init_slave(struct bonding *bond, struct slave *slave) int bond_alb_init_slave(struct bonding *bond, struct slave *slave)
...@@ -1451,61 +1451,61 @@ void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char ...@@ -1451,61 +1451,61 @@ void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char
} }
/** /**
* bond_alb_handle_active_change - assign new current_slave * bond_alb_handle_active_change - assign new curr_active_slave
* @bond: our bonding struct * @bond: our bonding struct
* @new_slave: new slave to assign * @new_slave: new slave to assign
* *
* Set the bond->current_slave to @new_slave and handle * Set the bond->curr_active_slave to @new_slave and handle
* mac address swapping and promiscuity changes as needed. * mac address swapping and promiscuity changes as needed.
* *
* Caller must hold bond ptrlock for write (or bond lock for write) * Caller must hold bond curr_slave_lock for write (or bond lock for write)
*/ */
void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave) void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave)
{ {
struct slave *swap_slave; struct slave *swap_slave;
int i, found = 0; int i, found = 0;
if (bond->current_slave == new_slave) { if (bond->curr_active_slave == new_slave) {
return; return;
} }
if (bond->current_slave && bond->alb_info.primary_is_promisc) { if (bond->curr_active_slave && bond->alb_info.primary_is_promisc) {
dev_set_promiscuity(bond->current_slave->dev, -1); dev_set_promiscuity(bond->curr_active_slave->dev, -1);
bond->alb_info.primary_is_promisc = 0; bond->alb_info.primary_is_promisc = 0;
bond->alb_info.rlb_promisc_timeout_counter = 0; bond->alb_info.rlb_promisc_timeout_counter = 0;
} }
swap_slave = bond->current_slave; swap_slave = bond->curr_active_slave;
bond->current_slave = new_slave; bond->curr_active_slave = new_slave;
if (!new_slave || (bond->slave_cnt == 0)) { if (!new_slave || (bond->slave_cnt == 0)) {
return; return;
} }
/* set the new current_slave to the bonds mac address /* set the new curr_active_slave to the bonds mac address
* i.e. swap mac addresses of old current_slave and new current_slave * i.e. swap mac addresses of old curr_active_slave and new curr_active_slave
*/ */
if (!swap_slave) { if (!swap_slave) {
/* find slave that is holding the bond's mac address */ /* find slave that is holding the bond's mac address */
bond_for_each_slave(bond, swap_slave, i) { bond_for_each_slave(bond, swap_slave, i) {
if (!memcmp(swap_slave->dev->dev_addr, if (!memcmp(swap_slave->dev->dev_addr,
bond->device->dev_addr, ETH_ALEN)) { bond->dev->dev_addr, ETH_ALEN)) {
found = 1; found = 1;
break; break;
} }
} }
} }
/* current_slave must be set before calling alb_swap_mac_addr */ /* curr_active_slave must be set before calling alb_swap_mac_addr */
if (found) { if (found) {
/* swap mac address */ /* swap mac address */
alb_swap_mac_addr(bond, swap_slave, new_slave); alb_swap_mac_addr(bond, swap_slave, new_slave);
} else { } else {
/* set the new_slave to the bond mac address */ /* set the new_slave to the bond mac address */
alb_set_slave_mac_addr(new_slave, bond->device->dev_addr, alb_set_slave_mac_addr(new_slave, bond->dev->dev_addr,
bond->alb_info.rlb_enabled); bond->alb_info.rlb_enabled);
/* fasten bond mac on new current slave */ /* fasten bond mac on new current slave */
alb_send_learning_packets(new_slave, bond->device->dev_addr); alb_send_learning_packets(new_slave, bond->dev->dev_addr);
} }
} }
...@@ -1528,11 +1528,11 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) ...@@ -1528,11 +1528,11 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
memcpy(bond_dev->dev_addr, sa->sa_data, bond_dev->addr_len); memcpy(bond_dev->dev_addr, sa->sa_data, bond_dev->addr_len);
/* If there is no current_slave there is nothing else to do. /* If there is no curr_active_slave there is nothing else to do.
* Otherwise we'll need to pass the new address to it and handle * Otherwise we'll need to pass the new address to it and handle
* duplications. * duplications.
*/ */
if (bond->current_slave == NULL) { if (bond->curr_active_slave == NULL) {
return 0; return 0;
} }
...@@ -1544,15 +1544,15 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) ...@@ -1544,15 +1544,15 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
} }
if (found) { if (found) {
alb_swap_mac_addr(bond, swap_slave, bond->current_slave); alb_swap_mac_addr(bond, swap_slave, bond->curr_active_slave);
} else { } else {
alb_set_slave_mac_addr(bond->current_slave, bond_dev->dev_addr, alb_set_slave_mac_addr(bond->curr_active_slave, bond_dev->dev_addr,
bond->alb_info.rlb_enabled); bond->alb_info.rlb_enabled);
alb_send_learning_packets(bond->current_slave, bond_dev->dev_addr); alb_send_learning_packets(bond->curr_active_slave, bond_dev->dev_addr);
if (bond->alb_info.rlb_enabled) { if (bond->alb_info.rlb_enabled) {
/* inform clients mac address has changed */ /* inform clients mac address has changed */
rlb_req_update_slave_clients(bond, bond->current_slave); rlb_req_update_slave_clients(bond, bond->curr_active_slave);
} }
} }
......
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
* *
* 2002/11/16 - Laurent Deniel <laurent.deniel at free.fr> * 2002/11/16 - Laurent Deniel <laurent.deniel at free.fr>
* - fix multicast handling in activebackup_arp_monitor * - fix multicast handling in activebackup_arp_monitor
* - remove one unnecessary and confusing current_slave == slave test * - remove one unnecessary and confusing curr_active_slave == slave test
* in activebackup_arp_monitor * in activebackup_arp_monitor
* *
* 2002/11/17 - Laurent Deniel <laurent.deniel at free.fr> * 2002/11/17 - Laurent Deniel <laurent.deniel at free.fr>
...@@ -330,7 +330,7 @@ ...@@ -330,7 +330,7 @@
* new/old ifenslave and new/old bonding. * new/old ifenslave and new/old bonding.
* *
* 2003/05/01 - Shmulik Hen <shmulik.hen at intel dot com> * 2003/05/01 - Shmulik Hen <shmulik.hen at intel dot com>
* - Fixed bug in bond_release_all(): save old value of current_slave * - Fixed bug in bond_release_all(): save old value of curr_active_slave
* before setting it to NULL. * before setting it to NULL.
* - Changed driver versioning scheme to include version number instead * - Changed driver versioning scheme to include version number instead
* of release date (that is already in another field). There are 3 * of release date (that is already in another field). There are 3
...@@ -358,7 +358,7 @@ ...@@ -358,7 +358,7 @@
* *
* 2003/05/01 - Shmulik Hen <shmulik.hen at intel dot com> * 2003/05/01 - Shmulik Hen <shmulik.hen at intel dot com>
* - Added support for Transmit load balancing mode. * - Added support for Transmit load balancing mode.
* - Concentrate all assignments of current_slave to a single point * - Concentrate all assignments of curr_active_slave to a single point
* so specific modes can take actions when the primary adapter is * so specific modes can take actions when the primary adapter is
* changed. * changed.
* - Take the updelay parameter into consideration during bond_enslave * - Take the updelay parameter into consideration during bond_enslave
...@@ -846,7 +846,7 @@ static void bond_register_lacpdu(struct bonding *bond) ...@@ -846,7 +846,7 @@ static void bond_register_lacpdu(struct bonding *bond)
/* initialize packet type */ /* initialize packet type */
pk_type->type = PKT_TYPE_LACPDU; pk_type->type = PKT_TYPE_LACPDU;
pk_type->dev = bond->device; pk_type->dev = bond->dev;
pk_type->func = bond_3ad_lacpdu_recv; pk_type->func = bond_3ad_lacpdu_recv;
dev_add_pack(pk_type); dev_add_pack(pk_type);
...@@ -1017,8 +1017,8 @@ static void bond_mc_add(struct bonding *bond, void *addr, int alen) ...@@ -1017,8 +1017,8 @@ static void bond_mc_add(struct bonding *bond, void *addr, int alen)
{ {
if (USES_PRIMARY(bond_mode)) { if (USES_PRIMARY(bond_mode)) {
/* write lock already acquired */ /* write lock already acquired */
if (bond->current_slave != NULL) if (bond->curr_active_slave != NULL)
dev_mc_add(bond->current_slave->dev, addr, alen, 0); dev_mc_add(bond->curr_active_slave->dev, addr, alen, 0);
} else { } else {
struct slave *slave; struct slave *slave;
int i; int i;
...@@ -1036,8 +1036,8 @@ static void bond_mc_delete(struct bonding *bond, void *addr, int alen) ...@@ -1036,8 +1036,8 @@ static void bond_mc_delete(struct bonding *bond, void *addr, int alen)
{ {
if (USES_PRIMARY(bond_mode)) { if (USES_PRIMARY(bond_mode)) {
/* write lock already acquired */ /* write lock already acquired */
if (bond->current_slave != NULL) if (bond->curr_active_slave != NULL)
dev_mc_delete(bond->current_slave->dev, addr, alen, 0); dev_mc_delete(bond->curr_active_slave->dev, addr, alen, 0);
} else { } else {
struct slave *slave; struct slave *slave;
int i; int i;
...@@ -1088,8 +1088,8 @@ static void bond_set_promiscuity(struct bonding *bond, int inc) ...@@ -1088,8 +1088,8 @@ static void bond_set_promiscuity(struct bonding *bond, int inc)
{ {
if (USES_PRIMARY(bond_mode)) { if (USES_PRIMARY(bond_mode)) {
/* write lock already acquired */ /* write lock already acquired */
if (bond->current_slave) { if (bond->curr_active_slave) {
dev_set_promiscuity(bond->current_slave->dev, inc); dev_set_promiscuity(bond->curr_active_slave->dev, inc);
} }
} else { } else {
...@@ -1108,8 +1108,8 @@ static void bond_set_allmulti(struct bonding *bond, int inc) ...@@ -1108,8 +1108,8 @@ static void bond_set_allmulti(struct bonding *bond, int inc)
{ {
if (USES_PRIMARY(bond_mode)) { if (USES_PRIMARY(bond_mode)) {
/* write lock already acquired */ /* write lock already acquired */
if (bond->current_slave != NULL) if (bond->curr_active_slave != NULL)
dev_set_allmulti(bond->current_slave->dev, inc); dev_set_allmulti(bond->curr_active_slave->dev, inc);
} else { } else {
struct slave *slave; struct slave *slave;
int i; int i;
...@@ -1196,25 +1196,25 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, struct ...@@ -1196,25 +1196,25 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, struct
} }
if (old_active) { if (old_active) {
if (bond->device->flags & IFF_PROMISC) { if (bond->dev->flags & IFF_PROMISC) {
dev_set_promiscuity(old_active->dev, -1); dev_set_promiscuity(old_active->dev, -1);
} }
if (bond->device->flags & IFF_ALLMULTI) { if (bond->dev->flags & IFF_ALLMULTI) {
dev_set_allmulti(old_active->dev, -1); dev_set_allmulti(old_active->dev, -1);
} }
for (dmi = bond->device->mc_list; dmi != NULL; dmi = dmi->next) { for (dmi = bond->dev->mc_list; dmi != NULL; dmi = dmi->next) {
dev_mc_delete(old_active->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); dev_mc_delete(old_active->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
} }
} }
if (new_active) { if (new_active) {
if (bond->device->flags & IFF_PROMISC) { if (bond->dev->flags & IFF_PROMISC) {
dev_set_promiscuity(new_active->dev, 1); dev_set_promiscuity(new_active->dev, 1);
} }
if (bond->device->flags & IFF_ALLMULTI) { if (bond->dev->flags & IFF_ALLMULTI) {
dev_set_allmulti(new_active->dev, 1); dev_set_allmulti(new_active->dev, 1);
} }
for (dmi = bond->device->mc_list; dmi != NULL; dmi = dmi->next) { for (dmi = bond->dev->mc_list; dmi != NULL; dmi = dmi->next) {
dev_mc_add(new_active->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); dev_mc_add(new_active->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
} }
} }
...@@ -1354,7 +1354,7 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de ...@@ -1354,7 +1354,7 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
/* If the mode USES_PRIMARY, then the new slave gets the /* If the mode USES_PRIMARY, then the new slave gets the
* master's promisc (and mc) settings only if it becomes the * master's promisc (and mc) settings only if it becomes the
* current_slave, and that is taken care of later when calling * curr_active_slave, and that is taken care of later when calling
* bond_change_active() * bond_change_active()
*/ */
if (!USES_PRIMARY(bond_mode)) { if (!USES_PRIMARY(bond_mode)) {
...@@ -1466,11 +1466,11 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de ...@@ -1466,11 +1466,11 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
* interface. The backup interfaces will have their NOARP flag set * interface. The backup interfaces will have their NOARP flag set
* because we need them to be completely deaf and not to respond to * because we need them to be completely deaf and not to respond to
* any ARP request on the network to avoid fooling a switch. Thus, * any ARP request on the network to avoid fooling a switch. Thus,
* since we guarantee that current_slave always point to the last * since we guarantee that curr_active_slave always point to the last
* usable interface, we just have to verify this interface's flag. * usable interface, we just have to verify this interface's flag.
*/ */
if (((bond->current_slave == NULL) if (((bond->curr_active_slave == NULL)
|| (bond->current_slave->dev->flags & IFF_NOARP)) || (bond->curr_active_slave->dev->flags & IFF_NOARP))
&& (new_slave->link != BOND_LINK_DOWN)) { && (new_slave->link != BOND_LINK_DOWN)) {
dprintk("This is the first active slave\n"); dprintk("This is the first active slave\n");
/* first slave or no active slave yet, and this link /* first slave or no active slave yet, and this link
...@@ -1506,7 +1506,7 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de ...@@ -1506,7 +1506,7 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
case BOND_MODE_TLB: case BOND_MODE_TLB:
case BOND_MODE_ALB: case BOND_MODE_ALB:
new_slave->state = BOND_STATE_ACTIVE; new_slave->state = BOND_STATE_ACTIVE;
if ((bond->current_slave == NULL) && (new_slave->link != BOND_LINK_DOWN)) { if ((bond->curr_active_slave == NULL) && (new_slave->link != BOND_LINK_DOWN)) {
/* first slave or no active slave yet, and this link /* first slave or no active slave yet, and this link
* is OK, so make this interface the active one * is OK, so make this interface the active one
*/ */
...@@ -1518,12 +1518,12 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de ...@@ -1518,12 +1518,12 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
/* always active in trunk mode */ /* always active in trunk mode */
new_slave->state = BOND_STATE_ACTIVE; new_slave->state = BOND_STATE_ACTIVE;
/* In trunking mode there is little meaning to current_slave /* In trunking mode there is little meaning to curr_active_slave
* anyway (it holds no special properties of the bond device), * anyway (it holds no special properties of the bond device),
* so we can change it without calling change_active_interface() * so we can change it without calling change_active_interface()
*/ */
if (bond->current_slave == NULL) if (bond->curr_active_slave == NULL)
bond->current_slave = new_slave; bond->curr_active_slave = new_slave;
break; break;
} /* switch(bond_mode) */ } /* switch(bond_mode) */
...@@ -1615,7 +1615,7 @@ static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_devi ...@@ -1615,7 +1615,7 @@ static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_devi
write_lock_bh(&bond->lock); write_lock_bh(&bond->lock);
old_active = bond->current_slave; old_active = bond->curr_active_slave;
new_active = bond_get_slave_by_dev(bond, slave_dev); new_active = bond_get_slave_by_dev(bond, slave_dev);
/* /*
...@@ -1642,7 +1642,7 @@ static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_devi ...@@ -1642,7 +1642,7 @@ static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_devi
* find_best_interface - select the best available slave to be the active one * find_best_interface - select the best available slave to be the active one
* @bond: our bonding struct * @bond: our bonding struct
* *
* Warning: Caller must hold ptrlock for writing. * Warning: Caller must hold curr_slave_lock for writing.
*/ */
static struct slave *bond_find_best_slave(struct bonding *bond) static struct slave *bond_find_best_slave(struct bonding *bond)
{ {
...@@ -1651,7 +1651,7 @@ static struct slave *bond_find_best_slave(struct bonding *bond) ...@@ -1651,7 +1651,7 @@ static struct slave *bond_find_best_slave(struct bonding *bond)
int mintime; int mintime;
int i; int i;
new_active = old_active = bond->current_slave; new_active = old_active = bond->curr_active_slave;
if (new_active == NULL) { /* there were no active slaves left */ if (new_active == NULL) { /* there were no active slaves left */
if (bond->slave_cnt > 0) { /* found one slave */ if (bond->slave_cnt > 0) { /* found one slave */
...@@ -1664,8 +1664,8 @@ static struct slave *bond_find_best_slave(struct bonding *bond) ...@@ -1664,8 +1664,8 @@ static struct slave *bond_find_best_slave(struct bonding *bond)
mintime = updelay; mintime = updelay;
/* first try the primary link; if arping, a link must tx/rx traffic /* first try the primary link; if arping, a link must tx/rx traffic
* before it can be considered the current_slave - also, we would skip * before it can be considered the curr_active_slave - also, we would skip
* slaves between the current_slave and primary_slave that may be up * slaves between the curr_active_slave and primary_slave that may be up
* and able to arp * and able to arp
*/ */
if ((bond->primary_slave != NULL) && (arp_interval == 0)) { if ((bond->primary_slave != NULL) && (arp_interval == 0)) {
...@@ -1700,18 +1700,18 @@ static struct slave *bond_find_best_slave(struct bonding *bond) ...@@ -1700,18 +1700,18 @@ static struct slave *bond_find_best_slave(struct bonding *bond)
* @new: the new slave to make the active one * @new: the new slave to make the active one
* *
* Set the new slave to the bond's settings and unset them on the old * Set the new slave to the bond's settings and unset them on the old
* current_slave. * curr_active_slave.
* Setting include flags, mc-list, promiscuity, allmulti, etc. * Setting include flags, mc-list, promiscuity, allmulti, etc.
* *
* If @new's link state is %BOND_LINK_BACK we'll set it to %BOND_LINK_UP, * If @new's link state is %BOND_LINK_BACK we'll set it to %BOND_LINK_UP,
* because it is apparently the best available slave we have, even though its * because it is apparently the best available slave we have, even though its
* updelay hasn't timed out yet. * updelay hasn't timed out yet.
* *
* Warning: Caller must hold ptrlock for writing. * Warning: Caller must hold curr_slave_lock for writing.
*/ */
static void bond_change_active_slave(struct bonding *bond, struct slave *new_active) static void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
{ {
struct slave *old_active = bond->current_slave; struct slave *old_active = bond->curr_active_slave;
if (old_active == new_active) { if (old_active == new_active) {
return; return;
...@@ -1723,7 +1723,7 @@ static void bond_change_active_slave(struct bonding *bond, struct slave *new_act ...@@ -1723,7 +1723,7 @@ static void bond_change_active_slave(struct bonding *bond, struct slave *new_act
printk(KERN_INFO DRV_NAME printk(KERN_INFO DRV_NAME
": %s: making interface %s the new " ": %s: making interface %s the new "
"active one %d ms earlier.\n", "active one %d ms earlier.\n",
bond->device->name, new_active->dev->name, bond->dev->name, new_active->dev->name,
(updelay - new_active->delay) * miimon); (updelay - new_active->delay) * miimon);
} }
...@@ -1744,7 +1744,7 @@ static void bond_change_active_slave(struct bonding *bond, struct slave *new_act ...@@ -1744,7 +1744,7 @@ static void bond_change_active_slave(struct bonding *bond, struct slave *new_act
printk(KERN_INFO DRV_NAME printk(KERN_INFO DRV_NAME
": %s: making interface %s the new " ": %s: making interface %s the new "
"active one.\n", "active one.\n",
bond->device->name, new_active->dev->name); bond->dev->name, new_active->dev->name);
} }
} }
} }
...@@ -1767,7 +1767,7 @@ static void bond_change_active_slave(struct bonding *bond, struct slave *new_act ...@@ -1767,7 +1767,7 @@ static void bond_change_active_slave(struct bonding *bond, struct slave *new_act
(bond_mode == BOND_MODE_ALB)) { (bond_mode == BOND_MODE_ALB)) {
bond_alb_handle_active_change(bond, new_active); bond_alb_handle_active_change(bond, new_active);
} else { } else {
bond->current_slave = new_active; bond->curr_active_slave = new_active;
} }
} }
...@@ -1776,11 +1776,11 @@ static void bond_change_active_slave(struct bonding *bond, struct slave *new_act ...@@ -1776,11 +1776,11 @@ static void bond_change_active_slave(struct bonding *bond, struct slave *new_act
* @bond: our bonding struct * @bond: our bonding struct
* *
* This functions shoud be called when one of the following occurs: * This functions shoud be called when one of the following occurs:
* - The old current_slave has been released or lost its link. * - The old curr_active_slave has been released or lost its link.
* - The primary_slave has got its link back. * - The primary_slave has got its link back.
* - A slave has got its link back and there's no old current_slave. * - A slave has got its link back and there's no old curr_active_slave.
* *
* Warning: Caller must hold ptrlock for writing. * Warning: Caller must hold curr_slave_lock for writing.
*/ */
static void bond_select_active_slave(struct bonding *bond) static void bond_select_active_slave(struct bonding *bond)
{ {
...@@ -1788,14 +1788,14 @@ static void bond_select_active_slave(struct bonding *bond) ...@@ -1788,14 +1788,14 @@ static void bond_select_active_slave(struct bonding *bond)
best_slave = bond_find_best_slave(bond); best_slave = bond_find_best_slave(bond);
if (best_slave != bond->current_slave) { if (best_slave != bond->curr_active_slave) {
bond_change_active_slave(bond, best_slave); bond_change_active_slave(bond, best_slave);
} }
} }
/* /*
* Try to release the slave device <slave> from the bond device <master> * Try to release the slave device <slave> from the bond device <master>
* It is legal to access current_slave without a lock because all the function * It is legal to access curr_active_slave without a lock because all the function
* is write-locked. * is write-locked.
* *
* The rules for slave state should be: * The rules for slave state should be:
...@@ -1831,7 +1831,7 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de ...@@ -1831,7 +1831,7 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de
return -EINVAL; return -EINVAL;
} }
mac_addr_differ = memcmp(bond->device->dev_addr, mac_addr_differ = memcmp(bond_dev->dev_addr,
slave->perm_hwaddr, slave->perm_hwaddr,
ETH_ALEN); ETH_ALEN);
if (!mac_addr_differ && (bond->slave_cnt > 1)) { if (!mac_addr_differ && (bond->slave_cnt > 1)) {
...@@ -1848,7 +1848,7 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de ...@@ -1848,7 +1848,7 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de
slave->perm_hwaddr[3], slave->perm_hwaddr[3],
slave->perm_hwaddr[4], slave->perm_hwaddr[4],
slave->perm_hwaddr[5], slave->perm_hwaddr[5],
bond->device->name, bond_dev->name,
slave_dev->name); slave_dev->name);
} }
...@@ -1876,12 +1876,12 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de ...@@ -1876,12 +1876,12 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de
bond->primary_slave = NULL; bond->primary_slave = NULL;
} }
if (bond->current_slave == slave) { if (bond->curr_active_slave == slave) {
bond_change_active_slave(bond, NULL); bond_change_active_slave(bond, NULL);
bond_select_active_slave(bond); bond_select_active_slave(bond);
} }
if (bond->current_slave == NULL) { if (bond->curr_active_slave == NULL) {
printk(KERN_INFO DRV_NAME printk(KERN_INFO DRV_NAME
": %s: now running without any active " ": %s: now running without any active "
"interface !\n", "interface !\n",
...@@ -1891,7 +1891,7 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de ...@@ -1891,7 +1891,7 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de
if ((bond_mode == BOND_MODE_TLB) || if ((bond_mode == BOND_MODE_TLB) ||
(bond_mode == BOND_MODE_ALB)) { (bond_mode == BOND_MODE_ALB)) {
/* must be called only after the slave has been /* must be called only after the slave has been
* detached from the list and the current_slave * detached from the list and the curr_active_slave
* has been replaced (if our_slave == old_current) * has been replaced (if our_slave == old_current)
*/ */
bond_alb_deinit_slave(bond, slave); bond_alb_deinit_slave(bond, slave);
...@@ -1900,7 +1900,7 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de ...@@ -1900,7 +1900,7 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de
write_unlock_bh(&bond->lock); write_unlock_bh(&bond->lock);
/* If the mode USES_PRIMARY, then we should only remove its /* If the mode USES_PRIMARY, then we should only remove its
* promisc and mc settings if it was the current_slave, but that was * promisc and mc settings if it was the curr_active_slave, but that was
* already taken care of above when we detached the slave * already taken care of above when we detached the slave
*/ */
if (!USES_PRIMARY(bond_mode)) { if (!USES_PRIMARY(bond_mode)) {
...@@ -1996,7 +1996,7 @@ static int bond_release_all(struct net_device *bond_dev) ...@@ -1996,7 +1996,7 @@ static int bond_release_all(struct net_device *bond_dev)
write_unlock_bh(&bond->lock); write_unlock_bh(&bond->lock);
/* If the mode USES_PRIMARY, then we should only remove its /* If the mode USES_PRIMARY, then we should only remove its
* promisc and mc settings if it was the current_slave, but that was * promisc and mc settings if it was the curr_active_slave, but that was
* already taken care of above when we detached the slave * already taken care of above when we detached the slave
*/ */
if (!USES_PRIMARY(bond_mode)) { if (!USES_PRIMARY(bond_mode)) {
...@@ -2079,9 +2079,9 @@ static void bond_mii_monitor(struct net_device *bond_dev) ...@@ -2079,9 +2079,9 @@ static void bond_mii_monitor(struct net_device *bond_dev)
* program could monitor the link itself if needed. * program could monitor the link itself if needed.
*/ */
read_lock(&bond->ptrlock); read_lock(&bond->curr_slave_lock);
oldcurrent = bond->current_slave; oldcurrent = bond->curr_active_slave;
read_unlock(&bond->ptrlock); read_unlock(&bond->curr_slave_lock);
bond_for_each_slave(bond, slave, i) { bond_for_each_slave(bond, slave, i) {
struct net_device *slave_dev = slave->dev; struct net_device *slave_dev = slave->dev;
...@@ -2266,17 +2266,17 @@ static void bond_mii_monitor(struct net_device *bond_dev) ...@@ -2266,17 +2266,17 @@ static void bond_mii_monitor(struct net_device *bond_dev)
} /* end of for */ } /* end of for */
if (do_failover) { if (do_failover) {
write_lock(&bond->ptrlock); write_lock(&bond->curr_slave_lock);
bond_select_active_slave(bond); bond_select_active_slave(bond);
if (oldcurrent && !bond->current_slave) { if (oldcurrent && !bond->curr_active_slave) {
printk(KERN_INFO DRV_NAME printk(KERN_INFO DRV_NAME
": %s: now running without any active " ": %s: now running without any active "
"interface !\n", "interface !\n",
bond_dev->name); bond_dev->name);
} }
write_unlock(&bond->ptrlock); write_unlock(&bond->curr_slave_lock);
} }
re_arm: re_arm:
...@@ -2310,12 +2310,12 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) ...@@ -2310,12 +2310,12 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev)
goto re_arm; goto re_arm;
} }
read_lock(&bond->ptrlock); read_lock(&bond->curr_slave_lock);
oldcurrent = bond->current_slave; oldcurrent = bond->curr_active_slave;
read_unlock(&bond->ptrlock); read_unlock(&bond->curr_slave_lock);
/* see if any of the previous devices are up now (i.e. they have /* see if any of the previous devices are up now (i.e. they have
* xmt and rcv traffic). the current_slave does not come into * xmt and rcv traffic). the curr_active_slave does not come into
* the picture unless it is null. also, slave->jiffies is not needed * 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 * 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. * long as it needs to get the tx/rx within the delta.
...@@ -2336,7 +2336,7 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) ...@@ -2336,7 +2336,7 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev)
/* primary_slave has no meaning in round-robin /* primary_slave has no meaning in round-robin
* mode. the window of a slave being up and * mode. the window of a slave being up and
* current_slave being null after enslaving * curr_active_slave being null after enslaving
* is closed. * is closed.
*/ */
if (oldcurrent == NULL) { if (oldcurrent == NULL) {
...@@ -2393,17 +2393,17 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) ...@@ -2393,17 +2393,17 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev)
} }
if (do_failover) { if (do_failover) {
write_lock(&bond->ptrlock); write_lock(&bond->curr_slave_lock);
bond_select_active_slave(bond); bond_select_active_slave(bond);
if (oldcurrent && !bond->current_slave) { if (oldcurrent && !bond->curr_active_slave) {
printk(KERN_INFO DRV_NAME printk(KERN_INFO DRV_NAME
": %s: now running without any active " ": %s: now running without any active "
"interface !\n", "interface !\n",
bond_dev->name); bond_dev->name);
} }
write_unlock(&bond->ptrlock); write_unlock(&bond->curr_slave_lock);
} }
re_arm: re_arm:
...@@ -2456,13 +2456,13 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) ...@@ -2456,13 +2456,13 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev)
delta_in_ticks) { delta_in_ticks) {
slave->link = BOND_LINK_UP; slave->link = BOND_LINK_UP;
write_lock(&bond->ptrlock); write_lock(&bond->curr_slave_lock);
if ((bond->current_slave == NULL) && if ((bond->curr_active_slave == NULL) &&
((jiffies - slave->dev->trans_start) <= ((jiffies - slave->dev->trans_start) <=
delta_in_ticks)) { delta_in_ticks)) {
bond_change_active_slave(bond, slave); bond_change_active_slave(bond, slave);
bond->current_arp_slave = NULL; bond->current_arp_slave = NULL;
} else if (bond->current_slave != slave) { } else if (bond->curr_active_slave != slave) {
/* this slave has just come up but we /* this slave has just come up but we
* already have a current slave; this * already have a current slave; this
* can also happen if bond_enslave adds * can also happen if bond_enslave adds
...@@ -2473,7 +2473,7 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) ...@@ -2473,7 +2473,7 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev)
bond->current_arp_slave = NULL; bond->current_arp_slave = NULL;
} }
if (slave == bond->current_slave) { if (slave == bond->curr_active_slave) {
printk(KERN_INFO DRV_NAME printk(KERN_INFO DRV_NAME
": %s: %s is up and now the " ": %s: %s is up and now the "
"active interface\n", "active interface\n",
...@@ -2487,11 +2487,11 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) ...@@ -2487,11 +2487,11 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev)
slave->dev->name); slave->dev->name);
} }
write_unlock(&bond->ptrlock); write_unlock(&bond->curr_slave_lock);
} }
} else { } else {
read_lock(&bond->ptrlock); read_lock(&bond->curr_slave_lock);
if ((slave != bond->current_slave) && if ((slave != bond->curr_active_slave) &&
(bond->current_arp_slave == NULL) && (bond->current_arp_slave == NULL) &&
(((jiffies - slave->dev->last_rx) >= (((jiffies - slave->dev->last_rx) >=
3*delta_in_ticks) && (my_ip != 0))) { 3*delta_in_ticks) && (my_ip != 0))) {
...@@ -2499,13 +2499,13 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) ...@@ -2499,13 +2499,13 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev)
* the delta allows the current slave to be * the delta allows the current slave to be
* taken out before the backup slave. * taken out before the backup slave.
* note: a non-null current_arp_slave indicates * note: a non-null current_arp_slave indicates
* the current_slave went down and we are * the curr_active_slave went down and we are
* searching for a new one; under this * searching for a new one; under this
* condition we only take the current_slave * condition we only take the curr_active_slave
* down - this gives each slave a chance to * down - this gives each slave a chance to
* tx/rx traffic before being taken out * tx/rx traffic before being taken out
*/ */
read_unlock(&bond->ptrlock); read_unlock(&bond->curr_slave_lock);
slave->link = BOND_LINK_DOWN; slave->link = BOND_LINK_DOWN;
if (slave->link_failure_count < UINT_MAX) { if (slave->link_failure_count < UINT_MAX) {
slave->link_failure_count++; slave->link_failure_count++;
...@@ -2516,24 +2516,24 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) ...@@ -2516,24 +2516,24 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev)
bond_dev->name, bond_dev->name,
slave->dev->name); slave->dev->name);
} else { } else {
read_unlock(&bond->ptrlock); read_unlock(&bond->curr_slave_lock);
} }
} }
} }
read_lock(&bond->ptrlock); read_lock(&bond->curr_slave_lock);
slave = bond->current_slave; slave = bond->curr_active_slave;
read_unlock(&bond->ptrlock); read_unlock(&bond->curr_slave_lock);
if (slave != NULL) { if (slave != NULL) {
/* if we have sent traffic in the past 2*arp_intervals but /* if we have sent traffic in the past 2*arp_intervals but
* haven't xmit and rx traffic in that time interval, select * haven't xmit and rx traffic in that time interval, select
* a different slave. slave->jiffies is only updated when * a different slave. slave->jiffies is only updated when
* a slave first becomes the current_slave - not necessarily * a slave first becomes the curr_active_slave - not necessarily
* after every arp; this ensures the slave has a full 2*delta * after every arp; this ensures the slave has a full 2*delta
* before being taken out. if a primary is being used, check * before being taken out. if a primary is being used, check
* if it is up and needs to take over as the current_slave * if it is up and needs to take over as the curr_active_slave
*/ */
if ((((jiffies - slave->dev->trans_start) >= if ((((jiffies - slave->dev->trans_start) >=
(2*delta_in_ticks)) || (2*delta_in_ticks)) ||
...@@ -2550,10 +2550,10 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) ...@@ -2550,10 +2550,10 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev)
"%s, disabling it", "%s, disabling it",
bond_dev->name, bond_dev->name,
slave->dev->name); slave->dev->name);
write_lock(&bond->ptrlock); write_lock(&bond->curr_slave_lock);
bond_select_active_slave(bond); bond_select_active_slave(bond);
slave = bond->current_slave; slave = bond->curr_active_slave;
write_unlock(&bond->ptrlock); write_unlock(&bond->curr_slave_lock);
bond->current_arp_slave = slave; bond->current_arp_slave = slave;
if (slave != NULL) { if (slave != NULL) {
slave->jiffies = jiffies; slave->jiffies = jiffies;
...@@ -2562,7 +2562,7 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) ...@@ -2562,7 +2562,7 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev)
} else if ((bond->primary_slave != NULL) && } else if ((bond->primary_slave != NULL) &&
(bond->primary_slave != slave) && (bond->primary_slave != slave) &&
(bond->primary_slave->link == BOND_LINK_UP)) { (bond->primary_slave->link == BOND_LINK_UP)) {
/* at this point, slave is the current_slave */ /* at this point, slave is the curr_active_slave */
printk(KERN_INFO DRV_NAME printk(KERN_INFO DRV_NAME
": %s: changing from interface %s to primary " ": %s: changing from interface %s to primary "
"interface %s\n", "interface %s\n",
...@@ -2571,9 +2571,9 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) ...@@ -2571,9 +2571,9 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev)
bond->primary_slave->dev->name); bond->primary_slave->dev->name);
/* primary is up so switch to it */ /* primary is up so switch to it */
write_lock(&bond->ptrlock); write_lock(&bond->curr_slave_lock);
bond_change_active_slave(bond, bond->primary_slave); bond_change_active_slave(bond, bond->primary_slave);
write_unlock(&bond->ptrlock); write_unlock(&bond->curr_slave_lock);
slave = bond->primary_slave; slave = bond->primary_slave;
slave->jiffies = jiffies; slave->jiffies = jiffies;
} else { } else {
...@@ -2588,9 +2588,9 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) ...@@ -2588,9 +2588,9 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev)
} }
} }
/* if we don't have a current_slave, search for the next available /* if we don't have a curr_active_slave, search for the next available
* backup slave from the current_arp_slave and make it the candidate * backup slave from the current_arp_slave and make it the candidate
* for becoming the current_slave * for becoming the curr_active_slave
*/ */
if (slave == NULL) { if (slave == NULL) {
...@@ -2786,11 +2786,11 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd ...@@ -2786,11 +2786,11 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
struct bonding *bond = (struct bonding *)bond_dev->priv; struct bonding *bond = (struct bonding *)bond_dev->priv;
mii->val_out = 0; mii->val_out = 0;
read_lock_bh(&bond->lock); read_lock_bh(&bond->lock);
read_lock(&bond->ptrlock); read_lock(&bond->curr_slave_lock);
if (bond->current_slave) { if (bond->curr_active_slave) {
mii->val_out = BMSR_LSTATUS; mii->val_out = BMSR_LSTATUS;
} }
read_unlock(&bond->ptrlock); read_unlock(&bond->curr_slave_lock);
read_unlock_bh(&bond->lock); read_unlock_bh(&bond->lock);
} }
return 0; return 0;
...@@ -2912,9 +2912,9 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev) ...@@ -2912,9 +2912,9 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev)
read_lock(&bond->lock); read_lock(&bond->lock);
read_lock(&bond->ptrlock); read_lock(&bond->curr_slave_lock);
start_at = bond->current_slave; start_at = bond->curr_active_slave;
read_unlock(&bond->ptrlock); read_unlock(&bond->curr_slave_lock);
if (start_at == NULL) { /* we're at the root, get the first slave */ if (start_at == NULL) { /* we're at the root, get the first slave */
/* no suitable interface, frame not sent */ /* no suitable interface, frame not sent */
...@@ -2969,9 +2969,9 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev ...@@ -2969,9 +2969,9 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev
read_lock(&bond->lock); read_lock(&bond->lock);
read_lock(&bond->ptrlock); read_lock(&bond->curr_slave_lock);
slave = start_at = bond->current_slave; slave = start_at = bond->curr_active_slave;
read_unlock(&bond->ptrlock); read_unlock(&bond->curr_slave_lock);
if (slave == NULL) { /* we're at the root, get the first slave */ if (slave == NULL) { /* we're at the root, get the first slave */
/* no suitable interface, frame not sent */ /* no suitable interface, frame not sent */
...@@ -2989,9 +2989,9 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev ...@@ -2989,9 +2989,9 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev
skb->priority = 1; skb->priority = 1;
dev_queue_xmit(skb); dev_queue_xmit(skb);
write_lock(&bond->ptrlock); write_lock(&bond->curr_slave_lock);
bond->current_slave = slave->next; bond->curr_active_slave = slave->next;
write_unlock(&bond->ptrlock); write_unlock(&bond->curr_slave_lock);
read_unlock(&bond->lock); read_unlock(&bond->lock);
return 0; return 0;
...@@ -3031,7 +3031,7 @@ static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev) ...@@ -3031,7 +3031,7 @@ static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev)
return 0; return 0;
} }
slave_no = (data->h_dest[5]^bond->device->dev_addr[5]) % bond->slave_cnt; slave_no = (data->h_dest[5]^bond_dev->dev_addr[5]) % bond->slave_cnt;
bond_for_each_slave(bond, slave, i) { bond_for_each_slave(bond, slave, i) {
slave_no--; slave_no--;
...@@ -3063,7 +3063,7 @@ static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev) ...@@ -3063,7 +3063,7 @@ static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev)
} }
/* /*
* in active-backup mode, we know that bond->current_slave is always valid if * in active-backup mode, we know that bond->curr_active_slave is always valid if
* the bond has a usable interface. * the bond has a usable interface.
*/ */
static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dev) static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dev)
...@@ -3089,17 +3089,17 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_d ...@@ -3089,17 +3089,17 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_d
read_lock(&bond->lock); read_lock(&bond->lock);
read_lock(&bond->ptrlock); read_lock(&bond->curr_slave_lock);
if (bond->current_slave != NULL) { /* one usable interface */ if (bond->curr_active_slave != NULL) { /* one usable interface */
skb->dev = bond->current_slave->dev; skb->dev = bond->curr_active_slave->dev;
read_unlock(&bond->ptrlock); read_unlock(&bond->curr_slave_lock);
skb->priority = 1; skb->priority = 1;
ret = dev_queue_xmit(skb); ret = dev_queue_xmit(skb);
read_unlock(&bond->lock); read_unlock(&bond->lock);
return 0; return 0;
} }
else { else {
read_unlock(&bond->ptrlock); read_unlock(&bond->curr_slave_lock);
} }
/* no suitable interface, frame not sent */ /* no suitable interface, frame not sent */
...@@ -3210,9 +3210,9 @@ static void bond_info_show_master(struct seq_file *seq, struct bonding *bond) ...@@ -3210,9 +3210,9 @@ static void bond_info_show_master(struct seq_file *seq, struct bonding *bond)
{ {
struct slave *curr; struct slave *curr;
read_lock(&bond->ptrlock); read_lock(&bond->curr_slave_lock);
curr = bond->current_slave; curr = bond->curr_active_slave;
read_unlock(&bond->ptrlock); read_unlock(&bond->curr_slave_lock);
seq_printf(seq, "Bonding Mode: %s\n", bond_mode_name()); seq_printf(seq, "Bonding Mode: %s\n", bond_mode_name());
...@@ -3236,7 +3236,7 @@ static void bond_info_show_master(struct seq_file *seq, struct bonding *bond) ...@@ -3236,7 +3236,7 @@ static void bond_info_show_master(struct seq_file *seq, struct bonding *bond)
if (bond_3ad_get_active_agg_info(bond, &ad_info)) { if (bond_3ad_get_active_agg_info(bond, &ad_info)) {
seq_printf(seq, "bond %s has no active aggregator\n", seq_printf(seq, "bond %s has no active aggregator\n",
bond->device->name); bond->dev->name);
} else { } else {
seq_printf(seq, "Active Aggregator Info:\n"); seq_printf(seq, "Active Aggregator Info:\n");
...@@ -3336,21 +3336,21 @@ static struct file_operations bond_info_fops = { ...@@ -3336,21 +3336,21 @@ static struct file_operations bond_info_fops = {
static int bond_create_proc_entry(struct bonding *bond) static int bond_create_proc_entry(struct bonding *bond)
{ {
struct net_device *bond_dev = bond->device; struct net_device *bond_dev = bond->dev;
if (bond_proc_dir) { if (bond_proc_dir) {
bond->bond_proc_file = create_proc_entry(bond_dev->name, bond->proc_entry = create_proc_entry(bond_dev->name,
S_IRUGO, S_IRUGO,
bond_proc_dir); bond_proc_dir);
if (bond->bond_proc_file == NULL) { if (bond->proc_entry == NULL) {
printk(KERN_WARNING DRV_NAME printk(KERN_WARNING DRV_NAME
": Warning: Cannot create /proc/net/bonding/%s\n", ": Warning: Cannot create /proc/net/bonding/%s\n",
bond_dev->name); bond_dev->name);
} else { } else {
bond->bond_proc_file->data = bond; bond->proc_entry->data = bond;
bond->bond_proc_file->proc_fops = &bond_info_fops; bond->proc_entry->proc_fops = &bond_info_fops;
bond->bond_proc_file->owner = THIS_MODULE; bond->proc_entry->owner = THIS_MODULE;
memcpy(bond->procdir_name, bond_dev->name, IFNAMSIZ); memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ);
} }
} }
...@@ -3359,10 +3359,10 @@ static int bond_create_proc_entry(struct bonding *bond) ...@@ -3359,10 +3359,10 @@ static int bond_create_proc_entry(struct bonding *bond)
static void bond_remove_proc_entry(struct bonding *bond) static void bond_remove_proc_entry(struct bonding *bond)
{ {
if (bond_proc_dir && bond->bond_proc_file) { if (bond_proc_dir && bond->proc_entry) {
remove_proc_entry(bond->procdir_name, bond_proc_dir); remove_proc_entry(bond->proc_file_name, bond_proc_dir);
memset(bond->procdir_name, 0, IFNAMSIZ); memset(bond->proc_file_name, 0, IFNAMSIZ);
bond->bond_proc_file = NULL; bond->proc_entry = NULL;
} }
} }
...@@ -3708,7 +3708,7 @@ static void bond_free_all(void) ...@@ -3708,7 +3708,7 @@ static void bond_free_all(void)
struct bonding *bond, *nxt; struct bonding *bond, *nxt;
list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) { list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) {
struct net_device *bond_dev = bond->device; struct net_device *bond_dev = bond->dev;
unregister_netdevice(bond_dev); unregister_netdevice(bond_dev);
bond_deinit(bond_dev); bond_deinit(bond_dev);
...@@ -3732,14 +3732,14 @@ static int __init bond_init(struct net_device *bond_dev) ...@@ -3732,14 +3732,14 @@ static int __init bond_init(struct net_device *bond_dev)
/* initialize rwlocks */ /* initialize rwlocks */
rwlock_init(&bond->lock); rwlock_init(&bond->lock);
rwlock_init(&bond->ptrlock); rwlock_init(&bond->curr_slave_lock);
/* Initialize pointers */ /* Initialize pointers */
bond->first_slave = NULL; bond->first_slave = NULL;
bond->current_slave = NULL; bond->curr_active_slave = NULL;
bond->current_arp_slave = NULL; bond->current_arp_slave = NULL;
bond->primary_slave = NULL; bond->primary_slave = NULL;
bond->device = bond_dev; bond->dev = bond_dev;
/* Initialize the device structure. */ /* Initialize the device structure. */
bond_dev->set_mac_address = bond_set_mac_address; bond_dev->set_mac_address = bond_set_mac_address;
......
...@@ -62,15 +62,15 @@ ...@@ -62,15 +62,15 @@
struct slave { struct slave {
struct net_device *dev; /* first - usefull for panic debug */
struct slave *next; struct slave *next;
struct slave *prev; struct slave *prev;
struct net_device *dev; s16 delay;
short delay; u32 jiffies;
unsigned long jiffies; s8 link; /* one of BOND_LINK_XXXX */
char link; /* one of BOND_LINK_XXXX */ s8 state; /* one of BOND_STATE_XXXX */
char state; /* one of BOND_STATE_XXXX */ u32 original_flags;
unsigned short original_flags; u32 link_failure_count;
u32 link_failure_count;
u16 speed; u16 speed;
u8 duplex; u8 duplex;
u8 perm_hwaddr[ETH_ALEN]; u8 perm_hwaddr[ETH_ALEN];
...@@ -82,33 +82,33 @@ struct slave { ...@@ -82,33 +82,33 @@ struct slave {
* Here are the locking policies for the two bonding locks: * Here are the locking policies for the two bonding locks:
* *
* 1) Get bond->lock when reading/writing slave list. * 1) Get bond->lock when reading/writing slave list.
* 2) Get bond->ptrlock when reading/writing bond->current_slave. * 2) Get bond->curr_slave_lock when reading/writing bond->curr_active_slave.
* (It is unnecessary when the write-lock is put with bond->lock.) * (It is unnecessary when the write-lock is put with bond->lock.)
* 3) When we lock with bond->ptrlock, we must lock with bond->lock * 3) When we lock with bond->curr_slave_lock, we must lock with bond->lock
* beforehand. * beforehand.
*/ */
struct bonding { struct bonding {
struct slave *first_slave; struct net_device *dev; /* first - usefull for panic debug */
struct slave *current_slave; struct slave *first_slave;
struct slave *primary_slave; struct slave *curr_active_slave;
struct slave *current_arp_slave; struct slave *current_arp_slave;
int slave_cnt; /* never change this value outside the attach/detach wrappers */ struct slave *primary_slave;
s32 slave_cnt; /* never change this value outside the attach/detach wrappers */
rwlock_t lock; rwlock_t lock;
rwlock_t ptrlock; rwlock_t curr_slave_lock;
struct timer_list mii_timer; struct timer_list mii_timer;
struct timer_list arp_timer; struct timer_list arp_timer;
int kill_timers; s8 kill_timers;
struct net_device_stats stats; struct net_device_stats stats;
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
struct proc_dir_entry *bond_proc_file; struct proc_dir_entry *proc_entry;
char procdir_name[IFNAMSIZ]; char proc_file_name[IFNAMSIZ];
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_PROC_FS */
struct list_head bond_list; struct list_head bond_list;
struct net_device *device; struct dev_mc_list *mc_list;
struct dev_mc_list *mc_list; u16 flags;
unsigned short flags; struct ad_bond_info ad_info;
struct ad_bond_info ad_info; struct alb_bond_info alb_info;
struct alb_bond_info alb_info;
}; };
/** /**
......
...@@ -86,9 +86,9 @@ typedef struct ifbond { ...@@ -86,9 +86,9 @@ typedef struct ifbond {
typedef struct ifslave typedef struct ifslave
{ {
__s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */ __s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */
char slave_name[IFNAMSIZ]; __s8 slave_name[IFNAMSIZ];
char link; __s8 link;
char state; __s8 state;
__u32 link_failure_count; __u32 link_failure_count;
} ifslave; } ifslave;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment