diff -Nuarp a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c --- a/drivers/net/bonding/bond_alb.c Sun Dec 21 16:08:49 2003 +++ b/drivers/net/bonding/bond_alb.c Sun Dec 21 16:08:49 2003 @@ -112,8 +112,7 @@ struct arp_pkt { /* Forward declaration */ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]); -static inline u8 -_simple_hash(u8 *hash_start, int hash_size) +static inline u8 _simple_hash(u8 *hash_start, int hash_size) { int i; u8 hash = 0; @@ -127,21 +126,18 @@ _simple_hash(u8 *hash_start, int hash_si /*********************** tlb specific functions ***************************/ -static inline void -_lock_tx_hashtbl(struct bonding *bond) +static inline void _lock_tx_hashtbl(struct bonding *bond) { spin_lock(&(BOND_ALB_INFO(bond).tx_hashtbl_lock)); } -static inline void -_unlock_tx_hashtbl(struct bonding *bond) +static inline void _unlock_tx_hashtbl(struct bonding *bond) { spin_unlock(&(BOND_ALB_INFO(bond).tx_hashtbl_lock)); } /* Caller must hold tx_hashtbl lock */ -static inline void -tlb_init_table_entry(struct tlb_client_info *entry, u8 save_load) +static inline void tlb_init_table_entry(struct tlb_client_info *entry, u8 save_load) { if (save_load) { entry->load_history = 1 + entry->tx_bytes / @@ -153,16 +149,14 @@ tlb_init_table_entry(struct tlb_client_i entry->prev = TLB_NULL_INDEX; } -static inline void -tlb_init_slave(struct slave *slave) +static inline void tlb_init_slave(struct slave *slave) { SLAVE_TLB_INFO(slave).load = 0; SLAVE_TLB_INFO(slave).head = TLB_NULL_INDEX; } /* Caller must hold bond lock for read */ -static inline void -tlb_clear_slave(struct bonding *bond, struct slave *slave, u8 save_load) +static void tlb_clear_slave(struct bonding *bond, struct slave *slave, u8 save_load) { struct tlb_client_info *tx_hash_table = NULL; u32 index; @@ -183,8 +177,7 @@ tlb_clear_slave(struct bonding *bond, st } /* Must be called before starting the monitor timer */ -static int -tlb_initialize(struct bonding *bond) +static int tlb_initialize(struct bonding *bond) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); int i; @@ -214,8 +207,7 @@ tlb_initialize(struct bonding *bond) } /* Must be called only after all slaves have been released */ -static void -tlb_deinitialize(struct bonding *bond) +static void tlb_deinitialize(struct bonding *bond) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); @@ -226,8 +218,7 @@ tlb_deinitialize(struct bonding *bond) } /* Caller must hold bond lock for read */ -static struct slave * -tlb_get_least_loaded_slave(struct bonding *bond) +static struct slave *tlb_get_least_loaded_slave(struct bonding *bond) { struct slave *slave; struct slave *least_loaded; @@ -266,8 +257,7 @@ tlb_get_least_loaded_slave(struct bondin } /* Caller must hold bond lock for read */ -struct slave * -tlb_choose_channel(struct bonding *bond, u32 hash_index, u32 skb_len) +struct slave *tlb_choose_channel(struct bonding *bond, u32 hash_index, u32 skb_len) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct tlb_client_info *hash_table = NULL; @@ -309,14 +299,12 @@ tlb_choose_channel(struct bonding *bond, } /*********************** rlb specific functions ***************************/ -static inline void -_lock_rx_hashtbl(struct bonding *bond) +static inline void _lock_rx_hashtbl(struct bonding *bond) { spin_lock(&(BOND_ALB_INFO(bond).rx_hashtbl_lock)); } -static inline void -_unlock_rx_hashtbl(struct bonding *bond) +static inline void _unlock_rx_hashtbl(struct bonding *bond) { spin_unlock(&(BOND_ALB_INFO(bond).rx_hashtbl_lock)); } @@ -324,8 +312,7 @@ _unlock_rx_hashtbl(struct bonding *bond) /* when an ARP REPLY is received from a client update its info * in the rx_hashtbl */ -static void -rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp) +static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp) { u32 hash_index; struct rlb_client_info *client_info = NULL; @@ -349,10 +336,7 @@ rlb_update_entry_from_arp(struct bonding _unlock_rx_hashtbl(bond); } -static int -rlb_arp_recv(struct sk_buff *skb, - struct net_device *dev, - struct packet_type *ptype) +static int rlb_arp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptype) { struct bonding *bond = (struct bonding *)dev->priv; int ret = NET_RX_DROP; @@ -387,8 +371,7 @@ out: } /* Caller must hold bond lock for read */ -static struct slave * -rlb_next_rx_slave(struct bonding *bond) +static struct slave *rlb_next_rx_slave(struct bonding *bond) { struct slave *rx_slave = NULL, *slave = NULL; unsigned int i = 0; @@ -422,8 +405,7 @@ rlb_next_rx_slave(struct bonding *bond) * * Caller must hold bond->ptrlock for write or bond lock for write */ -static void -rlb_teach_disabled_mac_on_primary(struct bonding *bond, u8 addr[]) +static void rlb_teach_disabled_mac_on_primary(struct bonding *bond, u8 addr[]) { if (!bond->current_slave) { return; @@ -441,8 +423,7 @@ rlb_teach_disabled_mac_on_primary(struct * * Caller must hold bond lock for read */ -static void -rlb_clear_slave(struct bonding *bond, struct slave *slave) +static void rlb_clear_slave(struct bonding *bond, struct slave *slave) { struct rlb_client_info *rx_hash_table = NULL; struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); @@ -491,8 +472,7 @@ rlb_clear_slave(struct bonding *bond, st write_unlock(&bond->ptrlock); } -static void -rlb_update_client(struct rlb_client_info *client_info) +static void rlb_update_client(struct rlb_client_info *client_info) { int i = 0; @@ -512,8 +492,7 @@ rlb_update_client(struct rlb_client_info } /* sends ARP REPLIES that update the clients that need updating */ -static void -rlb_update_rx_clients(struct bonding *bond) +static void rlb_update_rx_clients(struct bonding *bond) { u32 hash_index; struct rlb_client_info *client_info = NULL; @@ -541,8 +520,7 @@ rlb_update_rx_clients(struct bonding *bo } /* The slave was assigned a new mac address - update the clients */ -static void -rlb_req_update_slave_clients(struct bonding *bond, struct slave *slave) +static void rlb_req_update_slave_clients(struct bonding *bond, struct slave *slave) { u32 hash_index; u8 ntt = 0; @@ -574,8 +552,7 @@ rlb_req_update_slave_clients(struct bond } /* mark all clients using src_ip to be updated */ -static void -rlb_req_update_subnet_clients(struct bonding *bond, u32 src_ip) +static void rlb_req_update_subnet_clients(struct bonding *bond, u32 src_ip) { u32 hash_index; struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); @@ -611,8 +588,7 @@ rlb_req_update_subnet_clients(struct bon } /* Caller must hold both bond and ptr locks for read */ -struct slave * -rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp) +struct slave *rlb_choose_channel(struct bonding *bond, struct arp_pkt *arp) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct rlb_client_info *client_info = NULL; @@ -694,8 +670,7 @@ rlb_choose_channel(struct bonding *bond, * does not choose channel for other arp types since they are * sent on the current_slave */ -static struct slave * -rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) +static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) { struct arp_pkt *arp = (struct arp_pkt *)skb->nh.raw; struct slave *tx_slave = NULL; @@ -736,8 +711,7 @@ rlb_arp_xmit(struct sk_buff *skb, struct } /* Caller must hold bond lock for read */ -static void -rlb_rebalance(struct bonding *bond) +static void rlb_rebalance(struct bonding *bond) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct slave *assigned_slave = NULL; @@ -766,16 +740,14 @@ rlb_rebalance(struct bonding *bond) } /* Caller must hold rx_hashtbl lock */ -static inline void -rlb_init_table_entry(struct rlb_client_info *entry) +static void rlb_init_table_entry(struct rlb_client_info *entry) { memset(entry, 0, sizeof(struct rlb_client_info)); entry->next = RLB_NULL_INDEX; entry->prev = RLB_NULL_INDEX; } -static int -rlb_initialize(struct bonding *bond) +static int rlb_initialize(struct bonding *bond) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct packet_type *pk_type = &(BOND_ALB_INFO(bond).rlb_pkt_type); @@ -815,8 +787,7 @@ rlb_initialize(struct bonding *bond) return 0; } -static void -rlb_deinitialize(struct bonding *bond) +static void rlb_deinitialize(struct bonding *bond) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); @@ -830,8 +801,7 @@ rlb_deinitialize(struct bonding *bond) /*********************** tlb/rlb shared functions *********************/ -static void -alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) +static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) { struct sk_buff *skb = NULL; struct learning_pkt pkt; @@ -867,8 +837,7 @@ alb_send_learning_packets(struct slave * * set the hw address of the device as well as the hw address of the * net_device */ -static int -alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw) +static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw) { struct net_device *dev = NULL; struct sockaddr s_addr; @@ -897,10 +866,7 @@ alb_set_slave_mac_addr(struct slave *sla } /* Caller must hold bond lock for write or ptrlock for write*/ -static void -alb_swap_mac_addr(struct bonding *bond, - struct slave *slave1, - struct slave *slave2) +static void alb_swap_mac_addr(struct bonding *bond, struct slave *slave1, struct slave *slave2) { u8 tmp_mac_addr[ETH_ALEN]; struct slave *disabled_slave = NULL; @@ -960,8 +926,7 @@ alb_swap_mac_addr(struct bonding *bond, * * Caller must hold bond lock */ -static void -alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *slave) +static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *slave) { struct slave *tmp_slave; int perm_curr_diff; @@ -1015,8 +980,7 @@ alb_change_hw_addr_on_detach(struct bond * caller must hold the bond lock for write since the mac addresses are compared * and may be swapped. */ -static int -alb_handle_addr_collision_on_attach(struct bonding *bond, struct slave *slave) +static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slave *slave) { struct slave *tmp_slave1, *tmp_slave2, *free_mac_slave; int i, j, found = 0; @@ -1110,8 +1074,7 @@ alb_handle_addr_collision_on_attach(stru * * Unwinding assumes bond's mac address has not yet changed. */ -static inline int -alb_set_mac_address(struct bonding *bond, void *addr) +static int alb_set_mac_address(struct bonding *bond, void *addr) { struct sockaddr sa; struct slave *slave, *stop_at; @@ -1161,8 +1124,7 @@ unwind: /************************ exported alb funcions ************************/ -int -bond_alb_initialize(struct bonding *bond, int rlb_enabled) +int bond_alb_initialize(struct bonding *bond, int rlb_enabled) { int res; @@ -1184,8 +1146,7 @@ bond_alb_initialize(struct bonding *bond return 0; } -void -bond_alb_deinitialize(struct bonding *bond) +void bond_alb_deinitialize(struct bonding *bond) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); @@ -1196,8 +1157,7 @@ bond_alb_deinitialize(struct bonding *bo } } -int -bond_alb_xmit(struct sk_buff *skb, struct net_device *dev) +int bond_alb_xmit(struct sk_buff *skb, struct net_device *dev) { struct bonding *bond = (struct bonding *)dev->priv; struct ethhdr *eth_data = (struct ethhdr *)skb->data; @@ -1315,8 +1275,7 @@ bond_alb_xmit(struct sk_buff *skb, struc return 0; } -void -bond_alb_monitor(struct bonding *bond) +void bond_alb_monitor(struct bonding *bond) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct slave *slave = NULL; @@ -1422,8 +1381,7 @@ out: /* assumption: called before the slave is attched to the bond * and not locked by the bond lock */ -int -bond_alb_init_slave(struct bonding *bond, struct slave *slave) +int bond_alb_init_slave(struct bonding *bond, struct slave *slave) { int err = 0; @@ -1459,8 +1417,7 @@ bond_alb_init_slave(struct bonding *bond } /* Caller must hold bond lock for write */ -void -bond_alb_deinit_slave(struct bonding *bond, struct slave *slave) +void bond_alb_deinit_slave(struct bonding *bond, struct slave *slave) { if (bond->slave_cnt > 1) { alb_change_hw_addr_on_detach(bond, slave); @@ -1475,9 +1432,7 @@ bond_alb_deinit_slave(struct bonding *bo } /* Caller must hold bond lock for read */ -void -bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, - char link) +void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char link) { struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); @@ -1501,7 +1456,7 @@ bond_alb_handle_link_change(struct bondi } /** - * bond_alb_assign_current_slave - assign new current_slave + * bond_alb_handle_active_change - assign new current_slave * @bond: our bonding struct * @new_slave: new slave to assign * @@ -1510,8 +1465,7 @@ bond_alb_handle_link_change(struct bondi * * Caller must hold bond ptrlock for write (or bond lock for write) */ -void -bond_alb_assign_current_slave(struct bonding *bond, struct slave *new_slave) +void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave) { struct slave *swap_slave = bond->current_slave; int i, found = 0; @@ -1559,8 +1513,7 @@ bond_alb_assign_current_slave(struct bon } } -int -bond_alb_set_mac_address(struct net_device *dev, void *addr) +int bond_alb_set_mac_address(struct net_device *dev, void *addr) { struct bonding *bond = (struct bonding *)dev->priv; struct sockaddr *sa = addr; diff -Nuarp a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h --- a/drivers/net/bonding/bond_alb.h Sun Dec 21 16:08:49 2003 +++ b/drivers/net/bonding/bond_alb.h Sun Dec 21 16:08:49 2003 @@ -126,7 +126,7 @@ void bond_alb_deinitialize(struct bondin int bond_alb_init_slave(struct bonding *bond, struct slave *slave); void bond_alb_deinit_slave(struct bonding *bond, struct slave *slave); void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char link); -void bond_alb_assign_current_slave(struct bonding *bond, struct slave *new_slave); +void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave); int bond_alb_xmit(struct sk_buff *skb, struct net_device *dev); void bond_alb_monitor(struct bonding *bond); int bond_alb_set_mac_address(struct net_device *dev, void *addr); diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Sun Dec 21 16:08:49 2003 +++ b/drivers/net/bonding/bond_main.c Sun Dec 21 16:08:49 2003 @@ -577,27 +577,27 @@ static int bond_xmit_xor(struct sk_buff static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *dev); static struct net_device_stats *bond_get_stats(struct net_device *dev); static void bond_mii_monitor(struct net_device *dev); -static void loadbalance_arp_monitor(struct net_device *dev); -static void activebackup_arp_monitor(struct net_device *dev); +static void bond_loadbalance_arp_mon(struct net_device *dev); +static void bond_activebackup_arp_mon(struct net_device *dev); static void bond_mc_list_destroy(struct bonding *bond); static void bond_mc_add(struct bonding *bond, void *addr, int alen); static void bond_mc_delete(struct bonding *bond, void *addr, int alen); -static int bond_mc_list_copy (struct dev_mc_list *src, struct bonding *dst, int gpf_flag); -static inline int dmi_same(struct dev_mc_list *dmi1, struct dev_mc_list *dmi2); +static int bond_mc_list_copy(struct dev_mc_list *src, struct bonding *dst, int gpf_flag); +static inline int bond_is_dmi_same(struct dev_mc_list *dmi1, struct dev_mc_list *dmi2); static void bond_set_promiscuity(struct bonding *bond, int inc); static void bond_set_allmulti(struct bonding *bond, int inc); static struct dev_mc_list *bond_mc_list_find_dmi(struct dev_mc_list *dmi, struct dev_mc_list *mc_list); -static void bond_mc_update(struct bonding *bond, struct slave *new, struct slave *old); +static void bond_mc_swap(struct bonding *bond, struct slave *new, struct slave *old); static int bond_enslave(struct net_device *master, struct net_device *slave); static int bond_release(struct net_device *master, struct net_device *slave); static int bond_release_all(struct net_device *master); static int bond_sethwaddr(struct net_device *master, struct net_device *slave); -static void change_active_interface(struct bonding *bond, struct slave *new); -static void reselect_active_interface(struct bonding *bond); -static struct slave *find_best_interface(struct bonding *bond); +static void bond_change_active_slave(struct bonding *bond, struct slave *new); +static void bond_select_active_slave(struct bonding *bond); +static struct slave *bond_find_best_slave(struct bonding *bond); -static void arp_send_all(struct slave *slave) +static void bond_arp_send_all(struct slave *slave) { int i; @@ -609,8 +609,7 @@ static void arp_send_all(struct slave *s } -static const char * -bond_mode_name(void) +static const char *bond_mode_name(void) { switch (bond_mode) { case BOND_MODE_ROUNDROBIN : @@ -654,8 +653,7 @@ void bond_set_slave_active_flags(struct * * bond->lock held for writing by caller. */ -static void -bond_detach_slave(struct bonding *bond, struct slave *slave) +static void bond_detach_slave(struct bonding *bond, struct slave *slave) { if (slave->next) { slave->next->prev = slave->prev; @@ -683,8 +681,7 @@ bond_detach_slave(struct bonding *bond, * * bond->lock held for writing by caller. */ -static void -bond_attach_slave(struct bonding *bond, struct slave *new_slave) +static void bond_attach_slave(struct bonding *bond, struct slave *new_slave) { if (bond->first_slave == NULL) { /* attaching the first slave */ new_slave->next = new_slave; @@ -783,8 +780,7 @@ err_out: * It'd be nice if there was a good way to tell if a driver supports * netif_carrier, but there really isn't. */ -static int -bond_check_dev_link(struct net_device *dev, int reporting) +static int bond_check_dev_link(struct net_device *dev, int reporting) { static int (* ioctl)(struct net_device *, struct ifreq *, int); struct ifreq ifr; @@ -903,9 +899,9 @@ static int bond_open(struct net_device * arp_timer->expires = jiffies + 1; arp_timer->data = (unsigned long)dev; if (bond_mode == BOND_MODE_ACTIVEBACKUP) { - arp_timer->function = (void *)&activebackup_arp_monitor; + arp_timer->function = (void *)&bond_activebackup_arp_mon; } else { - arp_timer->function = (void *)&loadbalance_arp_monitor; + arp_timer->function = (void *)&bond_loadbalance_arp_mon; } add_timer(arp_timer); } @@ -931,7 +927,7 @@ static int bond_close(struct net_device write_lock_bh(&bond->lock); - bond_mc_list_destroy (bond); + bond_mc_list_destroy(bond); if (bond_mode == BOND_MODE_8023AD) { /* Unregister the receive of LACPDUs */ @@ -1055,8 +1051,7 @@ static void bond_mc_delete(struct bondin /* * Copy all the Multicast addresses from src to the bonding device dst */ -static int bond_mc_list_copy (struct dev_mc_list *src, struct bonding *dst, - int gpf_flag) +static int bond_mc_list_copy(struct dev_mc_list *src, struct bonding *dst, int gpf_flag) { struct dev_mc_list *dmi, *new_dmi; @@ -1081,7 +1076,7 @@ static int bond_mc_list_copy (struct dev /* * Returns 0 if dmi1 and dmi2 are the same, non-0 otherwise */ -static inline int dmi_same(struct dev_mc_list *dmi1, struct dev_mc_list *dmi2) +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; @@ -1128,20 +1123,19 @@ static void bond_set_allmulti(struct bon /* * 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) +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 != NULL; idmi = idmi->next) { - if (dmi_same(dmi, idmi)) { + if (bond_is_dmi_same(dmi, idmi)) { return idmi; } } return NULL; } -static void set_multicast_list(struct net_device *master) +static void bond_set_multicast_list(struct net_device *master) { struct bonding *bond = (struct bonding *)master->priv; struct dev_mc_list *dmi; @@ -1180,8 +1174,8 @@ static void set_multicast_list(struct ne /* save master's multicast list */ - bond_mc_list_destroy (bond); - bond_mc_list_copy (master->mc_list, bond, GFP_ATOMIC); + bond_mc_list_destroy(bond); + bond_mc_list_copy(master->mc_list, bond, GFP_ATOMIC); write_unlock_bh(&bond->lock); } @@ -1191,7 +1185,7 @@ static void set_multicast_list(struct ne * old active slaves (if any) according to the multicast mode, and * promiscuous flags unconditionally. */ -static void bond_mc_update(struct bonding *bond, struct slave *new, struct slave *old) +static void bond_mc_swap(struct bonding *bond, struct slave *new, struct slave *old) { struct dev_mc_list *dmi; @@ -1228,8 +1222,7 @@ static void bond_mc_update(struct bondin } /* enslave device to bond device */ -static int bond_enslave(struct net_device *master_dev, - struct net_device *slave_dev) +static int bond_enslave(struct net_device *master_dev, struct net_device *slave_dev) { struct bonding *bond = NULL; struct slave *new_slave = NULL; @@ -1485,7 +1478,7 @@ static int bond_enslave(struct net_devic dprintk("This is the first active slave\n"); /* first slave or no active slave yet, and this link is OK, so make this interface the active one */ - change_active_interface(bond, new_slave); + bond_change_active_slave(bond, new_slave); } else { dprintk("This is just a backup slave\n"); @@ -1520,7 +1513,7 @@ static int bond_enslave(struct net_devic /* first slave or no active slave yet, and this link * is OK, so make this interface the active one */ - change_active_interface(bond, new_slave); + bond_change_active_slave(bond, new_slave); } break; default: @@ -1609,7 +1602,7 @@ err_free: * In these cases, this fuction does nothing. * In the other cases, currnt_slave pointer is changed and 0 is returned. */ -static int bond_change_active(struct net_device *master_dev, struct net_device *slave_dev) +static int bond_ioctl_change_active(struct net_device *master_dev, struct net_device *slave_dev) { struct bonding *bond; struct slave *oldactive = NULL; @@ -1641,7 +1634,7 @@ static int bond_change_active(struct net (oldactive != NULL)&& (newactive->link == BOND_LINK_UP)&& IS_UP(newactive->dev)) { - change_active_interface(bond, newactive); + bond_change_active_slave(bond, newactive); } else { ret = -EINVAL; } @@ -1655,7 +1648,7 @@ static int bond_change_active(struct net * * Warning: Caller must hold ptrlock for writing. */ -static struct slave *find_best_interface(struct bonding *bond) +static struct slave *bond_find_best_slave(struct bonding *bond) { struct slave *newslave, *oldslave; struct slave *bestslave = NULL; @@ -1720,7 +1713,7 @@ static struct slave *find_best_interface * * Warning: Caller must hold ptrlock for writing. */ -static void change_active_interface(struct bonding *bond, struct slave *new) +static void bond_change_active_slave(struct bonding *bond, struct slave *new) { struct slave *old = bond->current_slave; @@ -1771,12 +1764,12 @@ static void change_active_interface(stru } if (USES_PRIMARY(bond_mode)) { - bond_mc_update(bond, new, old); + bond_mc_swap(bond, new, old); } if ((bond_mode == BOND_MODE_TLB) || (bond_mode == BOND_MODE_ALB)) { - bond_alb_assign_current_slave(bond, new); + bond_alb_handle_active_change(bond, new); } else { bond->current_slave = new; } @@ -1793,14 +1786,14 @@ static void change_active_interface(stru * * Warning: Caller must hold ptrlock for writing. */ -static void reselect_active_interface(struct bonding *bond) +static void bond_select_active_slave(struct bonding *bond) { struct slave *best_slave; - best_slave = find_best_interface(bond); + best_slave = bond_find_best_slave(bond); if (best_slave != bond->current_slave) { - change_active_interface(bond, best_slave); + bond_change_active_slave(bond, best_slave); } } @@ -1890,8 +1883,8 @@ static int bond_release(struct net_devic } if (bond->current_slave == our_slave) { - change_active_interface(bond, NULL); - reselect_active_interface(bond); + bond_change_active_slave(bond, NULL); + bond_select_active_slave(bond); } if (bond->current_slave == NULL) { @@ -1983,7 +1976,7 @@ static int bond_release_all(struct net_d bond->current_arp_slave = NULL; bond->primary_slave = NULL; - change_active_interface(bond, NULL); + bond_change_active_slave(bond, NULL); while ((our_slave = bond->first_slave) != NULL) { /* Inform AD package of unbinding of slave @@ -2283,7 +2276,7 @@ static void bond_mii_monitor(struct net_ if (do_failover) { write_lock(&bond->ptrlock); - reselect_active_interface(bond); + bond_select_active_slave(bond); if (oldcurrent && !bond->current_slave) { printk(KERN_INFO DRV_NAME ": %s: now running without any active " @@ -2307,7 +2300,7 @@ out: * arp is transmitted to generate traffic. see activebackup_arp_monitor for * arp monitoring in active backup mode. */ -static void loadbalance_arp_monitor(struct net_device *master) +static void bond_loadbalance_arp_mon(struct net_device *master) { struct bonding *bond = (struct bonding *)master->priv; struct slave *slave, *oldcurrent; @@ -2403,14 +2396,14 @@ static void loadbalance_arp_monitor(stru * to be unstable during low/no traffic periods */ if (IS_UP(slave->dev)) { - arp_send_all(slave); + bond_arp_send_all(slave); } } if (do_failover) { write_lock(&bond->ptrlock); - reselect_active_interface(bond); + bond_select_active_slave(bond); if (oldcurrent && !bond->current_slave) { printk(KERN_INFO DRV_NAME ": %s: now running without any active " @@ -2442,7 +2435,7 @@ out: * may have received. * see loadbalance_arp_monitor for arp monitoring in load balancing mode */ -static void activebackup_arp_monitor(struct net_device *master) +static void bond_activebackup_arp_mon(struct net_device *master) { struct bonding *bond = (struct bonding *)master->priv; struct slave *slave; @@ -2475,7 +2468,7 @@ static void activebackup_arp_monitor(str if ((bond->current_slave == NULL) && ((jiffies - slave->dev->trans_start) <= the_delta_in_ticks)) { - change_active_interface(bond, slave); + bond_change_active_slave(bond, slave); bond->current_arp_slave = NULL; } else if (bond->current_slave != slave) { /* this slave has just come up but we @@ -2566,7 +2559,7 @@ static void activebackup_arp_monitor(str master->name, slave->dev->name); write_lock(&bond->ptrlock); - reselect_active_interface(bond); + bond_select_active_slave(bond); slave = bond->current_slave; write_unlock(&bond->ptrlock); bond->current_arp_slave = slave; @@ -2587,7 +2580,7 @@ static void activebackup_arp_monitor(str /* primary is up so switch to it */ write_lock(&bond->ptrlock); - change_active_interface(bond, bond->primary_slave); + bond_change_active_slave(bond, bond->primary_slave); write_unlock(&bond->ptrlock); slave = bond->primary_slave; slave->jiffies = jiffies; @@ -2599,7 +2592,7 @@ static void activebackup_arp_monitor(str * rx traffic */ if ((slave != NULL) && (my_ip != 0)) { - arp_send_all(slave); + bond_arp_send_all(slave); } } @@ -2621,7 +2614,7 @@ static void activebackup_arp_monitor(str if (IS_UP(slave->dev)) { slave->link = BOND_LINK_BACK; bond_set_slave_active_flags(slave); - arp_send_all(slave); + bond_arp_send_all(slave); slave->jiffies = jiffies; bond->current_arp_slave = slave; break; @@ -2681,8 +2674,7 @@ static int bond_info_query(struct net_de return 0; } -static int bond_slave_info_query(struct net_device *master, - struct ifslave *info) +static int bond_slave_info_query(struct net_device *master, struct ifslave *info) { struct bonding *bond = (struct bonding *)master->priv; struct slave *slave; @@ -2766,7 +2758,7 @@ static int bond_ethtool_ioctl(struct net } } -static int bond_ioctl(struct net_device *master_dev, struct ifreq *ifr, int cmd) +static int bond_do_ioctl(struct net_device *master_dev, struct ifreq *ifr, int cmd) { struct net_device *slave_dev = NULL; struct ifbond *u_binfo = NULL, k_binfo; @@ -2881,7 +2873,7 @@ static int bond_ioctl(struct net_device case BOND_CHANGE_ACTIVE_OLD: case SIOCBONDCHANGEACTIVE: if (USES_PRIMARY(bond_mode)) { - ret = bond_change_active(master_dev, slave_dev); + ret = bond_ioctl_change_active(master_dev, slave_dev); } else { ret = -EINVAL; @@ -3350,7 +3342,7 @@ static struct file_operations bond_info_ .release = seq_release, }; -static int bond_create_proc_info(struct bonding *bond) +static int bond_create_proc_entry(struct bonding *bond) { struct net_device *dev = bond->device; @@ -3373,7 +3365,7 @@ static int bond_create_proc_info(struct return 0; } -static void bond_destroy_proc_info(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); @@ -3446,8 +3438,7 @@ static void bond_destroy_proc_dir(void) * downing the master releases all slaves. We can make bonds full of * bonding devices to test this, however. */ -static inline int -bond_set_mac_address(struct net_device *dev, void *addr) +static int bond_set_mac_address(struct net_device *dev, void *addr) { struct bonding *bond = (struct bonding *)dev->priv; struct sockaddr *sa = addr, tmp_sa; @@ -3523,8 +3514,7 @@ unwind: /* * Change the MTU of all of a master's slaves to match the master */ -static inline int -bond_change_mtu(struct net_device *dev, int newmtu) +static int bond_change_mtu(struct net_device *dev, int newmtu) { struct bonding *bond = (struct bonding *)dev->priv; struct slave *slave, *stop_at; @@ -3594,11 +3584,11 @@ unwind: /* * Change device name */ -static inline int bond_event_changename(struct bonding *bond) +static int bond_event_changename(struct bonding *bond) { #ifdef CONFIG_PROC_FS - bond_destroy_proc_info(bond); - bond_create_proc_info(bond); + bond_remove_proc_entry(bond); + bond_create_proc_entry(bond); #endif return NOTIFY_DONE; @@ -3714,7 +3704,7 @@ static inline void bond_deinit(struct ne list_del(&bond->bond_list); #ifdef CONFIG_PROC_FS - bond_destroy_proc_info(bond); + bond_remove_proc_entry(bond); #endif } @@ -3796,8 +3786,8 @@ static int __init bond_init(struct net_d dev->get_stats = bond_get_stats; dev->open = bond_open; dev->stop = bond_close; - dev->set_multicast_list = set_multicast_list; - dev->do_ioctl = bond_ioctl; + dev->set_multicast_list = bond_set_multicast_list; + dev->do_ioctl = bond_do_ioctl; dev->change_mtu = bond_change_mtu; dev->tx_queue_len = 0; dev->flags |= IFF_MASTER|IFF_MULTICAST; @@ -3827,7 +3817,7 @@ static int __init bond_init(struct net_d } #ifdef CONFIG_PROC_FS - bond_create_proc_info(bond); + bond_create_proc_entry(bond); #endif list_add_tail(&bond->bond_list, &bond_dev_list); @@ -3839,8 +3829,7 @@ static int __init bond_init(struct net_d * Convert string input module parms. Accept either the * number of the mode or its string name. */ -static inline int -bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl) +static inline int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl) { int i; diff -Nuarp a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h --- a/drivers/net/bonding/bonding.h Sun Dec 21 16:08:49 2003 +++ b/drivers/net/bonding/bonding.h Sun Dec 21 16:08:49 2003 @@ -121,8 +121,8 @@ struct bonding { * Caller must hold bond->lock */ #define bond_for_each_slave_from(bond, pos, cnt, start) \ - for (cnt = 0, pos = start; \ - cnt < (bond)->slave_cnt; \ + for (cnt = 0, pos = start; \ + cnt < (bond)->slave_cnt; \ cnt++, pos = (pos)->next) /** @@ -156,8 +156,7 @@ struct bonding { * * Caller must hold bond lock for read */ -extern inline struct slave * -bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev) +extern inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev) { struct slave *slave = NULL; int i; @@ -171,8 +170,7 @@ bond_get_slave_by_dev(struct bonding *bo return slave; } -extern inline struct bonding * -bond_get_bond_by_slave(struct slave *slave) +extern inline struct bonding *bond_get_bond_by_slave(struct slave *slave) { if (!slave || !slave->dev->master) { return NULL;