aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bonding.h
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2009-09-24 23:28:09 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-07 04:07:39 -0400
commita549952ad323d68daf5b50bf716db895479af84c (patch)
treec819e8c33701696115c3d60b12ca95a0cd792291 /drivers/net/bonding/bonding.h
parent2d37a186cedc51502dbee71c16ae0fbd9114d62c (diff)
bonding: introduce primary_reselect option
In some cases there is not desirable to switch back to primary interface when it's link recovers and rather stay with currently active one. We need to avoid packetloss as much as we can in some cases. This is solved by introducing primary_reselect option. Note that enslaved primary slave is set as current active no matter what. Patch modified by Jay Vosburgh as follows: fixed bug in action after change of option setting via sysfs, revised the documentation update, and bumped the bonding version number. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r--drivers/net/bonding/bonding.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 68247714466f..9c03c2ee074d 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -23,8 +23,8 @@
23#include "bond_3ad.h" 23#include "bond_3ad.h"
24#include "bond_alb.h" 24#include "bond_alb.h"
25 25
26#define DRV_VERSION "3.5.0" 26#define DRV_VERSION "3.6.0"
27#define DRV_RELDATE "November 4, 2008" 27#define DRV_RELDATE "September 26, 2009"
28#define DRV_NAME "bonding" 28#define DRV_NAME "bonding"
29#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" 29#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver"
30 30
@@ -131,6 +131,7 @@ struct bond_params {
131 int lacp_fast; 131 int lacp_fast;
132 int ad_select; 132 int ad_select;
133 char primary[IFNAMSIZ]; 133 char primary[IFNAMSIZ];
134 int primary_reselect;
134 __be32 arp_targets[BOND_MAX_ARP_TARGETS]; 135 __be32 arp_targets[BOND_MAX_ARP_TARGETS];
135}; 136};
136 137
@@ -190,6 +191,7 @@ struct bonding {
190 struct slave *curr_active_slave; 191 struct slave *curr_active_slave;
191 struct slave *current_arp_slave; 192 struct slave *current_arp_slave;
192 struct slave *primary_slave; 193 struct slave *primary_slave;
194 bool force_primary;
193 s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ 195 s32 slave_cnt; /* never change this value outside the attach/detach wrappers */
194 rwlock_t lock; 196 rwlock_t lock;
195 rwlock_t curr_slave_lock; 197 rwlock_t curr_slave_lock;
@@ -258,6 +260,10 @@ static inline bool bond_is_lb(const struct bonding *bond)
258 || bond->params.mode == BOND_MODE_ALB; 260 || bond->params.mode == BOND_MODE_ALB;
259} 261}
260 262
263#define BOND_PRI_RESELECT_ALWAYS 0
264#define BOND_PRI_RESELECT_BETTER 1
265#define BOND_PRI_RESELECT_FAILURE 2
266
261#define BOND_FOM_NONE 0 267#define BOND_FOM_NONE 0
262#define BOND_FOM_ACTIVE 1 268#define BOND_FOM_ACTIVE 1
263#define BOND_FOM_FOLLOW 2 269#define BOND_FOM_FOLLOW 2
@@ -348,6 +354,7 @@ extern const struct bond_parm_tbl bond_mode_tbl[];
348extern const struct bond_parm_tbl xmit_hashtype_tbl[]; 354extern const struct bond_parm_tbl xmit_hashtype_tbl[];
349extern const struct bond_parm_tbl arp_validate_tbl[]; 355extern const struct bond_parm_tbl arp_validate_tbl[];
350extern const struct bond_parm_tbl fail_over_mac_tbl[]; 356extern const struct bond_parm_tbl fail_over_mac_tbl[];
357extern const struct bond_parm_tbl pri_reselect_tbl[];
351extern struct bond_parm_tbl ad_select_tbl[]; 358extern struct bond_parm_tbl ad_select_tbl[];
352 359
353#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 360#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)