summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bonding.h
diff options
context:
space:
mode:
authorJay Vosburgh2008-05-18 06:10:13 +0200
committerJeff Garzik2008-05-22 12:34:28 +0200
commitb2220cad583c9b63e085476df448fa2aff5ea906 (patch)
tree73d2322a9e5edd2ef7f2e97f523162b57f3e8ebb /drivers/net/bonding/bonding.h
parentbonding: Send more than one gratuitous ARP when slave takes over (diff)
downloadkernel-qcow2-linux-b2220cad583c9b63e085476df448fa2aff5ea906.tar.gz
kernel-qcow2-linux-b2220cad583c9b63e085476df448fa2aff5ea906.tar.xz
kernel-qcow2-linux-b2220cad583c9b63e085476df448fa2aff5ea906.zip
bonding: refactor ARP active-backup monitor
Refactor ARP monitor for active-backup mode. The motivation for this is to take care of locking issues in a clear manner (particularly to correctly handle RTNL vs. the bonding locks). Currently, the a-b ARP monitor does not hold RTNL at all, but future changes will require RTNL during ARP monitor failovers. Rather than using conditional locking, this patch instead breaks up the ARP monitor into three discrete steps: inspection, commit changes, and probe. The inspection phase marks slaves that require link state changes. The commit phase is only called if inspection detects that changes are needed, and is called with RTNL. Lastly, the probe phase issues the ARP probes that the inspection phase uses to determine link state. Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r--drivers/net/bonding/bonding.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 46a2ed507b33..8766b1213690 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -158,6 +158,7 @@ struct slave {
unsigned long jiffies;
unsigned long last_arp_rx;
s8 link; /* one of BOND_LINK_XXXX */
+ s8 new_link;
s8 state; /* one of BOND_STATE_XXXX */
u32 original_flags;
u32 original_mtu;
@@ -170,6 +171,11 @@ struct slave {
};
/*
+ * Link pseudo-state only used internally by monitors
+ */
+#define BOND_LINK_NOCHANGE -1
+
+/*
* Here are the locking policies for the two bonding locks:
*
* 1) Get bond->lock when reading/writing slave list.