diff options
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r-- | drivers/net/bonding/bonding.h | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 2b0fdec695f7..b8bdd0acc8f3 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -188,8 +188,9 @@ struct slave { | |||
188 | struct net_device *dev; /* first - useful for panic debug */ | 188 | struct net_device *dev; /* first - useful for panic debug */ |
189 | struct bonding *bond; /* our master */ | 189 | struct bonding *bond; /* our master */ |
190 | int delay; | 190 | int delay; |
191 | unsigned long jiffies; | 191 | /* all three in jiffies */ |
192 | unsigned long last_arp_rx; | 192 | unsigned long last_link_up; |
193 | unsigned long last_rx; | ||
193 | unsigned long target_last_arp_rx[BOND_MAX_ARP_TARGETS]; | 194 | unsigned long target_last_arp_rx[BOND_MAX_ARP_TARGETS]; |
194 | s8 link; /* one of BOND_LINK_XXXX */ | 195 | s8 link; /* one of BOND_LINK_XXXX */ |
195 | s8 new_link; | 196 | s8 new_link; |
@@ -265,6 +266,11 @@ struct bonding { | |||
265 | #define bond_slave_get_rtnl(dev) \ | 266 | #define bond_slave_get_rtnl(dev) \ |
266 | ((struct slave *) rtnl_dereference(dev->rx_handler_data)) | 267 | ((struct slave *) rtnl_dereference(dev->rx_handler_data)) |
267 | 268 | ||
269 | struct bond_vlan_tag { | ||
270 | __be16 vlan_proto; | ||
271 | unsigned short vlan_id; | ||
272 | }; | ||
273 | |||
268 | /** | 274 | /** |
269 | * Returns NULL if the net_device does not belong to any of the bond's slaves | 275 | * Returns NULL if the net_device does not belong to any of the bond's slaves |
270 | * | 276 | * |
@@ -292,7 +298,7 @@ static inline void bond_set_active_slave(struct slave *slave) | |||
292 | { | 298 | { |
293 | if (slave->backup) { | 299 | if (slave->backup) { |
294 | slave->backup = 0; | 300 | slave->backup = 0; |
295 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_KERNEL); | 301 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); |
296 | } | 302 | } |
297 | } | 303 | } |
298 | 304 | ||
@@ -300,7 +306,7 @@ static inline void bond_set_backup_slave(struct slave *slave) | |||
300 | { | 306 | { |
301 | if (!slave->backup) { | 307 | if (!slave->backup) { |
302 | slave->backup = 1; | 308 | slave->backup = 1; |
303 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_KERNEL); | 309 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); |
304 | } | 310 | } |
305 | } | 311 | } |
306 | 312 | ||
@@ -312,7 +318,7 @@ static inline void bond_set_slave_state(struct slave *slave, | |||
312 | 318 | ||
313 | slave->backup = slave_state; | 319 | slave->backup = slave_state; |
314 | if (notify) { | 320 | if (notify) { |
315 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_KERNEL); | 321 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); |
316 | slave->should_notify = 0; | 322 | slave->should_notify = 0; |
317 | } else { | 323 | } else { |
318 | if (slave->should_notify) | 324 | if (slave->should_notify) |
@@ -342,7 +348,7 @@ static inline void bond_slave_state_notify(struct bonding *bond) | |||
342 | 348 | ||
343 | bond_for_each_slave(bond, tmp, iter) { | 349 | bond_for_each_slave(bond, tmp, iter) { |
344 | if (tmp->should_notify) { | 350 | if (tmp->should_notify) { |
345 | rtmsg_ifinfo(RTM_NEWLINK, tmp->dev, 0, GFP_KERNEL); | 351 | rtmsg_ifinfo(RTM_NEWLINK, tmp->dev, 0, GFP_ATOMIC); |
346 | tmp->should_notify = 0; | 352 | tmp->should_notify = 0; |
347 | } | 353 | } |
348 | } | 354 | } |
@@ -374,6 +380,11 @@ static inline bool bond_is_active_slave(struct slave *slave) | |||
374 | #define BOND_ARP_VALIDATE_BACKUP (1 << BOND_STATE_BACKUP) | 380 | #define BOND_ARP_VALIDATE_BACKUP (1 << BOND_STATE_BACKUP) |
375 | #define BOND_ARP_VALIDATE_ALL (BOND_ARP_VALIDATE_ACTIVE | \ | 381 | #define BOND_ARP_VALIDATE_ALL (BOND_ARP_VALIDATE_ACTIVE | \ |
376 | BOND_ARP_VALIDATE_BACKUP) | 382 | BOND_ARP_VALIDATE_BACKUP) |
383 | #define BOND_ARP_FILTER (BOND_ARP_VALIDATE_ALL + 1) | ||
384 | #define BOND_ARP_FILTER_ACTIVE (BOND_ARP_VALIDATE_ACTIVE | \ | ||
385 | BOND_ARP_FILTER) | ||
386 | #define BOND_ARP_FILTER_BACKUP (BOND_ARP_VALIDATE_BACKUP | \ | ||
387 | BOND_ARP_FILTER) | ||
377 | 388 | ||
378 | #define BOND_SLAVE_NOTIFY_NOW true | 389 | #define BOND_SLAVE_NOTIFY_NOW true |
379 | #define BOND_SLAVE_NOTIFY_LATER false | 390 | #define BOND_SLAVE_NOTIFY_LATER false |
@@ -384,6 +395,12 @@ static inline int slave_do_arp_validate(struct bonding *bond, | |||
384 | return bond->params.arp_validate & (1 << bond_slave_state(slave)); | 395 | return bond->params.arp_validate & (1 << bond_slave_state(slave)); |
385 | } | 396 | } |
386 | 397 | ||
398 | static inline int slave_do_arp_validate_only(struct bonding *bond, | ||
399 | struct slave *slave) | ||
400 | { | ||
401 | return bond->params.arp_validate & BOND_ARP_FILTER; | ||
402 | } | ||
403 | |||
387 | /* Get the oldest arp which we've received on this slave for bond's | 404 | /* Get the oldest arp which we've received on this slave for bond's |
388 | * arp_targets. | 405 | * arp_targets. |
389 | */ | 406 | */ |
@@ -403,14 +420,10 @@ static inline unsigned long slave_oldest_target_arp_rx(struct bonding *bond, | |||
403 | static inline unsigned long slave_last_rx(struct bonding *bond, | 420 | static inline unsigned long slave_last_rx(struct bonding *bond, |
404 | struct slave *slave) | 421 | struct slave *slave) |
405 | { | 422 | { |
406 | if (slave_do_arp_validate(bond, slave)) { | 423 | if (bond->params.arp_all_targets == BOND_ARP_TARGETS_ALL) |
407 | if (bond->params.arp_all_targets == BOND_ARP_TARGETS_ALL) | 424 | return slave_oldest_target_arp_rx(bond, slave); |
408 | return slave_oldest_target_arp_rx(bond, slave); | ||
409 | else | ||
410 | return slave->last_arp_rx; | ||
411 | } | ||
412 | 425 | ||
413 | return slave->dev->last_rx; | 426 | return slave->last_rx; |
414 | } | 427 | } |
415 | 428 | ||
416 | #ifdef CONFIG_NET_POLL_CONTROLLER | 429 | #ifdef CONFIG_NET_POLL_CONTROLLER |
@@ -487,8 +500,6 @@ void bond_sysfs_slave_del(struct slave *slave); | |||
487 | int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev); | 500 | int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev); |
488 | int bond_release(struct net_device *bond_dev, struct net_device *slave_dev); | 501 | int bond_release(struct net_device *bond_dev, struct net_device *slave_dev); |
489 | int bond_xmit_hash(struct bonding *bond, struct sk_buff *skb, int count); | 502 | int bond_xmit_hash(struct bonding *bond, struct sk_buff *skb, int count); |
490 | int bond_parse_parm(const char *mode_arg, const struct bond_parm_tbl *tbl); | ||
491 | int bond_parm_tbl_lookup(int mode, const struct bond_parm_tbl *tbl); | ||
492 | void bond_select_active_slave(struct bonding *bond); | 503 | void bond_select_active_slave(struct bonding *bond); |
493 | void bond_change_active_slave(struct bonding *bond, struct slave *new_active); | 504 | void bond_change_active_slave(struct bonding *bond, struct slave *new_active); |
494 | void bond_create_debugfs(void); | 505 | void bond_create_debugfs(void); |
@@ -501,8 +512,6 @@ void bond_setup(struct net_device *bond_dev); | |||
501 | unsigned int bond_get_num_tx_queues(void); | 512 | unsigned int bond_get_num_tx_queues(void); |
502 | int bond_netlink_init(void); | 513 | int bond_netlink_init(void); |
503 | void bond_netlink_fini(void); | 514 | void bond_netlink_fini(void); |
504 | int bond_option_arp_ip_target_add(struct bonding *bond, __be32 target); | ||
505 | int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target); | ||
506 | struct net_device *bond_option_active_slave_get_rcu(struct bonding *bond); | 515 | struct net_device *bond_option_active_slave_get_rcu(struct bonding *bond); |
507 | struct net_device *bond_option_active_slave_get(struct bonding *bond); | 516 | struct net_device *bond_option_active_slave_get(struct bonding *bond); |
508 | const char *bond_slave_link_status(s8 link); | 517 | const char *bond_slave_link_status(s8 link); |