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

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

Change names/types for some of the members in struct bonding.
Change position of members.
parent 13d5d156
...@@ -363,9 +363,9 @@ mode ...@@ -363,9 +363,9 @@ mode
2. Base driver support for setting the hw address of a 2. Base driver support for setting the hw address of a
device also when it is open. This is required so that there device also when it is open. This is required so that there
will always be one slave in the team using the bond hw will always be one slave in the team using the bond hw
address (the current_slave) while having a unique hw address (the curr_active_slave) while having a unique hw
address for each slave in the bond. If the current_slave address for each slave in the bond. If the curr_active_slave
fails it's hw address is swapped with the new current_slave fails it's hw address is swapped with the new curr_active_slave
that was chosen. that was chosen.
primary primary
......
...@@ -1890,13 +1890,13 @@ static u16 aggregator_identifier; ...@@ -1890,13 +1890,13 @@ static u16 aggregator_identifier;
void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution, int lacp_fast) void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution, int lacp_fast)
{ {
// check that the bond is not initialized yet // check that the bond is not initialized yet
if (MAC_ADDRESS_COMPARE(&(BOND_AD_INFO(bond).system.sys_mac_addr), &(bond->device->dev_addr))) { if (MAC_ADDRESS_COMPARE(&(BOND_AD_INFO(bond).system.sys_mac_addr), &(bond->dev->dev_addr))) {
aggregator_identifier = 0; aggregator_identifier = 0;
BOND_AD_INFO(bond).lacp_fast = lacp_fast; BOND_AD_INFO(bond).lacp_fast = lacp_fast;
BOND_AD_INFO(bond).system.sys_priority = 0xFFFF; BOND_AD_INFO(bond).system.sys_priority = 0xFFFF;
BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->device->dev_addr); BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr);
// initialize how many times this module is called in one second(should be about every 100ms) // initialize how many times this module is called in one second(should be about every 100ms)
ad_ticks_per_sec = tick_resolution; ad_ticks_per_sec = tick_resolution;
...@@ -1964,7 +1964,7 @@ int bond_3ad_bind_slave(struct slave *slave) ...@@ -1964,7 +1964,7 @@ int bond_3ad_bind_slave(struct slave *slave)
ad_initialize_agg(aggregator); ad_initialize_agg(aggregator);
aggregator->aggregator_mac_address = *((struct mac_addr *)bond->device->dev_addr); aggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr);
aggregator->aggregator_identifier = (++aggregator_identifier); aggregator->aggregator_identifier = (++aggregator_identifier);
aggregator->slave = slave; aggregator->slave = slave;
aggregator->is_active = 0; aggregator->is_active = 0;
...@@ -2399,7 +2399,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) ...@@ -2399,7 +2399,7 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
return 0; return 0;
} }
slave_agg_no = (data->h_dest[5]^bond->device->dev_addr[5]) % slaves_in_agg; slave_agg_no = (data->h_dest[5]^bond->dev->dev_addr[5]) % slaves_in_agg;
bond_for_each_slave(bond, slave, i) { bond_for_each_slave(bond, slave, i) {
struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator; struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator;
......
This diff is collapsed.
This diff is collapsed.
...@@ -62,14 +62,14 @@ ...@@ -62,14 +62,14 @@
struct slave { struct slave {
struct net_device *dev; /* first - usefull for panic debug */
struct slave *next; struct slave *next;
struct slave *prev; struct slave *prev;
struct net_device *dev; s16 delay;
short delay; u32 jiffies;
unsigned long jiffies; s8 link; /* one of BOND_LINK_XXXX */
char link; /* one of BOND_LINK_XXXX */ s8 state; /* one of BOND_STATE_XXXX */
char state; /* one of BOND_STATE_XXXX */ u32 original_flags;
unsigned short original_flags;
u32 link_failure_count; u32 link_failure_count;
u16 speed; u16 speed;
u8 duplex; u8 duplex;
...@@ -82,31 +82,31 @@ struct slave { ...@@ -82,31 +82,31 @@ struct slave {
* Here are the locking policies for the two bonding locks: * Here are the locking policies for the two bonding locks:
* *
* 1) Get bond->lock when reading/writing slave list. * 1) Get bond->lock when reading/writing slave list.
* 2) Get bond->ptrlock when reading/writing bond->current_slave. * 2) Get bond->curr_slave_lock when reading/writing bond->curr_active_slave.
* (It is unnecessary when the write-lock is put with bond->lock.) * (It is unnecessary when the write-lock is put with bond->lock.)
* 3) When we lock with bond->ptrlock, we must lock with bond->lock * 3) When we lock with bond->curr_slave_lock, we must lock with bond->lock
* beforehand. * beforehand.
*/ */
struct bonding { struct bonding {
struct net_device *dev; /* first - usefull for panic debug */
struct slave *first_slave; struct slave *first_slave;
struct slave *current_slave; struct slave *curr_active_slave;
struct slave *primary_slave;
struct slave *current_arp_slave; struct slave *current_arp_slave;
int slave_cnt; /* never change this value outside the attach/detach wrappers */ struct slave *primary_slave;
s32 slave_cnt; /* never change this value outside the attach/detach wrappers */
rwlock_t lock; rwlock_t lock;
rwlock_t ptrlock; rwlock_t curr_slave_lock;
struct timer_list mii_timer; struct timer_list mii_timer;
struct timer_list arp_timer; struct timer_list arp_timer;
int kill_timers; s8 kill_timers;
struct net_device_stats stats; struct net_device_stats stats;
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
struct proc_dir_entry *bond_proc_file; struct proc_dir_entry *proc_entry;
char procdir_name[IFNAMSIZ]; char proc_file_name[IFNAMSIZ];
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_PROC_FS */
struct list_head bond_list; struct list_head bond_list;
struct net_device *device;
struct dev_mc_list *mc_list; struct dev_mc_list *mc_list;
unsigned short flags; u16 flags;
struct ad_bond_info ad_info; struct ad_bond_info ad_info;
struct alb_bond_info alb_info; struct alb_bond_info alb_info;
}; };
......
...@@ -86,9 +86,9 @@ typedef struct ifbond { ...@@ -86,9 +86,9 @@ typedef struct ifbond {
typedef struct ifslave typedef struct ifslave
{ {
__s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */ __s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */
char slave_name[IFNAMSIZ]; __s8 slave_name[IFNAMSIZ];
char link; __s8 link;
char state; __s8 state;
__u32 link_failure_count; __u32 link_failure_count;
} ifslave; } ifslave;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment