From f307b1c98395aaf47673fc0133acd0e18372f87a Mon Sep 17 00:00:00 2001 From: Shmulik Hen Date: Sat, 10 Jan 2004 06:29:39 -0500 Subject: [PATCH] bonding cleanup 2.6 - Simplify ifenslave ifenslave lite - No more IP settings to slaves, unified printing format, code re-org and broken to more functions. --- include/linux/if_bonding.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h index 4419670188d2..0069d63370d7 100644 --- a/include/linux/if_bonding.h +++ b/include/linux/if_bonding.h @@ -42,7 +42,7 @@ #include /* userland - kernel ABI version (2003/05/08) */ -#define BOND_ABI_VERSION 1 +#define BOND_ABI_VERSION 2 /* * We can remove these ioctl definitions in 2.5. People should use the -- cgit v1.2.3 From de631a0074096113efc400fdb4cd7be82c66b5e2 Mon Sep 17 00:00:00 2001 From: Shmulik Hen Date: Sat, 10 Jan 2004 06:30:51 -0500 Subject: [PATCH] bonding cleanup 2.6 - Remove multicast_mode module param Eliminate the multicast_mode module param. Settings are now done only according to mode. --- Documentation/networking/bonding.txt | 14 --- drivers/net/bonding/bond_main.c | 220 +++++++++++------------------------ include/linux/if_bonding.h | 4 - 3 files changed, 65 insertions(+), 173 deletions(-) (limited to 'include/linux') diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index de84534f199a..fb6d2eb3c6ec 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt @@ -368,20 +368,6 @@ mode fails it's hw address is swapped with the new current_slave that was chosen. -multicast - - Option specifying the mode of operation for multicast support. - Possible values are: - - disabled or 0 - Disabled (no multicast support) - - active or 1 - Enabled on active slave only, useful in active-backup mode - - all or 2 - Enabled on all slaves, this is the default - primary A string (eth0, eth2, etc) to equate to a primary device. If this diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index ee57d39f755a..6e3cbf2e50f3 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -537,16 +537,6 @@ static struct bond_parm_tbl bond_mode_tbl[] = { { NULL, -1}, }; -static int multicast_mode = BOND_MULTICAST_ALL; -static char *multicast = NULL; - -static struct bond_parm_tbl bond_mc_tbl[] = { -{ "disabled", BOND_MULTICAST_DISABLED}, -{ "active", BOND_MULTICAST_ACTIVE}, -{ "all", BOND_MULTICAST_ALL}, -{ NULL, -1}, -}; - static int lacp_fast = 0; static char *lacp_rate = NULL; @@ -579,8 +569,6 @@ MODULE_PARM(downdelay, "i"); MODULE_PARM_DESC(downdelay, "Delay before considering link down, in milliseconds"); MODULE_PARM(primary, "s"); MODULE_PARM_DESC(primary, "Primary network device to use"); -MODULE_PARM(multicast, "s"); -MODULE_PARM_DESC(multicast, "Mode for multicast support : 0 for none, 1 for active slave, 2 for all slaves (default)"); MODULE_PARM(lacp_rate, "s"); MODULE_PARM_DESC(lacp_rate, "LACPDU tx rate to request from 802.3ad partner (slow/fast)"); @@ -644,21 +632,6 @@ bond_mode_name(void) } } -static const char * -multicast_mode_name(void) -{ - switch(multicast_mode) { - case BOND_MULTICAST_DISABLED : - return "disabled"; - case BOND_MULTICAST_ACTIVE : - return "active slave only"; - case BOND_MULTICAST_ALL : - return "all slaves"; - default : - return "unknown"; - } -} - void bond_set_slave_inactive_flags(struct slave *slave) { slave->state = BOND_STATE_BACKUP; @@ -1080,44 +1053,36 @@ static void bond_mc_list_destroy(struct bonding *bond) } /* - * Add a Multicast address to every slave in the bonding group + * Add a Multicast address to slaves + * according to mode */ static void bond_mc_add(struct bonding *bond, void *addr, int alen) { - struct slave *slave; - switch (multicast_mode) { - case BOND_MULTICAST_ACTIVE : + if (USES_PRIMARY(bond_mode)) { /* write lock already acquired */ if (bond->current_slave != NULL) dev_mc_add(bond->current_slave->dev, addr, alen, 0); - break; - case BOND_MULTICAST_ALL : + } else { + struct slave *slave; for (slave = bond->prev; slave != (struct slave *)bond; slave = slave->prev) dev_mc_add(slave->dev, addr, alen, 0); - break; - case BOND_MULTICAST_DISABLED : - break; } } /* - * Remove a multicast address from every slave in the bonding group + * Remove a multicast address from slave + * according to mode */ static void bond_mc_delete(struct bonding *bond, void *addr, int alen) { - struct slave *slave; - switch (multicast_mode) { - case BOND_MULTICAST_ACTIVE : + if (USES_PRIMARY(bond_mode)) { /* write lock already acquired */ if (bond->current_slave != NULL) dev_mc_delete(bond->current_slave->dev, addr, alen, 0); - break; - case BOND_MULTICAST_ALL : + } else { + struct slave *slave; for (slave = bond->prev; slave != (struct slave *)bond; slave = slave->prev) dev_mc_delete(slave->dev, addr, alen, 0); - break; - case BOND_MULTICAST_DISABLED : - break; } } @@ -1161,14 +1126,14 @@ static inline int dmi_same(struct dev_mc_list *dmi1, struct dev_mc_list *dmi2) */ static void bond_set_promiscuity(struct bonding *bond, int inc) { - struct slave *slave; - if (USES_PRIMARY(bond_mode)) { + /* write lock already acquired */ if (bond->current_slave) { dev_set_promiscuity(bond->current_slave->dev, inc); } } else { + struct slave *slave; for (slave = bond->prev; slave != (struct slave *)bond; slave = slave->prev) { dev_set_promiscuity(slave->dev, inc); @@ -1181,19 +1146,14 @@ static void bond_set_promiscuity(struct bonding *bond, int inc) */ static void bond_set_allmulti(struct bonding *bond, int inc) { - struct slave *slave; - switch (multicast_mode) { - case BOND_MULTICAST_ACTIVE : + if (USES_PRIMARY(bond_mode)) { /* write lock already acquired */ if (bond->current_slave != NULL) dev_set_allmulti(bond->current_slave->dev, inc); - break; - case BOND_MULTICAST_ALL : + } else { + struct slave *slave; for (slave = bond->prev; slave != (struct slave *)bond; slave = slave->prev) dev_set_allmulti(slave->dev, inc); - break; - case BOND_MULTICAST_DISABLED : - break; } } @@ -1229,12 +1189,6 @@ static void set_multicast_list(struct net_device *master) if ( !(master->flags & IFF_PROMISC) && (bond->flags & IFF_PROMISC) ) bond_set_promiscuity(bond, -1); - if (multicast_mode == BOND_MULTICAST_DISABLED) { - bond->flags = master->flags; - write_unlock_bh(&bond->lock); - return; - } - /* set allmulti flag to slaves */ if ( (master->flags & IFF_ALLMULTI) && !(bond->flags & IFF_ALLMULTI) ) bond_set_allmulti(bond, 1); @@ -1273,39 +1227,35 @@ static void bond_mc_update(struct bonding *bond, struct slave *new, struct slave { struct dev_mc_list *dmi; - if (USES_PRIMARY(bond_mode)) { + if (!USES_PRIMARY(bond_mode)) { + /* nothing to do - mc list is already up-to-date on + * all slaves + */ + return; + } + + if (old) { if (bond->device->flags & IFF_PROMISC) { - if (old) - dev_set_promiscuity(old->dev, -1); - if (new) - dev_set_promiscuity(new->dev, 1); + dev_set_promiscuity(old->dev, -1); + } + if (bond->device->flags & IFF_ALLMULTI) { + dev_set_allmulti(old->dev, -1); + } + for (dmi = bond->device->mc_list; dmi != NULL; dmi = dmi->next) { + dev_mc_delete(old->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); } } - switch(multicast_mode) { - case BOND_MULTICAST_ACTIVE : - if (bond->device->flags & IFF_ALLMULTI) { - if (old) - dev_set_allmulti(old->dev, -1); - if (new) - dev_set_allmulti(new->dev, 1); + if (new) { + if (bond->device->flags & IFF_PROMISC) { + dev_set_promiscuity(new->dev, 1); } - /* first remove all mc addresses from old slave if any, - and _then_ add them to new active slave */ - if (old) { - for (dmi = bond->device->mc_list; dmi != NULL; dmi = dmi->next) - dev_mc_delete(old->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); + if (bond->device->flags & IFF_ALLMULTI) { + dev_set_allmulti(new->dev, 1); } - if (new) { - for (dmi = bond->device->mc_list; dmi != NULL; dmi = dmi->next) - dev_mc_add(new->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); + for (dmi = bond->device->mc_list; dmi != NULL; dmi = dmi->next) { + dev_mc_add(new->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); } - break; - case BOND_MULTICAST_ALL : - /* nothing to do: mc list is already up-to-date on all slaves */ - break; - case BOND_MULTICAST_DISABLED : - break; } } @@ -1444,19 +1394,16 @@ static int bond_enslave(struct net_device *master_dev, } } - /* set promiscuity level to new slave */ - if (master_dev->flags & IFF_PROMISC) { - /* If the mode USES_PRIMARY, then the new slave gets the - * master's promisc (and mc) settings only if it becomes the - * current_slave, and that is taken care of later when calling - * bond_change_active() - */ - if (!USES_PRIMARY(bond_mode)) { + /* If the mode USES_PRIMARY, then the new slave gets the + * master's promisc (and mc) settings only if it becomes the + * current_slave, and that is taken care of later when calling + * bond_change_active() + */ + if (!USES_PRIMARY(bond_mode)) { + /* set promiscuity level to new slave */ + if (master_dev->flags & IFF_PROMISC) { dev_set_promiscuity(slave_dev, 1); } - } - - if (multicast_mode == BOND_MULTICAST_ALL) { /* set allmulti level to new slave */ if (master_dev->flags & IFF_ALLMULTI) dev_set_allmulti(slave_dev, 1); @@ -2006,25 +1953,21 @@ static int bond_release(struct net_device *master, struct net_device *slave) return -EINVAL; } - /* unset promiscuity level from slave */ - if (master->flags & IFF_PROMISC) { - /* If the mode USES_PRIMARY, then we should only remove its - * promisc settings if it was the current_slave, but that was - * already taken care of above when we detached the slave - */ - if (!USES_PRIMARY(bond_mode)) { + /* If the mode USES_PRIMARY, then we should only remove its + * promisc and mc settings if it was the current_slave, but that was + * already taken care of above when we detached the slave + */ + if (!USES_PRIMARY(bond_mode)) { + /* unset promiscuity level from slave */ + if (master->flags & IFF_PROMISC) { dev_set_promiscuity(slave, -1); } - } - - /* undo settings and restore original values */ - if (multicast_mode == BOND_MULTICAST_ALL) { - /* flush master's mc_list from slave */ - bond_mc_list_flush (slave, master); - /* unset allmulti level from slave */ if (master->flags & IFF_ALLMULTI) dev_set_allmulti(slave, -1); + + /* flush master's mc_list from slave */ + bond_mc_list_flush (slave, master); } netdev_set_master(slave, NULL); @@ -2107,20 +2050,21 @@ static int bond_release_all(struct net_device *master) */ write_unlock_bh(&bond->lock); - /* unset promiscuity level from slave */ - if (master->flags & IFF_PROMISC) { - if (!USES_PRIMARY(bond_mode)) { + /* If the mode USES_PRIMARY, then we should only remove its + * promisc and mc settings if it was the current_slave, but that was + * already taken care of above when we detached the slave + */ + if (!USES_PRIMARY(bond_mode)) { + /* unset promiscuity level from slave */ + if (master->flags & IFF_PROMISC) { dev_set_promiscuity(slave_dev, -1); } - } + /* unset allmulti level from slave */ + if (master->flags & IFF_ALLMULTI) + dev_set_allmulti(slave_dev, -1); - if (multicast_mode == BOND_MULTICAST_ALL) { /* flush master's mc_list from slave */ bond_mc_list_flush (slave_dev, master); - - /* unset allmulti level from slave */ - if (master->flags & IFF_ALLMULTI) - dev_set_allmulti(slave_dev, -1); } netdev_set_master(slave_dev, NULL); @@ -3343,7 +3287,6 @@ static void bond_info_show_master(struct seq_file *seq, struct bonding *bond) seq_printf(seq, "MII Polling Interval (ms): %d\n", miimon); seq_printf(seq, "Up Delay (ms): %d\n", updelay * miimon); seq_printf(seq, "Down Delay (ms): %d\n", downdelay * miimon); - seq_printf(seq, "Multicast Mode: %s\n", multicast_mode_name()); if (bond_mode == BOND_MODE_8023AD) { struct ad_info ad_info; @@ -3942,22 +3885,6 @@ static int bond_check_params(void) } } - if (USES_PRIMARY(bond_mode)) { - multicast_mode = BOND_MULTICAST_ACTIVE; - } else { - multicast_mode = BOND_MULTICAST_ALL; - } - - if (multicast) { - multicast_mode = bond_parse_parm(multicast, bond_mc_tbl); - if (multicast_mode == -1) { - printk(KERN_ERR DRV_NAME - ": Error: Invalid multicast mode \"%s\"\n", - multicast == NULL ? "NULL" : multicast); - return -EINVAL; - } - } - if (lacp_rate) { if (bond_mode != BOND_MODE_8023AD) { printk(KERN_INFO DRV_NAME @@ -4026,14 +3953,6 @@ static int bond_check_params(void) printk(KERN_WARNING "Forcing miimon to 100msec\n"); miimon = 100; } - - if (multicast_mode != BOND_MULTICAST_ALL) { - printk(KERN_WARNING DRV_NAME - ": Warning: Multicast mode must be set to ALL " - "for 802.3ad\n"); - printk(KERN_WARNING "Forcing Multicast mode to ALL\n"); - multicast_mode = BOND_MULTICAST_ALL; - } } /* reset values for TLB/ALB */ @@ -4048,15 +3967,6 @@ static int bond_check_params(void) printk(KERN_WARNING "Forcing miimon to 100msec\n"); miimon = 100; } - - if (multicast_mode != BOND_MULTICAST_ACTIVE) { - printk(KERN_WARNING DRV_NAME - ": Warning: Multicast mode must be set to " - "ACTIVE for TLB/ALB\n"); - printk(KERN_WARNING "Forcing Multicast mode to " - "ACTIVE\n"); - multicast_mode = BOND_MULTICAST_ACTIVE; - } } if (bond_mode == BOND_MODE_ALB) { diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h index 0069d63370d7..3b129d9f3ee1 100644 --- a/include/linux/if_bonding.h +++ b/include/linux/if_bonding.h @@ -77,10 +77,6 @@ #define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */ -#define BOND_MULTICAST_DISABLED 0 -#define BOND_MULTICAST_ACTIVE 1 -#define BOND_MULTICAST_ALL 2 - typedef struct ifbond { __s32 bond_mode; __s32 num_slaves; -- cgit v1.2.3 From 9fec364cbd94c5486a3ee589d5e61dfc2f75ea5d Mon Sep 17 00:00:00 2001 From: Shmulik Hen Date: Sat, 10 Jan 2004 06:31:26 -0500 Subject: [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. --- Documentation/networking/bonding.txt | 6 +- drivers/net/bonding/bond_3ad.c | 8 +- drivers/net/bonding/bond_alb.c | 118 ++++++++-------- drivers/net/bonding/bond_main.c | 254 +++++++++++++++++------------------ drivers/net/bonding/bonding.h | 54 ++++---- include/linux/if_bonding.h | 6 +- 6 files changed, 223 insertions(+), 223 deletions(-) (limited to 'include/linux') diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index fb6d2eb3c6ec..d9427122e192 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt @@ -363,9 +363,9 @@ mode 2. Base driver support for setting the hw address of a device also when it is open. This is required so that there will always be one slave in the team using the bond hw - address (the current_slave) while having a unique hw - address for each slave in the bond. If the current_slave - fails it's hw address is swapped with the new current_slave + address (the curr_active_slave) while having a unique hw + address for each slave in the bond. If the curr_active_slave + fails it's hw address is swapped with the new curr_active_slave that was chosen. primary diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index be409a9f1f7d..4ba1667be961 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c @@ -1890,13 +1890,13 @@ static u16 aggregator_identifier; void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution, int lacp_fast) { // 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; 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->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) ad_ticks_per_sec = tick_resolution; @@ -1964,7 +1964,7 @@ int bond_3ad_bind_slave(struct slave *slave) 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->slave = slave; aggregator->is_active = 0; @@ -2399,7 +2399,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) 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) { struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator; diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index d47e497d5629..cf12046383a2 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c @@ -191,7 +191,7 @@ static int tlb_initialize(struct bonding *bond) if (bond_info->tx_hashtbl == NULL) { printk(KERN_ERR DRV_NAME ": Error: %s: Failed to allocate TLB hash table\n", - bond->device->name); + bond->dev->name); _unlock_tx_hashtbl(bond); return -1; } @@ -401,20 +401,20 @@ static struct slave *rlb_next_rx_slave(struct bonding *bond) /* teach the switch the mac of a disabled slave * 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[]) { - if (!bond->current_slave) { + if (!bond->curr_active_slave) { return; } if (!bond->alb_info.primary_is_promisc) { 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; - 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 @@ -463,11 +463,11 @@ static void rlb_clear_slave(struct bonding *bond, struct slave *slave) _unlock_rx_hashtbl(bond); - write_lock(&bond->ptrlock); - if (slave != bond->current_slave) { + write_lock(&bond->curr_slave_lock); + if (slave != bond->curr_active_slave) { 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) @@ -570,12 +570,12 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, u32 src_ip) continue; } /*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. */ if ((client_info->ip_src == src_ip) && 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)) { client_info->ntt = 1; bond_info->rx_ntt = 1; @@ -616,12 +616,12 @@ struct slave *rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp) } } else { /* 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. */ - if (bond->current_slave && - client_info->slave != bond->current_slave) { - client_info->slave = bond->current_slave; + if (bond->curr_active_slave && + client_info->slave != bond->curr_active_slave) { + client_info->slave = bond->curr_active_slave; rlb_update_client(client_info); } } @@ -666,7 +666,7 @@ struct slave *rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp) /* chooses (and returns) transmit channel for arp reply * 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) { @@ -761,7 +761,7 @@ static int rlb_initialize(struct bonding *bond) if (bond_info->rx_hashtbl == NULL) { printk(KERN_ERR DRV_NAME ": Error: %s: Failed to allocate RLB hash table\n", - bond->device->name); + bond->dev->name); _unlock_rx_hashtbl(bond); return -1; } @@ -775,7 +775,7 @@ static int rlb_initialize(struct bonding *bond) /*initialize packet type*/ pk_type->type = __constant_htons(ETH_P_ARP); - pk_type->dev = bond->device; + pk_type->dev = bond->dev; pk_type->func = rlb_arp_recv; /* register to receive ARPs */ @@ -860,7 +860,7 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw) 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) { struct slave *disabled_slave = NULL; @@ -932,7 +932,7 @@ static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *sla slave->dev->dev_addr, ETH_ALEN); perm_bond_diff = memcmp(slave->perm_hwaddr, - bond->device->dev_addr, + bond->dev->dev_addr, ETH_ALEN); if (perm_curr_diff && perm_bond_diff) { 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 * check uniqueness of slave's mac address against the other * 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) { if (!memcmp(tmp_slave1->dev->dev_addr, slave->dev->dev_addr, ETH_ALEN)) { @@ -1103,8 +1103,8 @@ static int alb_set_mac_address(struct bonding *bond, void *addr) return 0; unwind: - memcpy(sa.sa_data, bond->device->dev_addr, bond->device->addr_len); - sa.sa_family = bond->device->type; + memcpy(sa.sa_data, bond->dev->dev_addr, bond->dev->addr_len); + sa.sa_family = bond->dev->type; /* unwind from head to the slave that failed */ stop_at = slave; @@ -1169,7 +1169,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) 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 */ read_lock(&bond->lock); @@ -1181,7 +1181,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) return 0; } - read_lock(&bond->ptrlock); + read_lock(&bond->curr_slave_lock); switch (ntohs(skb->protocol)) { case ETH_P_IP: @@ -1245,13 +1245,13 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) if (!tx_slave) { /* unbalanced or unassigned, send through primary */ - tx_slave = bond->current_slave; + tx_slave = bond->curr_active_slave; bond_info->unbalanced_load += skb->len; } if (tx_slave && SLAVE_IS_OK(tx_slave)) { skb->dev = tx_slave->dev; - if (tx_slave != bond->current_slave) { + if (tx_slave != bond->curr_active_slave) { memcpy(eth_data->h_source, tx_slave->dev->dev_addr, ETH_ALEN); @@ -1265,7 +1265,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) dev_kfree_skb(skb); } - read_unlock(&bond->ptrlock); + read_unlock(&bond->curr_slave_lock); read_unlock(&bond->lock); return 0; } @@ -1294,44 +1294,44 @@ void bond_alb_monitor(struct bonding *bond) /* send learning packets */ 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 - * sending the learning packets, the ptrlock must be held for + * sending the learning packets, the curr_slave_lock must be held for * read. */ - read_lock(&bond->ptrlock); + read_lock(&bond->curr_slave_lock); bond_for_each_slave(bond, slave, i) { alb_send_learning_packets(slave,slave->dev->dev_addr); } - read_unlock(&bond->ptrlock); + read_unlock(&bond->curr_slave_lock); bond_info->lp_counter = 0; } /* rebalance tx traffic */ 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) { tlb_clear_slave(bond, slave, 1); - if (slave == bond->current_slave) { + if (slave == bond->curr_active_slave) { SLAVE_TLB_INFO(slave).load = bond_info->unbalanced_load / BOND_TLB_REBALANCE_INTERVAL; bond_info->unbalanced_load = 0; } } - read_unlock(&bond->ptrlock); + read_unlock(&bond->curr_slave_lock); bond_info->tx_rebalance_counter = 0; } /* handle rlb stuff */ if (bond_info->rlb_enabled) { /* 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 * sets the promiscuity. */ - write_lock(&bond->ptrlock); + write_lock(&bond->curr_slave_lock); if (bond_info->primary_is_promisc && (++bond_info->rlb_promisc_timeout_counter >= RLB_PROMISC_TIMEOUT)) { @@ -1342,10 +1342,10 @@ void bond_alb_monitor(struct bonding *bond) * because a slave was disabled then * 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; } - write_unlock(&bond->ptrlock); + write_unlock(&bond->curr_slave_lock); if (bond_info->rlb_rebalance == 1) { bond_info->rlb_rebalance = 0; @@ -1373,7 +1373,7 @@ out: 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 */ 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 } /** - * bond_alb_handle_active_change - assign new current_slave + * bond_alb_handle_active_change - assign new curr_active_slave * @bond: our bonding struct * @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. * - * 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) { struct slave *swap_slave; int i, found = 0; - if (bond->current_slave == new_slave) { + if (bond->curr_active_slave == new_slave) { return; } - if (bond->current_slave && bond->alb_info.primary_is_promisc) { - dev_set_promiscuity(bond->current_slave->dev, -1); + if (bond->curr_active_slave && bond->alb_info.primary_is_promisc) { + dev_set_promiscuity(bond->curr_active_slave->dev, -1); bond->alb_info.primary_is_promisc = 0; bond->alb_info.rlb_promisc_timeout_counter = 0; } - swap_slave = bond->current_slave; - bond->current_slave = new_slave; + swap_slave = bond->curr_active_slave; + bond->curr_active_slave = new_slave; if (!new_slave || (bond->slave_cnt == 0)) { return; } - /* set the new current_slave to the bonds mac address - * i.e. swap mac addresses of old current_slave and new current_slave + /* set the new curr_active_slave to the bonds mac address + * i.e. swap mac addresses of old curr_active_slave and new curr_active_slave */ if (!swap_slave) { /* find slave that is holding the bond's mac address */ bond_for_each_slave(bond, swap_slave, i) { if (!memcmp(swap_slave->dev->dev_addr, - bond->device->dev_addr, ETH_ALEN)) { + bond->dev->dev_addr, ETH_ALEN)) { found = 1; 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) { /* swap mac address */ alb_swap_mac_addr(bond, swap_slave, new_slave); } else { /* 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); /* 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) 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 * duplications. */ - if (bond->current_slave == NULL) { + if (bond->curr_active_slave == NULL) { return 0; } @@ -1544,15 +1544,15 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) } if (found) { - alb_swap_mac_addr(bond, swap_slave, bond->current_slave); + alb_swap_mac_addr(bond, swap_slave, bond->curr_active_slave); } 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); - 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) { /* 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); } } diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 201b3d41303f..df1b919179d7 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -248,7 +248,7 @@ * * 2002/11/16 - Laurent Deniel * - 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 * * 2002/11/17 - Laurent Deniel @@ -330,7 +330,7 @@ * new/old ifenslave and new/old bonding. * * 2003/05/01 - Shmulik Hen - * - 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. * - Changed driver versioning scheme to include version number instead * of release date (that is already in another field). There are 3 @@ -358,7 +358,7 @@ * * 2003/05/01 - Shmulik Hen * - 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 * changed. * - Take the updelay parameter into consideration during bond_enslave @@ -846,7 +846,7 @@ static void bond_register_lacpdu(struct bonding *bond) /* initialize packet type */ pk_type->type = PKT_TYPE_LACPDU; - pk_type->dev = bond->device; + pk_type->dev = bond->dev; pk_type->func = bond_3ad_lacpdu_recv; dev_add_pack(pk_type); @@ -1017,8 +1017,8 @@ static void bond_mc_add(struct bonding *bond, void *addr, int alen) { if (USES_PRIMARY(bond_mode)) { /* write lock already acquired */ - if (bond->current_slave != NULL) - dev_mc_add(bond->current_slave->dev, addr, alen, 0); + if (bond->curr_active_slave != NULL) + dev_mc_add(bond->curr_active_slave->dev, addr, alen, 0); } else { struct slave *slave; int i; @@ -1036,8 +1036,8 @@ static void bond_mc_delete(struct bonding *bond, void *addr, int alen) { if (USES_PRIMARY(bond_mode)) { /* write lock already acquired */ - if (bond->current_slave != NULL) - dev_mc_delete(bond->current_slave->dev, addr, alen, 0); + if (bond->curr_active_slave != NULL) + dev_mc_delete(bond->curr_active_slave->dev, addr, alen, 0); } else { struct slave *slave; int i; @@ -1088,8 +1088,8 @@ static void bond_set_promiscuity(struct bonding *bond, int inc) { if (USES_PRIMARY(bond_mode)) { /* write lock already acquired */ - if (bond->current_slave) { - dev_set_promiscuity(bond->current_slave->dev, inc); + if (bond->curr_active_slave) { + dev_set_promiscuity(bond->curr_active_slave->dev, inc); } } else { @@ -1108,8 +1108,8 @@ static void bond_set_allmulti(struct bonding *bond, int inc) { if (USES_PRIMARY(bond_mode)) { /* write lock already acquired */ - if (bond->current_slave != NULL) - dev_set_allmulti(bond->current_slave->dev, inc); + if (bond->curr_active_slave != NULL) + dev_set_allmulti(bond->curr_active_slave->dev, inc); } else { struct slave *slave; int i; @@ -1196,25 +1196,25 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, struct } if (old_active) { - if (bond->device->flags & IFF_PROMISC) { + if (bond->dev->flags & IFF_PROMISC) { 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); } - 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); } } if (new_active) { - if (bond->device->flags & IFF_PROMISC) { + if (bond->dev->flags & IFF_PROMISC) { 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); } - 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); } } @@ -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 * 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() */ if (!USES_PRIMARY(bond_mode)) { @@ -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 * 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, - * 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. */ - if (((bond->current_slave == NULL) - || (bond->current_slave->dev->flags & IFF_NOARP)) + if (((bond->curr_active_slave == NULL) + || (bond->curr_active_slave->dev->flags & IFF_NOARP)) && (new_slave->link != BOND_LINK_DOWN)) { dprintk("This is the first active slave\n"); /* 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 case BOND_MODE_TLB: case BOND_MODE_ALB: 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 * 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 /* always active in trunk mode */ 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), * so we can change it without calling change_active_interface() */ - if (bond->current_slave == NULL) - bond->current_slave = new_slave; + if (bond->curr_active_slave == NULL) + bond->curr_active_slave = new_slave; break; } /* switch(bond_mode) */ @@ -1615,7 +1615,7 @@ static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_devi 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); /* @@ -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 * @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) { @@ -1651,7 +1651,7 @@ static struct slave *bond_find_best_slave(struct bonding *bond) int mintime; 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 (bond->slave_cnt > 0) { /* found one slave */ @@ -1664,8 +1664,8 @@ static struct slave *bond_find_best_slave(struct bonding *bond) mintime = updelay; /* 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 - * slaves between the current_slave and primary_slave that may be up + * before it can be considered the curr_active_slave - also, we would skip + * slaves between the curr_active_slave and primary_slave that may be up * and able to arp */ if ((bond->primary_slave != NULL) && (arp_interval == 0)) { @@ -1700,18 +1700,18 @@ static struct slave *bond_find_best_slave(struct bonding *bond) * @new: the new slave to make the active one * * 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. * * 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 * 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) { - struct slave *old_active = bond->current_slave; + struct slave *old_active = bond->curr_active_slave; if (old_active == new_active) { return; @@ -1723,7 +1723,7 @@ static void bond_change_active_slave(struct bonding *bond, struct slave *new_act printk(KERN_INFO DRV_NAME ": %s: making interface %s the new " "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); } @@ -1744,7 +1744,7 @@ static void bond_change_active_slave(struct bonding *bond, struct slave *new_act printk(KERN_INFO DRV_NAME ": %s: making interface %s the new " "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 (bond_mode == BOND_MODE_ALB)) { bond_alb_handle_active_change(bond, new_active); } 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 * @bond: our bonding struct * * 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. - * - 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) { @@ -1788,14 +1788,14 @@ static void bond_select_active_slave(struct bonding *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); } } /* * Try to release the slave device from the bond device - * 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. * * 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 return -EINVAL; } - mac_addr_differ = memcmp(bond->device->dev_addr, + mac_addr_differ = memcmp(bond_dev->dev_addr, slave->perm_hwaddr, ETH_ALEN); 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 slave->perm_hwaddr[3], slave->perm_hwaddr[4], slave->perm_hwaddr[5], - bond->device->name, + bond_dev->name, slave_dev->name); } @@ -1876,12 +1876,12 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de bond->primary_slave = NULL; } - if (bond->current_slave == slave) { + if (bond->curr_active_slave == slave) { bond_change_active_slave(bond, NULL); bond_select_active_slave(bond); } - if (bond->current_slave == NULL) { + if (bond->curr_active_slave == NULL) { printk(KERN_INFO DRV_NAME ": %s: now running without any active " "interface !\n", @@ -1891,7 +1891,7 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de if ((bond_mode == BOND_MODE_TLB) || (bond_mode == BOND_MODE_ALB)) { /* 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) */ bond_alb_deinit_slave(bond, slave); @@ -1900,7 +1900,7 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de write_unlock_bh(&bond->lock); /* 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 */ if (!USES_PRIMARY(bond_mode)) { @@ -1996,7 +1996,7 @@ static int bond_release_all(struct net_device *bond_dev) write_unlock_bh(&bond->lock); /* 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 */ if (!USES_PRIMARY(bond_mode)) { @@ -2079,9 +2079,9 @@ static void bond_mii_monitor(struct net_device *bond_dev) * program could monitor the link itself if needed. */ - read_lock(&bond->ptrlock); - oldcurrent = bond->current_slave; - read_unlock(&bond->ptrlock); + read_lock(&bond->curr_slave_lock); + oldcurrent = bond->curr_active_slave; + read_unlock(&bond->curr_slave_lock); bond_for_each_slave(bond, slave, i) { struct net_device *slave_dev = slave->dev; @@ -2266,17 +2266,17 @@ static void bond_mii_monitor(struct net_device *bond_dev) } /* end of for */ if (do_failover) { - write_lock(&bond->ptrlock); + write_lock(&bond->curr_slave_lock); bond_select_active_slave(bond); - if (oldcurrent && !bond->current_slave) { + 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->ptrlock); + write_unlock(&bond->curr_slave_lock); } re_arm: @@ -2310,12 +2310,12 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) goto re_arm; } - read_lock(&bond->ptrlock); - oldcurrent = bond->current_slave; - read_unlock(&bond->ptrlock); + 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 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 * 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. @@ -2336,7 +2336,7 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) /* primary_slave has no meaning in round-robin * mode. the window of a slave being up and - * current_slave being null after enslaving + * curr_active_slave being null after enslaving * is closed. */ if (oldcurrent == NULL) { @@ -2393,17 +2393,17 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) } if (do_failover) { - write_lock(&bond->ptrlock); + write_lock(&bond->curr_slave_lock); bond_select_active_slave(bond); - if (oldcurrent && !bond->current_slave) { + 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->ptrlock); + write_unlock(&bond->curr_slave_lock); } re_arm: @@ -2456,13 +2456,13 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) delta_in_ticks) { slave->link = BOND_LINK_UP; - write_lock(&bond->ptrlock); - if ((bond->current_slave == NULL) && + write_lock(&bond->curr_slave_lock); + if ((bond->curr_active_slave == NULL) && ((jiffies - slave->dev->trans_start) <= delta_in_ticks)) { bond_change_active_slave(bond, slave); 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 * already have a current slave; this * can also happen if bond_enslave adds @@ -2473,7 +2473,7 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) bond->current_arp_slave = NULL; } - if (slave == bond->current_slave) { + if (slave == bond->curr_active_slave) { printk(KERN_INFO DRV_NAME ": %s: %s is up and now the " "active interface\n", @@ -2487,11 +2487,11 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) slave->dev->name); } - write_unlock(&bond->ptrlock); + write_unlock(&bond->curr_slave_lock); } } else { - read_lock(&bond->ptrlock); - if ((slave != bond->current_slave) && + read_lock(&bond->curr_slave_lock); + if ((slave != bond->curr_active_slave) && (bond->current_arp_slave == NULL) && (((jiffies - slave->dev->last_rx) >= 3*delta_in_ticks) && (my_ip != 0))) { @@ -2499,13 +2499,13 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) * the delta allows the current slave to be * taken out before the backup slave. * 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 - * condition we only take the current_slave + * condition we only take the curr_active_slave * down - this gives each slave a chance to * tx/rx traffic before being taken out */ - read_unlock(&bond->ptrlock); + read_unlock(&bond->curr_slave_lock); slave->link = BOND_LINK_DOWN; if (slave->link_failure_count < UINT_MAX) { slave->link_failure_count++; @@ -2516,24 +2516,24 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) bond_dev->name, slave->dev->name); } else { - read_unlock(&bond->ptrlock); + read_unlock(&bond->curr_slave_lock); } } } - read_lock(&bond->ptrlock); - slave = bond->current_slave; - read_unlock(&bond->ptrlock); + read_lock(&bond->curr_slave_lock); + slave = bond->curr_active_slave; + read_unlock(&bond->curr_slave_lock); if (slave != NULL) { /* if we have sent traffic in the past 2*arp_intervals but * haven't xmit and rx traffic in that time interval, select * 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 * 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) >= (2*delta_in_ticks)) || @@ -2550,10 +2550,10 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) "%s, disabling it", bond_dev->name, slave->dev->name); - write_lock(&bond->ptrlock); + write_lock(&bond->curr_slave_lock); bond_select_active_slave(bond); - slave = bond->current_slave; - write_unlock(&bond->ptrlock); + slave = bond->curr_active_slave; + write_unlock(&bond->curr_slave_lock); bond->current_arp_slave = slave; if (slave != NULL) { slave->jiffies = jiffies; @@ -2562,7 +2562,7 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) } else if ((bond->primary_slave != NULL) && (bond->primary_slave != slave) && (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 ": %s: changing from interface %s to primary " "interface %s\n", @@ -2571,9 +2571,9 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) bond->primary_slave->dev->name); /* 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); - write_unlock(&bond->ptrlock); + write_unlock(&bond->curr_slave_lock); slave = bond->primary_slave; slave->jiffies = jiffies; } else { @@ -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 - * for becoming the current_slave + * for becoming the curr_active_slave */ if (slave == NULL) { @@ -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; mii->val_out = 0; read_lock_bh(&bond->lock); - read_lock(&bond->ptrlock); - if (bond->current_slave) { + read_lock(&bond->curr_slave_lock); + if (bond->curr_active_slave) { mii->val_out = BMSR_LSTATUS; } - read_unlock(&bond->ptrlock); + read_unlock(&bond->curr_slave_lock); read_unlock_bh(&bond->lock); } return 0; @@ -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->ptrlock); - start_at = bond->current_slave; - read_unlock(&bond->ptrlock); + read_lock(&bond->curr_slave_lock); + start_at = bond->curr_active_slave; + read_unlock(&bond->curr_slave_lock); if (start_at == NULL) { /* we're at the root, get the first slave */ /* no suitable interface, frame not sent */ @@ -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->ptrlock); - slave = start_at = bond->current_slave; - read_unlock(&bond->ptrlock); + read_lock(&bond->curr_slave_lock); + slave = start_at = bond->curr_active_slave; + read_unlock(&bond->curr_slave_lock); if (slave == NULL) { /* we're at the root, get the first slave */ /* no suitable interface, frame not sent */ @@ -2989,9 +2989,9 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev skb->priority = 1; dev_queue_xmit(skb); - write_lock(&bond->ptrlock); - bond->current_slave = slave->next; - write_unlock(&bond->ptrlock); + write_lock(&bond->curr_slave_lock); + bond->curr_active_slave = slave->next; + write_unlock(&bond->curr_slave_lock); read_unlock(&bond->lock); return 0; @@ -3031,7 +3031,7 @@ static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev) 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) { slave_no--; @@ -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. */ 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 read_lock(&bond->lock); - read_lock(&bond->ptrlock); - if (bond->current_slave != NULL) { /* one usable interface */ - skb->dev = bond->current_slave->dev; - read_unlock(&bond->ptrlock); + read_lock(&bond->curr_slave_lock); + if (bond->curr_active_slave != NULL) { /* one usable interface */ + skb->dev = bond->curr_active_slave->dev; + read_unlock(&bond->curr_slave_lock); skb->priority = 1; ret = dev_queue_xmit(skb); read_unlock(&bond->lock); return 0; } else { - read_unlock(&bond->ptrlock); + read_unlock(&bond->curr_slave_lock); } /* no suitable interface, frame not sent */ @@ -3210,9 +3210,9 @@ static void bond_info_show_master(struct seq_file *seq, struct bonding *bond) { struct slave *curr; - read_lock(&bond->ptrlock); - curr = bond->current_slave; - read_unlock(&bond->ptrlock); + read_lock(&bond->curr_slave_lock); + curr = bond->curr_active_slave; + read_unlock(&bond->curr_slave_lock); 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) if (bond_3ad_get_active_agg_info(bond, &ad_info)) { seq_printf(seq, "bond %s has no active aggregator\n", - bond->device->name); + bond->dev->name); } else { seq_printf(seq, "Active Aggregator Info:\n"); @@ -3336,21 +3336,21 @@ static struct file_operations bond_info_fops = { 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) { - bond->bond_proc_file = create_proc_entry(bond_dev->name, - S_IRUGO, - bond_proc_dir); - if (bond->bond_proc_file == NULL) { + bond->proc_entry = create_proc_entry(bond_dev->name, + S_IRUGO, + bond_proc_dir); + if (bond->proc_entry == NULL) { printk(KERN_WARNING DRV_NAME ": Warning: Cannot create /proc/net/bonding/%s\n", bond_dev->name); } else { - bond->bond_proc_file->data = bond; - bond->bond_proc_file->proc_fops = &bond_info_fops; - bond->bond_proc_file->owner = THIS_MODULE; - memcpy(bond->procdir_name, bond_dev->name, IFNAMSIZ); + bond->proc_entry->data = bond; + bond->proc_entry->proc_fops = &bond_info_fops; + bond->proc_entry->owner = THIS_MODULE; + memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ); } } @@ -3359,10 +3359,10 @@ static int bond_create_proc_entry(struct bonding *bond) static void bond_remove_proc_entry(struct bonding *bond) { - if (bond_proc_dir && bond->bond_proc_file) { - remove_proc_entry(bond->procdir_name, bond_proc_dir); - memset(bond->procdir_name, 0, IFNAMSIZ); - bond->bond_proc_file = NULL; + if (bond_proc_dir && bond->proc_entry) { + remove_proc_entry(bond->proc_file_name, bond_proc_dir); + memset(bond->proc_file_name, 0, IFNAMSIZ); + bond->proc_entry = NULL; } } @@ -3708,7 +3708,7 @@ static void bond_free_all(void) struct bonding *bond, *nxt; 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); bond_deinit(bond_dev); @@ -3732,14 +3732,14 @@ static int __init bond_init(struct net_device *bond_dev) /* initialize rwlocks */ rwlock_init(&bond->lock); - rwlock_init(&bond->ptrlock); + rwlock_init(&bond->curr_slave_lock); /* Initialize pointers */ bond->first_slave = NULL; - bond->current_slave = NULL; + bond->curr_active_slave = NULL; bond->current_arp_slave = NULL; bond->primary_slave = NULL; - bond->device = bond_dev; + bond->dev = bond_dev; /* Initialize the device structure. */ bond_dev->set_mac_address = bond_set_mac_address; diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index d4b2a7ce518f..b144340fd20d 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h @@ -62,15 +62,15 @@ struct slave { + struct net_device *dev; /* first - usefull for panic debug */ struct slave *next; struct slave *prev; - struct net_device *dev; - short delay; - unsigned long jiffies; - char link; /* one of BOND_LINK_XXXX */ - char state; /* one of BOND_STATE_XXXX */ - unsigned short original_flags; - u32 link_failure_count; + s16 delay; + u32 jiffies; + s8 link; /* one of BOND_LINK_XXXX */ + s8 state; /* one of BOND_STATE_XXXX */ + u32 original_flags; + u32 link_failure_count; u16 speed; u8 duplex; u8 perm_hwaddr[ETH_ALEN]; @@ -82,33 +82,33 @@ struct slave { * Here are the locking policies for the two bonding locks: * * 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.) - * 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. */ struct bonding { - struct slave *first_slave; - struct slave *current_slave; - struct slave *primary_slave; - struct slave *current_arp_slave; - int slave_cnt; /* never change this value outside the attach/detach wrappers */ + struct net_device *dev; /* first - usefull for panic debug */ + struct slave *first_slave; + struct slave *curr_active_slave; + struct slave *current_arp_slave; + struct slave *primary_slave; + s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ rwlock_t lock; - rwlock_t ptrlock; - struct timer_list mii_timer; - struct timer_list arp_timer; - int kill_timers; - struct net_device_stats stats; + rwlock_t curr_slave_lock; + struct timer_list mii_timer; + struct timer_list arp_timer; + s8 kill_timers; + struct net_device_stats stats; #ifdef CONFIG_PROC_FS - struct proc_dir_entry *bond_proc_file; - char procdir_name[IFNAMSIZ]; + struct proc_dir_entry *proc_entry; + char proc_file_name[IFNAMSIZ]; #endif /* CONFIG_PROC_FS */ - struct list_head bond_list; - struct net_device *device; - struct dev_mc_list *mc_list; - unsigned short flags; - struct ad_bond_info ad_info; - struct alb_bond_info alb_info; + struct list_head bond_list; + struct dev_mc_list *mc_list; + u16 flags; + struct ad_bond_info ad_info; + struct alb_bond_info alb_info; }; /** diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h index 3b129d9f3ee1..a1ade4ff0f8c 100644 --- a/include/linux/if_bonding.h +++ b/include/linux/if_bonding.h @@ -86,9 +86,9 @@ typedef struct ifbond { typedef struct ifslave { __s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */ - char slave_name[IFNAMSIZ]; - char link; - char state; + __s8 slave_name[IFNAMSIZ]; + __s8 link; + __s8 state; __u32 link_failure_count; } ifslave; -- cgit v1.2.3 From ec5efa9d938803c9b7dbe1dad7318c1b25a38aa4 Mon Sep 17 00:00:00 2001 From: Shmulik Hen Date: Sat, 10 Jan 2004 06:32:00 -0500 Subject: [PATCH] bonding cleanup 2.6 - Whitespace cleanup Chomp all trailing white space. --- Documentation/networking/bonding.txt | 182 ++++++++--------- drivers/net/bonding/bond_alb.c | 2 +- drivers/net/bonding/bond_main.c | 380 +++++++++++++++++------------------ drivers/net/bonding/bonding.h | 6 +- include/linux/if_bonding.h | 6 +- 5 files changed, 288 insertions(+), 288 deletions(-) (limited to 'include/linux') diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index d9427122e192..372b6f5c181b 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt @@ -21,7 +21,7 @@ userspace tools, please follow the links at the end of this file. Table of Contents ================= - + Installation Bond Configuration Module Parameters @@ -66,7 +66,7 @@ of the -I option on the ifenslave compile line is to make sure it uses /usr/include/linux. To install ifenslave.c, do: - # gcc -Wall -Wstrict-prototypes -O -I/usr/src/linux/include ifenslave.c -o ifenslave + # gcc -Wall -Wstrict-prototypes -O -I/usr/src/linux/include ifenslave.c -o ifenslave # cp ifenslave /sbin/ifenslave @@ -74,10 +74,10 @@ Bond Configuration ================== You will need to add at least the following line to /etc/modules.conf -so the bonding driver will automatically load when the bond0 interface is -configured. Refer to the modules.conf manual page for specific modules.conf -syntax details. The Module Parameters section of this document describes each -bonding driver parameter. +so the bonding driver will automatically load when the bond0 interface is +configured. Refer to the modules.conf manual page for specific modules.conf +syntax details. The Module Parameters section of this document describes each +bonding driver parameter. alias bond0 bonding @@ -113,7 +113,7 @@ bonding interface (bond1), use MASTER=bond1 in the config file to make the network interface be a slave of bond1. Restart the networking subsystem or just bring up the bonding device if your -administration tools allow it. Otherwise, reboot. On Red Hat distros you can +administration tools allow it. Otherwise, reboot. On Red Hat distros you can issue `ifup bond0' or `/etc/rc.d/init.d/network restart'. If the administration tools of your distribution do not support @@ -128,30 +128,30 @@ manually configure the bonding device with the following commands: (use appropriate values for your network above) -You can then create a script containing these commands and place it in the +You can then create a script containing these commands and place it in the appropriate rc directory. If you specifically need all network drivers loaded before the bonding driver, -adding the following line to modules.conf will cause the network driver for +adding the following line to modules.conf will cause the network driver for eth0 and eth1 to be loaded before the bonding driver. probeall bond0 eth0 eth1 bonding -Be careful not to reference bond0 itself at the end of the line, or modprobe +Be careful not to reference bond0 itself at the end of the line, or modprobe will die in an endless recursive loop. -To have device characteristics (such as MTU size) propagate to slave devices, -set the bond characteristics before enslaving the device. The characteristics +To have device characteristics (such as MTU size) propagate to slave devices, +set the bond characteristics before enslaving the device. The characteristics are propagated during the enslave process. -If running SNMP agents, the bonding driver should be loaded before any network -drivers participating in a bond. This requirement is due to the the interface -index (ipAdEntIfIndex) being associated to the first interface found with a -given IP address. That is, there is only one ipAdEntIfIndex for each IP -address. For example, if eth0 and eth1 are slaves of bond0 and the driver for -eth0 is loaded before the bonding driver, the interface for the IP address -will be associated with the eth0 interface. This configuration is shown below, -the IP address 192.168.1.1 has an interface index of 2 which indexes to eth0 +If running SNMP agents, the bonding driver should be loaded before any network +drivers participating in a bond. This requirement is due to the the interface +index (ipAdEntIfIndex) being associated to the first interface found with a +given IP address. That is, there is only one ipAdEntIfIndex for each IP +address. For example, if eth0 and eth1 are slaves of bond0 and the driver for +eth0 is loaded before the bonding driver, the interface for the IP address +will be associated with the eth0 interface. This configuration is shown below, +the IP address 192.168.1.1 has an interface index of 2 which indexes to eth0 in the ifDescr table (ifDescr.2). interfaces.ifTable.ifEntry.ifDescr.1 = lo @@ -189,10 +189,10 @@ functions such as Interface_Scan_Next will report that association. Module Parameters ================= -Optional parameters for the bonding driver can be supplied as command line -arguments to the insmod command. Typically, these parameters are specified in -the file /etc/modules.conf (see the manual page for modules.conf). The -available bonding driver parameters are listed below. If a parameter is not +Optional parameters for the bonding driver can be supplied as command line +arguments to the insmod command. Typically, these parameters are specified in +the file /etc/modules.conf (see the manual page for modules.conf). The +available bonding driver parameters are listed below. If a parameter is not specified the default value is used. When initially configuring a bond, it is recommended "tail -f /var/log/messages" be run in a separate window to watch for bonding driver error messages. @@ -202,19 +202,19 @@ parameters be specified, otherwise serious network degradation will occur during link failures. arp_interval - - Specifies the ARP monitoring frequency in milli-seconds. - If ARP monitoring is used in a load-balancing mode (mode 0 or 2), the - switch should be configured in a mode that evenly distributes packets - across all links - such as round-robin. If the switch is configured to - distribute the packets in an XOR fashion, all replies from the ARP - targets will be received on the same link which could cause the other + + Specifies the ARP monitoring frequency in milli-seconds. + If ARP monitoring is used in a load-balancing mode (mode 0 or 2), the + switch should be configured in a mode that evenly distributes packets + across all links - such as round-robin. If the switch is configured to + distribute the packets in an XOR fashion, all replies from the ARP + targets will be received on the same link which could cause the other team members to fail. ARP monitoring should not be used in conjunction - with miimon. A value of 0 disables ARP monitoring. The default value + with miimon. A value of 0 disables ARP monitoring. The default value is 0. - + arp_ip_target - + Specifies the ip addresses to use when arp_interval is > 0. These are the targets of the ARP request sent to determine the health of the link to the targets. Specify these values in ddd.ddd.ddd.ddd @@ -223,8 +223,8 @@ arp_ip_target maximum number of targets that can be specified is set at 16. downdelay - - Specifies the delay time in milli-seconds to disable a link after a + + Specifies the delay time in milli-seconds to disable a link after a link failure has been detected. This should be a multiple of miimon value, otherwise the value will be rounded. The default value is 0. @@ -247,7 +247,7 @@ max_bonds and bond2 will be created. The default value is 1. miimon - + Specifies the frequency in milli-seconds that MII link monitoring will occur. A value of zero disables MII link monitoring. A value of 100 is a good starting point. See High Availability section for @@ -258,7 +258,7 @@ mode Specifies one of the bonding policies. The default is round-robin (balance-rr). Possible values are (you can use either the text or numeric option): - + balance-rr or 0 Round-robin policy: Transmit in a sequential order @@ -273,7 +273,7 @@ mode externally visible on only one port (network adapter) to avoid confusing the switch. This mode provides fault tolerance. - + balance-xor or 2 XOR policy: Transmit based on [(source MAC address @@ -293,7 +293,7 @@ mode groups that share the same speed and duplex settings. Transmits and receives on all slaves in the active aggregator. - + Pre-requisites: 1. Ethtool support in the base drivers for retrieving the @@ -317,7 +317,7 @@ mode Ethtool support in the base drivers for retrieving the speed of each slave. - balance-alb or 6 + balance-alb or 6 Adaptive load balancing: includes balance-tlb + receive load balancing (rlb) for IPV4 traffic and does not require @@ -327,7 +327,7 @@ mode overwrites the src hw address with the unique hw address of one of the slaves in the bond such that different clients use different hw addresses for the server. - + Receive traffic from connections created by the server is also balanced. When the server sends an ARP Request the bonding driver copies and saves the client's IP information @@ -383,11 +383,11 @@ primary primary is only valid in active-backup mode. updelay - - Specifies the delay time in milli-seconds to enable a link after a + + Specifies the delay time in milli-seconds to enable a link after a link up status has been detected. This should be a multiple of miimon value, otherwise the value will be rounded. The default value is 0. - + use_carrier Specifies whether or not miimon should use MII or ETHTOOL @@ -515,20 +515,20 @@ Verifying Bond Configuration ---------------------------- The bonding driver information files reside in the /proc/net/bonding directory. -Sample contents of /proc/net/bonding/bond0 after the driver is loaded with +Sample contents of /proc/net/bonding/bond0 after the driver is loaded with parameters of mode=0 and miimon=1000 is shown below. - + Bonding Mode: load balancing (round-robin) Currently Active Slave: eth0 MII Status: up MII Polling Interval (ms): 1000 Up Delay (ms): 0 Down Delay (ms): 0 - + Slave Interface: eth1 MII Status: up Link Failure Count: 1 - + Slave Interface: eth0 MII Status: up Link Failure Count: 1 @@ -536,34 +536,34 @@ parameters of mode=0 and miimon=1000 is shown below. 2) Network verification ----------------------- The network configuration can be verified using the ifconfig command. In -the example below, the bond0 interface is the master (MASTER) while eth0 and -eth1 are slaves (SLAVE). Notice all slaves of bond0 have the same MAC address +the example below, the bond0 interface is the master (MASTER) while eth0 and +eth1 are slaves (SLAVE). Notice all slaves of bond0 have the same MAC address (HWaddr) as bond0 for all modes except TLB and ALB that require a unique MAC address for each slave. [root]# /sbin/ifconfig -bond0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4 +bond0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4 inet addr:XXX.XXX.XXX.YYY Bcast:XXX.XXX.XXX.255 Mask:255.255.252.0 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:7224794 errors:0 dropped:0 overruns:0 frame:0 TX packets:3286647 errors:1 dropped:0 overruns:1 carrier:0 - collisions:0 txqueuelen:0 + collisions:0 txqueuelen:0 -eth0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4 +eth0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4 inet addr:XXX.XXX.XXX.YYY Bcast:XXX.XXX.XXX.255 Mask:255.255.252.0 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:3573025 errors:0 dropped:0 overruns:0 frame:0 TX packets:1643167 errors:1 dropped:0 overruns:1 carrier:0 - collisions:0 txqueuelen:100 - Interrupt:10 Base address:0x1080 + collisions:0 txqueuelen:100 + Interrupt:10 Base address:0x1080 -eth1 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4 +eth1 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4 inet addr:XXX.XXX.XXX.YYY Bcast:XXX.XXX.XXX.255 Mask:255.255.252.0 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:3651769 errors:0 dropped:0 overruns:0 frame:0 TX packets:1643480 errors:0 dropped:0 overruns:0 carrier:0 - collisions:0 txqueuelen:100 - Interrupt:9 Base address:0x1400 + collisions:0 txqueuelen:100 + Interrupt:9 Base address:0x1400 Frequently Asked Questions @@ -591,9 +591,9 @@ Frequently Asked Questions 5. What happens when a slave link dies? - If your ethernet cards support MII or ETHTOOL link status monitoring - and the MII monitoring has been enabled in the driver (see description - of module parameters), there will be no adverse consequences. This + If your ethernet cards support MII or ETHTOOL link status monitoring + and the MII monitoring has been enabled in the driver (see description + of module parameters), there will be no adverse consequences. This release of the bonding driver knows how to get the MII information and enables or disables its slaves according to their link status. See section on High Availability for additional information. @@ -608,8 +608,8 @@ Frequently Asked Questions slave. If neither mii_monitor and arp_interval is configured, the bonding - driver will not handle this situation very well. The driver will - continue to send packets but some packets will be lost. Retransmits + driver will not handle this situation very well. The driver will + continue to send packets but some packets will be lost. Retransmits will cause serious degradation of performance (in the case when one of two slave links fails, 50% packets will be lost, which is a serious problem for both TCP and UDP). @@ -622,9 +622,9 @@ Frequently Asked Questions 7. Which switches/systems does it work with? - In round-robin and XOR mode, it works with systems that support + In round-robin and XOR mode, it works with systems that support trunking: - + * Many Cisco switches and routers (look for EtherChannel support). * SunTrunking software. * Alteon AceDirector switches / WebOS (use Trunks). @@ -632,7 +632,7 @@ Frequently Asked Questions models (450) can define trunks between ports on different physical units. * Linux bonding, of course ! - + In 802.3ad mode, it works with with systems that support IEEE 802.3ad Dynamic Link Aggregation: @@ -653,21 +653,21 @@ Frequently Asked Questions is then passed to all following slaves and remains persistent (even if the the first slave is removed) until the bonding device is brought down or reconfigured. - + If you wish to change the MAC address, you can set it with ifconfig: # ifconfig bond0 hw ether 00:11:22:33:44:55 The MAC address can be also changed by bringing down/up the device and then changing its slaves (or their order): - + # ifconfig bond0 down ; modprobe -r bonding # ifconfig bond0 .... up # ifenslave bond0 eth... This method will automatically take the address from the next slave that will be added. - + To restore your slaves' MAC addresses, you need to detach them from the bond (`ifenslave -d bond0 eth0'), set them down (`ifconfig eth0 down'), unload the drivers (`rmmod 3c59x', for @@ -715,27 +715,27 @@ High Availability ================= To implement high availability using the bonding driver, the driver needs to be -compiled as a module, because currently it is the only way to pass parameters +compiled as a module, because currently it is the only way to pass parameters to the driver. This may change in the future. -High availability is achieved by using MII or ETHTOOL status reporting. You -need to verify that all your interfaces support MII or ETHTOOL link status -reporting. On Linux kernel 2.2.17, all the 100 Mbps capable drivers and -yellowfin gigabit driver support MII. To determine if ETHTOOL link reporting -is available for interface eth0, type "ethtool eth0" and the "Link detected:" -line should contain the correct link status. If your system has an interface -that does not support MII or ETHTOOL status reporting, a failure of its link -will not be detected! A message indicating MII and ETHTOOL is not supported by -a network driver is logged when the bonding driver is loaded with a non-zero +High availability is achieved by using MII or ETHTOOL status reporting. You +need to verify that all your interfaces support MII or ETHTOOL link status +reporting. On Linux kernel 2.2.17, all the 100 Mbps capable drivers and +yellowfin gigabit driver support MII. To determine if ETHTOOL link reporting +is available for interface eth0, type "ethtool eth0" and the "Link detected:" +line should contain the correct link status. If your system has an interface +that does not support MII or ETHTOOL status reporting, a failure of its link +will not be detected! A message indicating MII and ETHTOOL is not supported by +a network driver is logged when the bonding driver is loaded with a non-zero miimon value. The bonding driver can regularly check all its slaves links using the ETHTOOL -IOCTL (ETHTOOL_GLINK command) or by checking the MII status registers. The -check interval is specified by the module argument "miimon" (MII monitoring). -It takes an integer that represents the checking time in milliseconds. It -should not come to close to (1000/HZ) (10 milli-seconds on i386) because it -may then reduce the system interactivity. A value of 100 seems to be a good -starting point. It means that a dead link will be detected at most 100 +IOCTL (ETHTOOL_GLINK command) or by checking the MII status registers. The +check interval is specified by the module argument "miimon" (MII monitoring). +It takes an integer that represents the checking time in milliseconds. It +should not come to close to (1000/HZ) (10 milli-seconds on i386) because it +may then reduce the system interactivity. A value of 100 seems to be a good +starting point. It means that a dead link will be detected at most 100 milli-seconds after it goes down. Example: @@ -747,7 +747,7 @@ Or, put the following lines in /etc/modules.conf: alias bond0 bonding options bond0 miimon=100 -There are currently two policies for high availability. They are dependent on +There are currently two policies for high availability. They are dependent on whether: a) hosts are connected to a single host or switch that support trunking @@ -797,7 +797,7 @@ Example 2 : host to switch at twice the speed # ifenslave bond0 eth0 eth1 -2) High Availability on two or more switches (or a single switch without +2) High Availability on two or more switches (or a single switch without trunking support) --------------------------------------------------------------------------- This mode is more problematic because it relies on the fact that there @@ -856,10 +856,10 @@ by another external mechanism, it is good to have host1's active interface connected to one switch and host2's to the other. Such system will survive a failure of a single host, cable, or switch. The worst thing that may happen in the case of a switch failure is that half of the hosts will be temporarily -unreachable until the other switch expires its tables. +unreachable until the other switch expires its tables. Example 2: Using multiple ethernet cards connected to a switch to configure - NIC failover (switch is not required to support trunking). + NIC failover (switch is not required to support trunking). +----------+ +----------+ @@ -943,7 +943,7 @@ The main limitations are : servers, but may be useful when the front switches send multicast information on their links (e.g. VRRP), or even health-check the servers. Use the arp_interval/arp_ip_target parameters to count incoming/outgoing - frames. + frames. diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 47d179cca21a..6d55ab841ee9 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c @@ -1060,7 +1060,7 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav * * For each slave, this function sets the interface to the new address and then * changes its dev_addr field to its previous value. - * + * * Unwinding assumes bond's mac address has not yet changed. */ static int alb_set_mac_address(struct bonding *bond, void *addr) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 9968fd032c18..231696eaa911 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1,7 +1,7 @@ /* * originally based on the dummy device. * - * Copyright 1999, Thomas Davis, tadavis@lbl.gov. + * Copyright 1999, Thomas Davis, tadavis@lbl.gov. * Licensed under the GPL. Based on dummy.c, and eql.c devices. * * bonding.c: an Ethernet Bonding driver @@ -15,9 +15,9 @@ * * How it works: * ifconfig bond0 ipaddress netmask up - * will setup a network device, with an ip address. No mac address - * will be assigned at this time. The hw mac address will come from - * the first slave bonded to the channel. All slaves will then use + * will setup a network device, with an ip address. No mac address + * will be assigned at this time. The hw mac address will come from + * the first slave bonded to the channel. All slaves will then use * this hw mac address. * * ifconfig bond0 down @@ -26,7 +26,7 @@ * ifenslave bond0 eth0 * will attach eth0 to bond0 as a slave. eth0 hw mac address will either * a: be used as initial mac address - * b: if a hw mac address already is there, eth0's hw mac address + * b: if a hw mac address already is there, eth0's hw mac address * will then be set from bond0. * * v0.1 - first working version. @@ -93,14 +93,14 @@ * * 2001/4/5 - Chad N. Tindel * - Ported to 2.4 Kernel - * + * * 2001/5/2 - Jeffrey E. Mast * - When a device is detached from a bond, the slave device is no longer * left thinking that is has a master. * * 2001/5/16 - Jeffrey E. Mast - * - memset did not appropriately initialized the bond rw_locks. Used - * rwlock_init to initialize to unlocked state to prevent deadlock when + * - memset did not appropriately initialized the bond rw_locks. Used + * rwlock_init to initialize to unlocked state to prevent deadlock when * first attempting a lock * - Called SET_MODULE_OWNER for bond device * @@ -119,7 +119,7 @@ * * 2001/6/01 - Chad N. Tindel * - Added /proc support for getting bond and slave information. - * Information is in /proc/net//info. + * Information is in /proc/net//info. * - Changed the locking when calling bond_close to prevent deadlock. * * 2001/8/05 - Janice Girouard @@ -144,8 +144,8 @@ * but only for an up link. * * 2001/9/20 - Chad N. Tindel - * - Add the device field to bonding_t. Previously the net_device - * corresponding to a bond wasn't available from the bonding_t + * - Add the device field to bonding_t. Previously the net_device + * corresponding to a bond wasn't available from the bonding_t * structure. * * 2001/9/25 - Janice Girouard @@ -155,10 +155,10 @@ * - Various memory leak fixes * * 2001/11/5 - Mark Huth - * - Don't take rtnl lock in bond_mii_monitor as it deadlocks under - * certain hotswap conditions. + * - Don't take rtnl lock in bond_mii_monitor as it deadlocks under + * certain hotswap conditions. * Note: this same change may be required in bond_arp_monitor ??? - * - Remove possibility of calling bond_sethwaddr with NULL slave_dev ptr + * - Remove possibility of calling bond_sethwaddr with NULL slave_dev ptr * - Handle hot swap ethernet interface deregistration events to remove * kernel oops following hot swap of enslaved interface * @@ -222,23 +222,23 @@ * - fix deletion of multicast groups after unloading module * * 2002/11/06 - Kameshwara Rayaprolu - * - Changes to prevent panic from closing the device twice; if we close - * the device in bond_release, we must set the original_flags to down + * - Changes to prevent panic from closing the device twice; if we close + * the device in bond_release, we must set the original_flags to down * so it won't be closed again by the network layer. * * 2002/11/07 - Tony Cureington * - Fix arp_target_hw_addr memory leak - * - Created activebackup_arp_monitor function to handle arp monitoring - * in active backup mode - the bond_arp_monitor had several problems... - * such as allowing slaves to tx arps sequentially without any delay + * - Created activebackup_arp_monitor function to handle arp monitoring + * in active backup mode - the bond_arp_monitor had several problems... + * such as allowing slaves to tx arps sequentially without any delay * for a response * - Renamed bond_arp_monitor to loadbalance_arp_monitor and re-wrote * this function to just handle arp monitoring in load-balancing mode; * it is a lot more compact now - * - Changes to ensure one and only one slave transmits in active-backup + * - Changes to ensure one and only one slave transmits in active-backup * mode - * - Robustesize parameters; warn users about bad combinations of - * parameters; also if miimon is specified and a network driver does + * - Robustesize parameters; warn users about bad combinations of + * parameters; also if miimon is specified and a network driver does * not support MII or ETHTOOL, inform the user of this * - Changes to support link_failure_count when in arp monitoring mode * - Fix up/down delay reported in /proc @@ -248,7 +248,7 @@ * * 2002/11/16 - Laurent Deniel * - fix multicast handling in activebackup_arp_monitor - * - remove one unnecessary and confusing curr_active_slave == slave test + * - remove one unnecessary and confusing curr_active_slave == slave test * in activebackup_arp_monitor * * 2002/11/17 - Laurent Deniel @@ -267,7 +267,7 @@ * One change: an invalid choice will cause module load failure, * rather than the previous behavior of just picking one. * - Minor cleanups; got rid of dup ctype stuff, atoi function - * + * * 2003/02/07 - Jay Vosburgh * - Added use_carrier module parameter that causes miimon to * use netif_carrier_ok() test instead of MII/ETHTOOL ioctls. @@ -598,16 +598,16 @@ static struct slave *bond_find_best_slave(struct bonding *bond); static void bond_arp_send_all(struct slave *slave) -{ - int i; +{ + int i; - for (i = 0; (idev, + for (i = 0; (idev, my_ip, NULL, slave->dev->dev_addr, - NULL); - } + NULL); + } } - + static const char *bond_mode_name(void) { @@ -643,7 +643,7 @@ void bond_set_slave_active_flags(struct slave *slave) slave->dev->flags &= ~IFF_NOARP; } -/* +/* * This function detaches the slave from the list. * WARNING: no check is made to verify if the slave effectively * belongs to . @@ -764,7 +764,7 @@ err_out: return -1; } -/* +/* * if supports MII link status reporting, check its link status. * * We either do MII/ETHTOOL ioctls, or check netif_carrier_ok(), @@ -822,14 +822,14 @@ static int bond_check_dev_link(struct net_device *slave_dev, int reporting) if (IOCTL(slave_dev, &ifr, SIOCETHTOOL) == 0) { if (etool.data == 1) { return BMSR_LSTATUS; - } else { + } else { dprintk("SIOCETHTOOL shows link down\n"); return 0; - } + } } } - + /* * If reporting, report that either there's no dev->do_ioctl, * or both SIOCGMIIREG and SIOCETHTOOL failed (meaning that we @@ -976,13 +976,13 @@ static int bond_close(struct net_device *bond_dev) return 0; } -/* +/* * flush all members of flush->mc_list from device dev->mc_list */ static void bond_mc_list_flush(struct net_device *slave_dev, struct net_device *bond_dev) -{ - struct dev_mc_list *dmi; - +{ + struct dev_mc_list *dmi; + for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) { dev_mc_delete(slave_dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); } @@ -1002,11 +1002,11 @@ static void bond_mc_list_destroy(struct bonding *bond) { struct dev_mc_list *dmi; - dmi = bond->mc_list; - while (dmi) { - bond->mc_list = dmi->next; - kfree(dmi); - dmi = bond->mc_list; + dmi = bond->mc_list; + while (dmi) { + bond->mc_list = dmi->next; + kfree(dmi); + dmi = bond->mc_list; } } @@ -1015,40 +1015,40 @@ static void bond_mc_list_destroy(struct bonding *bond) * according to mode */ static void bond_mc_add(struct bonding *bond, void *addr, int alen) -{ +{ if (USES_PRIMARY(bond_mode)) { /* write lock already acquired */ if (bond->curr_active_slave) { dev_mc_add(bond->curr_active_slave->dev, addr, alen, 0); } - } else { + } else { struct slave *slave; int i; bond_for_each_slave(bond, slave, i) { dev_mc_add(slave->dev, addr, alen, 0); } } -} +} /* * Remove a multicast address from slave * according to mode */ static void bond_mc_delete(struct bonding *bond, void *addr, int alen) -{ +{ if (USES_PRIMARY(bond_mode)) { /* write lock already acquired */ if (bond->curr_active_slave) { dev_mc_delete(bond->curr_active_slave->dev, addr, alen, 0); } - } else { + } else { struct slave *slave; int i; bond_for_each_slave(bond, slave, i) { dev_mc_delete(slave->dev, addr, alen, 0); } } -} +} /* * Copy all the Multicast addresses from src to the bonding device dst @@ -1057,22 +1057,22 @@ static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond, { struct dev_mc_list *dmi, *new_dmi; - for (dmi = mc_list; dmi; dmi = dmi->next) { + for (dmi = mc_list; dmi; dmi = dmi->next) { new_dmi = kmalloc(sizeof(struct dev_mc_list), gpf_flag); if (!new_dmi) { /* FIXME: Potential memory leak !!! */ - return -ENOMEM; + return -ENOMEM; } - new_dmi->next = bond->mc_list; + new_dmi->next = bond->mc_list; bond->mc_list = new_dmi; - new_dmi->dmi_addrlen = dmi->dmi_addrlen; - memcpy(new_dmi->dmi_addr, dmi->dmi_addr, dmi->dmi_addrlen); + new_dmi->dmi_addrlen = dmi->dmi_addrlen; + memcpy(new_dmi->dmi_addr, dmi->dmi_addr, dmi->dmi_addrlen); new_dmi->dmi_users = dmi->dmi_users; - new_dmi->dmi_gusers = dmi->dmi_gusers; - } + new_dmi->dmi_gusers = dmi->dmi_gusers; + } return 0; } @@ -1080,64 +1080,64 @@ static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond, * Returns 0 if dmi1 and dmi2 are the same, non-0 otherwise */ static inline int bond_is_dmi_same(struct dev_mc_list *dmi1, struct dev_mc_list *dmi2) -{ +{ return memcmp(dmi1->dmi_addr, dmi2->dmi_addr, dmi1->dmi_addrlen) == 0 && dmi1->dmi_addrlen == dmi2->dmi_addrlen; -} +} /* * Push the promiscuity flag down to appropriate slaves */ static void bond_set_promiscuity(struct bonding *bond, int inc) -{ +{ if (USES_PRIMARY(bond_mode)) { /* write lock already acquired */ if (bond->curr_active_slave) { dev_set_promiscuity(bond->curr_active_slave->dev, inc); } - } else { + } else { struct slave *slave; int i; bond_for_each_slave(bond, slave, i) { dev_set_promiscuity(slave->dev, inc); } } -} +} /* * Push the allmulti flag down to all slaves */ static void bond_set_allmulti(struct bonding *bond, int inc) -{ +{ if (USES_PRIMARY(bond_mode)) { /* write lock already acquired */ if (bond->curr_active_slave) { dev_set_allmulti(bond->curr_active_slave->dev, inc); } - } else { + } else { struct slave *slave; int i; bond_for_each_slave(bond, slave, i) { dev_set_allmulti(slave->dev, inc); } } -} +} -/* - * returns dmi entry if found, NULL otherwise +/* + * returns dmi entry if found, NULL otherwise */ static struct dev_mc_list *bond_mc_list_find_dmi(struct dev_mc_list *dmi, struct dev_mc_list *mc_list) -{ +{ struct dev_mc_list *idmi; for (idmi = mc_list; idmi; idmi = idmi->next) { if (bond_is_dmi_same(dmi, idmi)) { - return idmi; + return idmi; } } return NULL; -} +} static void bond_set_multicast_list(struct net_device *bond_dev) { @@ -1150,40 +1150,40 @@ static void bond_set_multicast_list(struct net_device *bond_dev) * Do promisc before checking multicast_mode */ if ( (bond_dev->flags & IFF_PROMISC) && !(bond->flags & IFF_PROMISC) ) { - bond_set_promiscuity(bond, 1); + bond_set_promiscuity(bond, 1); } if ( !(bond_dev->flags & IFF_PROMISC) && (bond->flags & IFF_PROMISC) ) { - bond_set_promiscuity(bond, -1); + bond_set_promiscuity(bond, -1); } - /* set allmulti flag to slaves */ + /* set allmulti flag to slaves */ if ( (bond_dev->flags & IFF_ALLMULTI) && !(bond->flags & IFF_ALLMULTI) ) { - bond_set_allmulti(bond, 1); + bond_set_allmulti(bond, 1); } if ( !(bond_dev->flags & IFF_ALLMULTI) && (bond->flags & IFF_ALLMULTI) ) { - bond_set_allmulti(bond, -1); + bond_set_allmulti(bond, -1); } - bond->flags = bond_dev->flags; + bond->flags = bond_dev->flags; - /* looking for addresses to add to slaves' mc list */ - for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) { + /* looking for addresses to add to slaves' mc list */ + for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) { if (!bond_mc_list_find_dmi(dmi, bond->mc_list)) { - bond_mc_add(bond, dmi->dmi_addr, dmi->dmi_addrlen); + bond_mc_add(bond, dmi->dmi_addr, dmi->dmi_addrlen); } - } + } - /* looking for addresses to delete from slaves' list */ - for (dmi = bond->mc_list; dmi; dmi = dmi->next) { + /* looking for addresses to delete from slaves' list */ + for (dmi = bond->mc_list; dmi; dmi = dmi->next) { if (!bond_mc_list_find_dmi(dmi, bond_dev->mc_list)) { - bond_mc_delete(bond, dmi->dmi_addr, dmi->dmi_addrlen); + bond_mc_delete(bond, dmi->dmi_addr, dmi->dmi_addrlen); } } - /* save master's multicast list */ + /* save master's multicast list */ bond_mc_list_destroy(bond); bond_mc_list_copy(bond_dev->mc_list, bond, GFP_ATOMIC); @@ -1191,7 +1191,7 @@ static void bond_set_multicast_list(struct net_device *bond_dev) } /* - * Update the mc list and multicast-related flags for the new and + * Update the mc list and multicast-related flags for the new and * old active slaves (if any) according to the multicast mode, and * promiscuous flags unconditionally. */ @@ -1200,7 +1200,7 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, struct struct dev_mc_list *dmi; if (!USES_PRIMARY(bond_mode)) { - /* nothing to do - mc list is already up-to-date on + /* nothing to do - mc list is already up-to-date on * all slaves */ return; @@ -1370,16 +1370,16 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de * bond_change_active() */ if (!USES_PRIMARY(bond_mode)) { - /* set promiscuity level to new slave */ + /* set promiscuity level to new slave */ if (bond_dev->flags & IFF_PROMISC) { - dev_set_promiscuity(slave_dev, 1); + dev_set_promiscuity(slave_dev, 1); } /* set allmulti level to new slave */ if (bond_dev->flags & IFF_ALLMULTI) { - dev_set_allmulti(slave_dev, 1); + dev_set_allmulti(slave_dev, 1); } - - /* upload master's mc_list to new slave */ + + /* upload master's mc_list to new slave */ for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) { dev_mc_add (slave_dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); } @@ -1393,7 +1393,7 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de } write_lock_bh(&bond->lock); - + bond_attach_slave(bond, new_slave); new_slave->delay = 0; new_slave->link_failure_count = 0; @@ -1410,7 +1410,7 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de * here (because netif_carrier is always * supported); thus, we don't need to change * the messages for netif_carrier. - */ + */ printk(KERN_WARNING DRV_NAME ": Warning: MII and ETHTOOL support not " "available for interface %s, and " @@ -1425,7 +1425,7 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de "interface %s; the network driver associated " "with this interface does not support MII or " "ETHTOOL link status reporting, thus miimon " - "has no effect on this interface.\n", + "has no effect on this interface.\n", slave_dev->name); } } @@ -1600,7 +1600,7 @@ err_free: return res; } -/* +/* * This function changes the active slave to slave . * It returns -EINVAL in the following cases. * - is not found in the list. @@ -1628,7 +1628,7 @@ static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_devi write_lock_bh(&bond->lock); 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); /* * Changing to the current active: do nothing; return success. @@ -1675,9 +1675,9 @@ static struct slave *bond_find_best_slave(struct bonding *bond) mintime = updelay; - /* first try the primary link; if arping, a link must tx/rx traffic - * before it can be considered the curr_active_slave - also, we would skip - * slaves between the curr_active_slave and primary_slave that may be up + /* first try the primary link; if arping, a link must tx/rx traffic + * before it can be considered the curr_active_slave - also, we would skip + * slaves between the curr_active_slave and primary_slave that may be up * and able to arp */ if ((bond->primary_slave) && @@ -1710,7 +1710,7 @@ static struct slave *bond_find_best_slave(struct bonding *bond) * change_active_interface - change the active slave into the specified one * @bond: our bonding struct * @new: the new slave to make the active one - * + * * Set the new slave to the bond's settings and unset them on the old * curr_active_slave. * Setting include flags, mc-list, promiscuity, allmulti, etc. @@ -1822,7 +1822,7 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de struct slave *slave; struct sockaddr addr; int mac_addr_differ; - + /* slave is not a slave or master is not master of this slave */ if (!(slave_dev->flags & IFF_SLAVE) || (slave_dev->master != bond_dev)) { @@ -1910,7 +1910,7 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de } write_unlock_bh(&bond->lock); - + /* If the mode USES_PRIMARY, then we should only remove its * promisc and mc settings if it was the curr_active_slave, but that was * already taken care of above when we detached the slave @@ -1918,14 +1918,14 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de if (!USES_PRIMARY(bond_mode)) { /* unset promiscuity level from slave */ if (bond_dev->flags & IFF_PROMISC) { - dev_set_promiscuity(slave_dev, -1); + dev_set_promiscuity(slave_dev, -1); } - /* unset allmulti level from slave */ + /* unset allmulti level from slave */ if (bond_dev->flags & IFF_ALLMULTI) { - dev_set_allmulti(slave_dev, -1); + dev_set_allmulti(slave_dev, -1); } - /* flush master's mc_list from slave */ - bond_mc_list_flush (slave_dev, bond_dev); + /* flush master's mc_list from slave */ + bond_mc_list_flush (slave_dev, bond_dev); } netdev_set_master(slave_dev, NULL); @@ -1961,7 +1961,7 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de return 0; /* deletion OK */ } -/* +/* * This function releases all slaves. */ static int bond_release_all(struct net_device *bond_dev) @@ -2013,14 +2013,14 @@ static int bond_release_all(struct net_device *bond_dev) if (!USES_PRIMARY(bond_mode)) { /* unset promiscuity level from slave */ if (bond_dev->flags & IFF_PROMISC) { - dev_set_promiscuity(slave_dev, -1); + dev_set_promiscuity(slave_dev, -1); } - /* unset allmulti level from slave */ + /* unset allmulti level from slave */ if (bond_dev->flags & IFF_ALLMULTI) { - dev_set_allmulti(slave_dev, -1); + dev_set_allmulti(slave_dev, -1); } - /* flush master's mc_list from slave */ - bond_mc_list_flush(slave_dev, bond_dev); + /* flush master's mc_list from slave */ + bond_mc_list_flush(slave_dev, bond_dev); } netdev_set_master(slave_dev, NULL); @@ -2099,7 +2099,7 @@ static void bond_mii_monitor(struct net_device *bond_dev) int link_state; u16 old_speed = slave->speed; u8 old_duplex = slave->duplex; - + link_state = bond_check_dev_link(slave_dev, 0); switch (slave->link) { @@ -2190,7 +2190,7 @@ static void bond_mii_monitor(struct net_device *bond_dev) } else { /* link going up */ slave->link = BOND_LINK_BACK; slave->delay = updelay; - + if (updelay) { /* if updelay == 0, no need to advertise about a 0 ms delay */ @@ -2239,7 +2239,7 @@ static void bond_mii_monitor(struct net_device *bond_dev) "up for interface %s.\n", bond_dev->name, slave_dev->name); - + /* notify ad that the link status has changed */ if (bond_mode == BOND_MODE_8023AD) { bond_3ad_handle_link_change(slave, BOND_LINK_UP); @@ -2299,12 +2299,12 @@ out: read_unlock(&bond->lock); } -/* - * this function is called regularly to monitor each slave's link +/* + * this function is called regularly to monitor each slave's link * ensuring that traffic is being sent and received when arp monitoring - * is used in load-balancing mode. if the adapter has been dormant, then an - * arp is transmitted to generate traffic. see activebackup_arp_monitor for - * arp monitoring in active backup mode. + * is used in load-balancing mode. if the adapter has been dormant, then an + * arp is transmitted to generate traffic. see activebackup_arp_monitor for + * arp monitoring in active backup mode. */ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) { @@ -2334,7 +2334,7 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) * 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 + * so it can wait */ bond_for_each_slave(bond, slave, i) { @@ -2347,7 +2347,7 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) slave->state = BOND_STATE_ACTIVE; /* 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 * curr_active_slave being null after enslaving * is closed. */ @@ -2364,7 +2364,7 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) bond_dev->name, slave->dev->name); } - } + } } else { /* slave->link == BOND_LINK_UP */ @@ -2389,13 +2389,13 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) do_failover = 1; } } - } + } - /* note: if switch is in round-robin mode, all links + /* 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 + * 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)) { @@ -2423,18 +2423,18 @@ out: read_unlock(&bond->lock); } -/* +/* * When using arp monitoring in active-backup mode, this function is * called to determine if any backup slaves have went down or a new * current slave needs to be found. - * The backup slaves never generate traffic, they are considered up by merely - * receiving traffic. If the current slave goes down, each backup slave will - * be given the opportunity to tx/rx an arp before being taken down - this - * prevents all slaves from being taken down due to the current slave not + * The backup slaves never generate traffic, they are considered up by merely + * receiving traffic. If the current slave goes down, each backup slave will + * be given the opportunity to tx/rx an arp before being taken down - this + * prevents all slaves from being taken down due to the current slave not * sending any traffic for the backups to receive. The arps are not necessarily - * necessary, any tx and rx traffic will keep the current slave up. While any - * rx traffic will keep the backup slaves up, the current slave is responsible - * for generating traffic to keep them up regardless of any other traffic they + * necessary, any tx and rx traffic will keep the current slave up. While any + * rx traffic will keep the backup slaves up, the current slave is responsible + * for generating traffic to keep them up regardless of any other traffic they * may have received. * see loadbalance_arp_monitor for arp monitoring in load balancing mode */ @@ -2455,10 +2455,10 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) goto re_arm; } - /* determine if any slave has come up or any backup slave has - * gone down + /* determine if any slave has come up or any backup slave has + * gone down * TODO: what about up/down delay in arp mode? it wasn't here before - * so it can wait + * so it can wait */ bond_for_each_slave(bond, slave, i) { @@ -2472,10 +2472,10 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) bond_change_active_slave(bond, slave); bond->current_arp_slave = NULL; } 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 * can also happen if bond_enslave adds - * a new slave that is up while we are + * a new slave that is up while we are * searching for a new slave */ bond_set_slave_inactive_flags(slave); @@ -2504,14 +2504,14 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) (!bond->current_arp_slave) && (((jiffies - slave->dev->last_rx) >= 3*delta_in_ticks) && my_ip)) { - /* a backup slave has gone down; three times - * the delta allows the current slave to be + /* a backup slave has gone down; three times + * the delta allows the current slave to be * taken out before the backup slave. * note: a non-null current_arp_slave indicates - * the curr_active_slave went down and we are - * searching for a new one; under this - * condition we only take the curr_active_slave - * down - this gives each slave a chance to + * the curr_active_slave went down and we are + * searching for a new one; under this + * condition we only take the curr_active_slave + * down - this gives each slave a chance to * tx/rx traffic before being taken out */ read_unlock(&bond->curr_slave_lock); @@ -2537,11 +2537,11 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) if (slave) { /* 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 slave first becomes the curr_active_slave - not necessarily - * after every arp; this ensures the slave has a full 2*delta - * before being taken out. if a primary is being used, check + * after every arp; this ensures the slave has a full 2*delta + * before being taken out. if a primary is being used, check * if it is up and needs to take over as the curr_active_slave */ if ((((jiffies - slave->dev->trans_start) >= (2*delta_in_ticks)) || @@ -2567,17 +2567,17 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) slave->jiffies = jiffies; } - } else if ((bond->primary_slave) && - (bond->primary_slave != slave) && + } else if ((bond->primary_slave) && + (bond->primary_slave != slave) && (bond->primary_slave->link == BOND_LINK_UP)) { /* at this point, slave is the curr_active_slave */ printk(KERN_INFO DRV_NAME ": %s: changing from interface %s to primary " "interface %s\n", - bond_dev->name, - slave->dev->name, + bond_dev->name, + slave->dev->name, bond->primary_slave->dev->name); - + /* primary is up so switch to it */ write_lock(&bond->curr_slave_lock); bond_change_active_slave(bond, bond->primary_slave); @@ -2596,15 +2596,15 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) } } - /* 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 + /* 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 * for becoming the curr_active_slave */ - if (!slave) { + if (!slave) { if (bond->current_arp_slave == NULL) { bond->current_arp_slave = bond->first_slave; - } + } if (bond->current_arp_slave) { bond_set_slave_inactive_flags(bond->current_arp_slave); @@ -2620,11 +2620,11 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) break; } - /* if the link state is up at this point, we - * mark it down - this can happen if we have - * simultaneous link failures and - * reselect_active_interface doesn't make this - * one the current slave so it is still marked + /* if the link state is up at this point, we + * mark it down - this can happen if we have + * simultaneous link failures and + * reselect_active_interface doesn't make this + * one the current slave so it is still marked * up when it is actually down */ if (slave->link == BOND_LINK_UP) { @@ -2765,7 +2765,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd int prev_abi_ver = orig_app_abi_ver; int res = 0; - dprintk("bond_ioctl: master=%s, cmd=%d\n", + dprintk("bond_ioctl: master=%s, cmd=%d\n", bond_dev->name, cmd); switch (cmd) { @@ -2780,7 +2780,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd mii->phy_id = 0; /* Fall Through */ case SIOCGMIIREG: - /* + /* * We do this again just in case we were called by SIOCGMIIREG * instead of SIOCGMIIPHY. */ @@ -2860,12 +2860,12 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd dprintk("slave_dev->name=%s: \n", slave_dev->name); switch (cmd) { case BOND_ENSLAVE_OLD: - case SIOCBONDENSLAVE: + case SIOCBONDENSLAVE: res = bond_enslave(bond_dev, slave_dev); break; - case BOND_RELEASE_OLD: - case SIOCBONDRELEASE: - res = bond_release(bond_dev, slave_dev); + case BOND_RELEASE_OLD: + case SIOCBONDRELEASE: + res = bond_release(bond_dev, slave_dev); break; case BOND_SETHWADDR_OLD: case SIOCBONDSETHWADDR: @@ -2903,7 +2903,7 @@ static int bond_accept_fastpath(struct net_device *bond_dev, struct dst_entry *d } #endif -/* +/* * in broadcast mode, we send everything to all usable interfaces. */ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev) @@ -2918,7 +2918,7 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev) if (!BOND_IS_OK(bond)) { goto free_out; } - + read_lock(&bond->curr_slave_lock); start_at = bond->curr_active_slave; read_unlock(&bond->curr_slave_lock); @@ -2978,7 +2978,7 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev if (!BOND_IS_OK(bond)) { goto free_out; } - + read_lock(&bond->curr_slave_lock); slave = start_at = bond->curr_active_slave; read_unlock(&bond->curr_slave_lock); @@ -3014,10 +3014,10 @@ free_out: goto out; } -/* +/* * in XOR mode, we determine the output device by performing xor on - * the source and destination hw adresses. If this device is not - * enabled, find the next slave following this xor slave. + * the source and destination hw adresses. If this device is not + * enabled, find the next slave following this xor slave. */ static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev) { @@ -3067,7 +3067,7 @@ free_out: goto out; } -/* +/* * in active-backup mode, we know that bond->curr_active_slave is always valid if * the bond has a usable interface. */ @@ -3075,7 +3075,7 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_d { struct bonding *bond = (struct bonding *)bond_dev->priv; - /* if we are sending arp packets, try to at least + /* if we are sending arp packets, try to at least identify our own ip address */ if (arp_interval && !my_ip && (skb->protocol == __constant_htons(ETH_P_ARP))) { @@ -3092,7 +3092,7 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_d if (!BOND_IS_OK(bond)) { goto free_out; } - + if (bond->curr_active_slave) { /* one usable interface */ skb->dev = bond->curr_active_slave->dev; skb->priority = 1; @@ -3125,7 +3125,7 @@ static struct net_device_stats *bond_get_stats(struct net_device *bond_dev) bond_for_each_slave(bond, slave, i) { sstats = slave->dev->get_stats(slave->dev); - + stats->rx_packets += sstats->rx_packets; stats->rx_bytes += sstats->rx_bytes; stats->rx_errors += sstats->rx_errors; @@ -3143,9 +3143,9 @@ static struct net_device_stats *bond_get_stats(struct net_device *bond_dev) stats->rx_over_errors += sstats->rx_over_errors; stats->rx_crc_errors += sstats->rx_crc_errors; stats->rx_frame_errors += sstats->rx_frame_errors; - stats->rx_fifo_errors += sstats->rx_fifo_errors; + stats->rx_fifo_errors += sstats->rx_fifo_errors; stats->rx_missed_errors += sstats->rx_missed_errors; - + stats->tx_aborted_errors += sstats->tx_aborted_errors; stats->tx_carrier_errors += sstats->tx_carrier_errors; stats->tx_fifo_errors += sstats->tx_fifo_errors; @@ -3472,7 +3472,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) res = slave->dev->set_mac_address(slave->dev, addr); if (res) { - /* TODO: consider downing the slave + /* TODO: consider downing the slave * and retry ? * User should expect communications * breakage anyway until ARP finish @@ -3815,7 +3815,7 @@ static int __init bond_init(struct net_device *bond_dev) } else { printk("out ARP monitoring\n"); } - + #ifdef CONFIG_PROC_FS bond_create_proc_entry(bond); #endif @@ -3995,7 +3995,7 @@ static int bond_check_params(void) printk(KERN_WARNING DRV_NAME ": Warning: downdelay (%d) is not a multiple " "of miimon (%d), downdelay rounded to %d ms\n", - downdelay, miimon, + downdelay, miimon, (downdelay / miimon) * miimon); } } @@ -4013,14 +4013,14 @@ static int bond_check_params(void) arp_ip_count++ ) { /* not complete check, but should be good enough to catch mistakes */ - if (!isdigit(arp_ip_target[arp_ip_count][0])) { + if (!isdigit(arp_ip_target[arp_ip_count][0])) { printk(KERN_WARNING DRV_NAME ": Warning: bad arp_ip_target module parameter " "(%s), ARP monitoring will not be performed\n", arp_ip_target[arp_ip_count]); arp_interval = 0; - } else { - u32 ip = in_aton(arp_ip_target[arp_ip_count]); + } else { + u32 ip = in_aton(arp_ip_target[arp_ip_count]); arp_target[arp_ip_count] = ip; } } diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index d936182cffb8..cce7ebe7fbae 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h @@ -9,7 +9,7 @@ * * This software may be used and distributed according to the terms * of the GNU Public License, incorporated herein by reference. - * + * * * 2003/03/18 - Amir Noam , * Tsippy Mendelson and @@ -23,7 +23,7 @@ * 2003/05/01 - Shmulik Hen * - Added support for Transmit load balancing mode. */ - + #ifndef _LINUX_BONDING_H #define _LINUX_BONDING_H @@ -52,7 +52,7 @@ /* * Checks whether bond is ready for transmit. - * + * * Caller must hold bond->lock */ #define BOND_IS_OK(bond) \ diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h index a1ade4ff0f8c..a0f6de9490c1 100644 --- a/include/linux/if_bonding.h +++ b/include/linux/if_bonding.h @@ -1,7 +1,7 @@ /* * Bond several ethernet interfaces into a Cisco, running 'Etherchannel'. * - * + * * Portions are (c) Copyright 1995 Simon "Guru Aleph-Null" Janes * NCM: Network and Communications Management, Inc. * @@ -10,11 +10,11 @@ * * This software may be used and distributed according to the terms * of the GNU Public License, incorporated herein by reference. - * + * * 2003/03/18 - Amir Noam * - Added support for getting slave's speed and duplex via ethtool. * Needed for 802.3ad and other future modes. - * + * * 2003/03/18 - Tsippy Mendelson and * Shmulik Hen * - Enable support of modes that need to use the unique mac address of -- cgit v1.2.3 From bc74d6363b3a6a71316d1ad886a21bd4f9b8e646 Mon Sep 17 00:00:00 2001 From: Shmulik Hen Date: Sat, 10 Jan 2004 06:32:08 -0500 Subject: [PATCH] bonding cleanup 2.6 - empty lines cleanup Remove duplicate empty lines. add empty lines where needed to improve readability. --- drivers/net/bonding/bond_alb.c | 35 ++++++++++++----- drivers/net/bonding/bond_main.c | 86 +++++++++++++++++++++++++++++------------ include/linux/if_bonding.h | 1 + 3 files changed, 88 insertions(+), 34 deletions(-) (limited to 'include/linux') diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 6d55ab841ee9..06d5c180d3fe 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c @@ -146,6 +146,7 @@ static inline void tlb_init_table_entry(struct tlb_client_info *entry, int save_ BOND_TLB_REBALANCE_INTERVAL; entry->tx_bytes = 0; } + entry->tx_slave = NULL; entry->next = TLB_NULL_INDEX; entry->prev = TLB_NULL_INDEX; @@ -164,6 +165,7 @@ static void tlb_clear_slave(struct bonding *bond, struct slave *slave, int save_ u32 index; _lock_tx_hashtbl(bond); + /* clear slave from tx_hashtbl */ tx_hash_table = BOND_ALB_INFO(bond).tx_hashtbl; @@ -173,6 +175,7 @@ static void tlb_clear_slave(struct bonding *bond, struct slave *slave, int save_ tlb_init_table_entry(&tx_hash_table[index], save_load); index = next_index; } + _unlock_tx_hashtbl(bond); tlb_init_slave(slave); @@ -199,9 +202,11 @@ static int tlb_initialize(struct bonding *bond) } memset(bond_info->tx_hashtbl, 0, size); + for (i = 0; i < TLB_HASH_TABLE_SIZE; i++) { tlb_init_table_entry(&bond_info->tx_hashtbl[i], 1); } + _unlock_tx_hashtbl(bond); return 0; @@ -213,8 +218,10 @@ static void tlb_deinitialize(struct bonding *bond) struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); _lock_tx_hashtbl(bond); + kfree(bond_info->tx_hashtbl); bond_info->tx_hashtbl = NULL; + _unlock_tx_hashtbl(bond); } @@ -326,7 +333,6 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp) if ((client_info->assigned) && (client_info->ip_src == arp->ip_dst) && (client_info->ip_dst == arp->ip_src)) { - /* update the clients MAC address */ memcpy(client_info->mac_dst, arp->mac_src, ETH_ALEN); client_info->ntt = 1; @@ -409,10 +415,12 @@ static void rlb_teach_disabled_mac_on_primary(struct bonding *bond, u8 addr[]) if (!bond->curr_active_slave) { return; } + if (!bond->alb_info.primary_is_promisc) { bond->alb_info.primary_is_promisc = 1; dev_set_promiscuity(bond->curr_active_slave->dev, 1); } + bond->alb_info.rlb_promisc_timeout_counter = 0; alb_send_learning_packets(bond->curr_active_slave, addr); @@ -435,7 +443,6 @@ static void rlb_clear_slave(struct bonding *bond, struct slave *slave) index = bond_info->rx_hashtbl_head; for (; index != RLB_NULL_INDEX; index = next_index) { next_index = rx_hash_table[index].next; - if (rx_hash_table[index].slave == slave) { struct slave *assigned_slave = rlb_next_rx_slave(bond); @@ -464,9 +471,11 @@ static void rlb_clear_slave(struct bonding *bond, struct slave *slave) _unlock_rx_hashtbl(bond); write_lock(&bond->curr_slave_lock); + if (slave != bond->curr_active_slave) { rlb_teach_disabled_mac_on_primary(bond, slave->dev->dev_addr); } + write_unlock(&bond->curr_slave_lock); } @@ -600,7 +609,6 @@ struct slave *rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp) if ((client_info->ip_src == arp->ip_src) && (client_info->ip_dst == arp->ip_dst)) { /* the entry is already assigned to this client */ - if (memcmp(arp->mac_dst, mac_bcast, ETH_ALEN)) { /* update mac address from arp */ memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN); @@ -679,7 +687,6 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) } dprintk("Server sent ARP Reply packet\n"); } else if (arp->op_code == __constant_htons(ARPOP_REQUEST)) { - /* Create an entry in the rx_hashtbl for this client as a * place holder. * When the arp reply is received the entry will be updated @@ -767,6 +774,7 @@ static int rlb_initialize(struct bonding *bond) for (i = 0; i < RLB_HASH_TABLE_SIZE; i++) { rlb_init_table_entry(bond_info->rx_hashtbl + i); } + _unlock_rx_hashtbl(bond); /*initialize packet type*/ @@ -787,8 +795,10 @@ static void rlb_deinitialize(struct bonding *bond) dev_remove_pack(&(bond_info->rlb_pkt_type)); _lock_rx_hashtbl(bond); + kfree(bond_info->rx_hashtbl); bond_info->rx_hashtbl = NULL; + _unlock_rx_hashtbl(bond); } @@ -816,14 +826,15 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) data = skb_put(skb, size); memcpy(data, &pkt, size); + skb->mac.raw = data; skb->nh.raw = data + ETH_HLEN; skb->protocol = pkt.type; skb->priority = TC_PRIO_CONTROL; skb->dev = slave->dev; + dev_queue_xmit(skb); } - } /* hw is a boolean parameter that determines whether we should try and @@ -991,6 +1002,7 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav break; } } + if (found) { /* a slave was found that is using the mac address * of the new slave @@ -1001,6 +1013,7 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav slave->dev->name); return -EINVAL; } + return 0; } @@ -1178,7 +1191,6 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) hash_start = (char*)&(skb->nh.iph->daddr); hash_size = sizeof(skb->nh.iph->daddr); break; - case ETH_P_IPV6: if (memcmp(eth_data->h_dest, mac_bcast, ETH_ALEN) == 0) { do_tx_balance = 0; @@ -1188,7 +1200,6 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) hash_start = (char*)&(skb->nh.ipv6h->daddr); hash_size = sizeof(skb->nh.ipv6h->daddr); break; - case ETH_P_IPX: if (ipx_hdr(skb)->ipx_checksum != __constant_htons(IPX_NO_CHECKSUM)) { @@ -1210,14 +1221,12 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) hash_start = (char*)eth_data->h_dest; hash_size = ETH_ALEN; break; - case ETH_P_ARP: do_tx_balance = 0; if (bond_info->rlb_enabled) { tx_slave = rlb_arp_xmit(skb, bond); } break; - default: do_tx_balance = 0; break; @@ -1290,9 +1299,11 @@ void bond_alb_monitor(struct bonding *bond) * read. */ read_lock(&bond->curr_slave_lock); + bond_for_each_slave(bond, slave, i) { alb_send_learning_packets(slave,slave->dev->dev_addr); } + read_unlock(&bond->curr_slave_lock); bond_info->lp_counter = 0; @@ -1300,7 +1311,9 @@ void bond_alb_monitor(struct bonding *bond) /* rebalance tx traffic */ if (bond_info->tx_rebalance_counter >= BOND_TLB_REBALANCE_TICKS) { + read_lock(&bond->curr_slave_lock); + bond_for_each_slave(bond, slave, i) { tlb_clear_slave(bond, slave, 1); if (slave == bond->curr_active_slave) { @@ -1310,7 +1323,9 @@ void bond_alb_monitor(struct bonding *bond) bond_info->unbalanced_load = 0; } } + read_unlock(&bond->curr_slave_lock); + bond_info->tx_rebalance_counter = 0; } @@ -1322,6 +1337,7 @@ void bond_alb_monitor(struct bonding *bond) * sets the promiscuity. */ write_lock(&bond->curr_slave_lock); + if (bond_info->primary_is_promisc && (++bond_info->rlb_promisc_timeout_counter >= RLB_PROMISC_TIMEOUT)) { @@ -1334,6 +1350,7 @@ void bond_alb_monitor(struct bonding *bond) dev_set_promiscuity(bond->curr_active_slave->dev, -1); bond_info->primary_is_promisc = 0; } + write_unlock(&bond->curr_slave_lock); if (bond_info->rlb_rebalance) { diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 231696eaa911..dcb2bd7b6174 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -596,7 +596,6 @@ static void bond_change_active_slave(struct bonding *bond, struct slave *new_act static void bond_select_active_slave(struct bonding *bond); static struct slave *bond_find_best_slave(struct bonding *bond); - static void bond_arp_send_all(struct slave *slave) { int i; @@ -608,7 +607,6 @@ static void bond_arp_send_all(struct slave *slave) } } - static const char *bond_mode_name(void) { switch (bond_mode) { @@ -697,7 +695,6 @@ static void bond_attach_slave(struct bonding *bond, struct slave *new_slave) bond->slave_cnt++; } - /* * Less bad way to call ioctl from within the kernel; this needs to be * done some other way to get the call out of interrupt context. @@ -827,7 +824,6 @@ static int bond_check_dev_link(struct net_device *slave_dev, int reporting) return 0; } } - } /* @@ -1067,12 +1063,12 @@ static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond, new_dmi->next = bond->mc_list; bond->mc_list = new_dmi; - new_dmi->dmi_addrlen = dmi->dmi_addrlen; memcpy(new_dmi->dmi_addr, dmi->dmi_addr, dmi->dmi_addrlen); new_dmi->dmi_users = dmi->dmi_users; new_dmi->dmi_gusers = dmi->dmi_gusers; } + return 0; } @@ -1082,7 +1078,7 @@ static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond, static inline int bond_is_dmi_same(struct dev_mc_list *dmi1, struct dev_mc_list *dmi2) { return memcmp(dmi1->dmi_addr, dmi2->dmi_addr, dmi1->dmi_addrlen) == 0 && - dmi1->dmi_addrlen == dmi2->dmi_addrlen; + dmi1->dmi_addrlen == dmi2->dmi_addrlen; } /* @@ -1095,7 +1091,6 @@ static void bond_set_promiscuity(struct bonding *bond, int inc) if (bond->curr_active_slave) { dev_set_promiscuity(bond->curr_active_slave->dev, inc); } - } else { struct slave *slave; int i; @@ -1136,6 +1131,7 @@ static struct dev_mc_list *bond_mc_list_find_dmi(struct dev_mc_list *dmi, struct return idmi; } } + return NULL; } @@ -1182,7 +1178,6 @@ static void bond_set_multicast_list(struct net_device *bond_dev) } } - /* save master's multicast list */ bond_mc_list_destroy(bond); bond_mc_list_copy(bond_dev->mc_list, bond, GFP_ATOMIC); @@ -1210,9 +1205,11 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, struct if (bond->dev->flags & IFF_PROMISC) { dev_set_promiscuity(old_active->dev, -1); } + if (bond->dev->flags & IFF_ALLMULTI) { dev_set_allmulti(old_active->dev, -1); } + for (dmi = bond->dev->mc_list; dmi; dmi = dmi->next) { dev_mc_delete(old_active->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); } @@ -1222,9 +1219,11 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, struct if (bond->dev->flags & IFF_PROMISC) { dev_set_promiscuity(new_active->dev, 1); } + if (bond->dev->flags & IFF_ALLMULTI) { dev_set_allmulti(new_active->dev, 1); } + for (dmi = bond->dev->mc_list; dmi; dmi = dmi->next) { dev_mc_add(new_active->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); } @@ -1247,7 +1246,6 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de slave_dev->name); } - /* bond must be initialized by bond_open() before enslaving */ if (!(bond_dev->flags & IFF_UP)) { dprintk("Error, master_dev is not up\n"); @@ -1307,6 +1305,7 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de if (!new_slave) { return -ENOMEM; } + memset(new_slave, 0, sizeof(struct slave)); /* save slave's original flags before calling @@ -1374,6 +1373,7 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de if (bond_dev->flags & IFF_PROMISC) { dev_set_promiscuity(slave_dev, 1); } + /* set allmulti level to new slave */ if (bond_dev->flags & IFF_ALLMULTI) { dev_set_allmulti(slave_dev, 1); @@ -1395,6 +1395,7 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de write_lock_bh(&bond->lock); bond_attach_slave(bond, new_slave); + new_slave->delay = 0; new_slave->link_failure_count = 0; @@ -1452,11 +1453,11 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de if (bond_update_speed_duplex(new_slave) && (new_slave->link != BOND_LINK_DOWN)) { - printk(KERN_WARNING DRV_NAME ": Warning: failed to get speed/duplex from %s, speed " "forced to 100Mbps, duplex forced to Full.\n", new_slave->dev->name); + if (bond_mode == BOND_MODE_8023AD) { printk(KERN_WARNING "Operation of 802.3ad mode requires ETHTOOL " @@ -1527,6 +1528,7 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de break; default: dprintk("This slave is always active in trunk mode\n"); + /* always active in trunk mode */ new_slave->state = BOND_STATE_ACTIVE; @@ -1561,6 +1563,7 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de break; } } + if (ndx == bond_dev->addr_len) { /* * We got all the way through the address and it was @@ -1646,7 +1649,9 @@ static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_devi } else { res = -EINVAL; } + write_unlock_bh(&bond->lock); + return res; } @@ -1799,7 +1804,6 @@ static void bond_select_active_slave(struct bonding *bond) struct slave *best_slave; best_slave = bond_find_best_slave(bond); - if (best_slave != bond->curr_active_slave) { bond_change_active_slave(bond, best_slave); } @@ -1920,10 +1924,12 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de if (bond_dev->flags & IFF_PROMISC) { dev_set_promiscuity(slave_dev, -1); } + /* unset allmulti level from slave */ if (bond_dev->flags & IFF_ALLMULTI) { dev_set_allmulti(slave_dev, -1); } + /* flush master's mc_list from slave */ bond_mc_list_flush (slave_dev, bond_dev); } @@ -2015,10 +2021,12 @@ static int bond_release_all(struct net_device *bond_dev) if (bond_dev->flags & IFF_PROMISC) { dev_set_promiscuity(slave_dev, -1); } + /* unset allmulti level from slave */ if (bond_dev->flags & IFF_ALLMULTI) { dev_set_allmulti(slave_dev, -1); } + /* flush master's mc_list from slave */ bond_mc_list_flush(slave_dev, bond_dev); } @@ -2110,9 +2118,11 @@ static void bond_mii_monitor(struct net_device *bond_dev) } else { /* link going down */ slave->link = BOND_LINK_FAIL; slave->delay = downdelay; + if (slave->link_failure_count < UINT_MAX) { slave->link_failure_count++; } + if (downdelay) { printk(KERN_INFO DRV_NAME ": %s: link status down for %s " @@ -2138,6 +2148,7 @@ static void bond_mii_monitor(struct net_device *bond_dev) if (slave->delay <= 0) { /* link down for too long time */ slave->link = BOND_LINK_DOWN; + /* in active/backup mode, we must * completely disable this interface */ @@ -2210,6 +2221,7 @@ static void bond_mii_monitor(struct net_device *bond_dev) if (link_state != BMSR_LSTATUS) { /* link down again */ slave->link = BOND_LINK_DOWN; + printk(KERN_INFO DRV_NAME ": %s: link status down again after %d " "ms for interface %s.\n", @@ -2272,6 +2284,7 @@ static void bond_mii_monitor(struct net_device *bond_dev) if (old_speed != slave->speed) { bond_3ad_adapter_speed_changed(slave); } + if (old_duplex != slave->duplex) { bond_3ad_adapter_duplex_changed(slave); } @@ -2337,9 +2350,7 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) * 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)) { @@ -2375,11 +2386,14 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) if (((jiffies - slave->dev->trans_start) >= (2*delta_in_ticks)) || (((jiffies - slave->dev->last_rx) >= (2*delta_in_ticks)) && my_ip)) { + 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, @@ -2407,6 +2421,7 @@ static void bond_loadbalance_arp_mon(struct net_device *bond_dev) 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 " @@ -2461,12 +2476,13 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) * so it can wait */ bond_for_each_slave(bond, slave, i) { - if (slave->link != BOND_LINK_UP) { if ((jiffies - slave->dev->last_rx) <= delta_in_ticks) { slave->link = BOND_LINK_UP; + write_lock(&bond->curr_slave_lock); + if ((!bond->curr_active_slave) && ((jiffies - slave->dev->trans_start) <= delta_in_ticks)) { bond_change_active_slave(bond, slave); @@ -2500,6 +2516,7 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) } } else { read_lock(&bond->curr_slave_lock); + if ((slave != bond->curr_active_slave) && (!bond->current_arp_slave) && (((jiffies - slave->dev->last_rx) >= 3*delta_in_ticks) && @@ -2514,12 +2531,17 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) * down - this gives each slave a chance to * tx/rx traffic before being taken out */ + read_unlock(&bond->curr_slave_lock); + slave->link = BOND_LINK_DOWN; + if (slave->link_failure_count < UINT_MAX) { slave->link_failure_count++; } + bond_set_slave_inactive_flags(slave); + printk(KERN_INFO DRV_NAME ": %s: backup interface %s is now down\n", bond_dev->name, @@ -2535,7 +2557,6 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) read_unlock(&bond->curr_slave_lock); if (slave) { - /* if we have sent traffic in the past 2*arp_intervals but * haven't xmit and rx traffic in that time interval, select * a different slave. slave->jiffies is only updated when @@ -2550,23 +2571,29 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) ((jiffies - slave->jiffies) >= 2*delta_in_ticks)) { slave->link = BOND_LINK_DOWN; + if (slave->link_failure_count < UINT_MAX) { slave->link_failure_count++; } + printk(KERN_INFO DRV_NAME ": %s: link status down for active interface " "%s, disabling it", bond_dev->name, slave->dev->name); + write_lock(&bond->curr_slave_lock); + bond_select_active_slave(bond); slave = bond->curr_active_slave; + write_unlock(&bond->curr_slave_lock); + bond->current_arp_slave = slave; + if (slave) { slave->jiffies = jiffies; } - } else if ((bond->primary_slave) && (bond->primary_slave != slave) && (bond->primary_slave->link == BOND_LINK_UP)) { @@ -2582,6 +2609,7 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) write_lock(&bond->curr_slave_lock); bond_change_active_slave(bond, bond->primary_slave); write_unlock(&bond->curr_slave_lock); + slave = bond->primary_slave; slave->jiffies = jiffies; } else { @@ -2634,6 +2662,7 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev) } bond_set_slave_inactive_flags(slave); + printk(KERN_INFO DRV_NAME ": %s: backup interface %s is " "now down.\n", @@ -2684,12 +2713,14 @@ static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *in } read_lock_bh(&bond->lock); + bond_for_each_slave(bond, slave, i) { if (i == (int)info->slave_id) { found = 1; break; } } + read_unlock_bh(&bond->lock); if (found) { @@ -2716,7 +2747,6 @@ static int bond_ethtool_ioctl(struct net_device *bond_dev, struct ifreq *ifr) } switch (cmd) { - case ETHTOOL_GDRVINFO: if (copy_from_user(&info, addr, sizeof(info))) { return -EFAULT; @@ -2771,7 +2801,6 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd switch (cmd) { case SIOCETHTOOL: return bond_ethtool_ioctl(bond_dev, ifr); - case SIOCGMIIPHY: mii = (struct mii_ioctl_data *)&ifr->ifr_data; if (!mii) { @@ -2788,6 +2817,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd if (!mii) { return -EINVAL; } + if (mii->reg_num == 1) { struct bonding *bond = (struct bonding *)bond_dev->priv; mii->val_out = 0; @@ -2799,32 +2829,39 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd read_unlock(&bond->curr_slave_lock); read_unlock_bh(&bond->lock); } + return 0; case BOND_INFO_QUERY_OLD: case SIOCBONDINFOQUERY: u_binfo = (struct ifbond *)ifr->ifr_data; + if (copy_from_user(&k_binfo, u_binfo, sizeof(ifbond))) { return -EFAULT; } + res = bond_info_query(bond_dev, &k_binfo); if (res == 0) { if (copy_to_user(u_binfo, &k_binfo, sizeof(ifbond))) { return -EFAULT; } } + return res; case BOND_SLAVE_INFO_QUERY_OLD: case SIOCBONDSLAVEINFOQUERY: u_sinfo = (struct ifslave *)ifr->ifr_data; + if (copy_from_user(&k_sinfo, u_sinfo, sizeof(ifslave))) { return -EFAULT; } + res = bond_slave_info_query(bond_dev, &k_sinfo); if (res == 0) { if (copy_to_user(u_sinfo, &k_sinfo, sizeof(ifslave))) { return -EFAULT; } } + return res; default: /* Go on */ @@ -2882,6 +2919,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd default: res = -EOPNOTSUPP; } + dev_put(slave_dev); } @@ -2991,7 +3029,6 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev if (IS_UP(slave->dev) && (slave->link == BOND_LINK_UP) && (slave->state == BOND_STATE_ACTIVE)) { - skb->dev = slave->dev; skb->priority = 1; dev_queue_xmit(skb); @@ -3048,7 +3085,6 @@ static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev) if (IS_UP(slave->dev) && (slave->link == BOND_LINK_UP) && (slave->state == BOND_STATE_ACTIVE)) { - skb->dev = slave->dev; skb->priority = 1; dev_queue_xmit(skb); @@ -3151,10 +3187,10 @@ static struct net_device_stats *bond_get_stats(struct net_device *bond_dev) stats->tx_fifo_errors += sstats->tx_fifo_errors; stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors; stats->tx_window_errors += sstats->tx_window_errors; - } read_unlock_bh(&bond->lock); + return stats; } @@ -3326,6 +3362,7 @@ static int bond_info_open(struct inode *inode, struct file *file) proc = PDE(inode); seq->private = proc->data; } + return res; } @@ -3464,6 +3501,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr) bond_for_each_slave(bond, slave, i) { dprintk("slave %p %s\n", slave, slave->dev->name); + if (slave->dev->set_mac_address == NULL) { res = -EOPNOTSUPP; dprintk("EOPNOTSUPP %s\n", slave->dev->name); @@ -3559,8 +3597,8 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) } bond_dev->mtu = new_mtu; - return 0; + return 0; unwind: /* unwind from the first slave that failed to head */ @@ -3845,7 +3883,6 @@ static inline int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl) return -1; } - static int bond_check_params(void) { /* @@ -3872,7 +3909,6 @@ static int bond_check_params(void) printk(KERN_ERR DRV_NAME ": Error: Invalid lacp rate \"%s\"\n", lacp_rate == NULL ? "NULL" : lacp_rate); - return -EINVAL; } } @@ -4025,7 +4061,6 @@ static int bond_check_params(void) } } - if (arp_interval && !arp_ip_count) { /* don't allow arping if no arp_ip_target given... */ printk(KERN_WARNING DRV_NAME @@ -4149,3 +4184,4 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION ", v" DRV_VERSION); * tab-width: 8 * End: */ + diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h index a0f6de9490c1..0f2382b5c755 100644 --- a/include/linux/if_bonding.h +++ b/include/linux/if_bonding.h @@ -111,3 +111,4 @@ struct ad_info { * tab-width: 8 * End: */ + -- cgit v1.2.3