diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-04-18 23:48:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-25 15:00:30 -0400 |
commit | 3aba891dde3842d89ad022237b99c1ed308040b0 (patch) | |
tree | 7b89bcdc0362a1fdd50d74c3a8108f16fecfa5b1 /drivers/net/bonding | |
parent | 22d5969fb450afd3a4aff606360f7d52c5a3a628 (diff) |
bonding: move processing of recv handlers into handle_frame()
Since now when bonding uses rx_handler, all traffic going into bond
device goes thru bond_handle_frame. So there's no need to go back into
bonding code later via ptype handlers. This patch converts
original ptype handlers into "bonding receive probes". These functions
are called from bond_handle_frame and they are registered per-mode.
Note that vlan packets are also handled because they are always untagged
thanks to vlan_untag()
Note that this also allows arpmon for eth-bond-bridge-vlan topology.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 29 | ||||
-rw-r--r-- | drivers/net/bonding/bond_3ad.h | 4 | ||||
-rw-r--r-- | drivers/net/bonding/bond_alb.c | 46 | ||||
-rw-r--r-- | drivers/net/bonding/bond_alb.h | 1 | ||||
-rw-r--r-- | drivers/net/bonding/bond_main.c | 121 | ||||
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 6 | ||||
-rw-r--r-- | drivers/net/bonding/bonding.h | 4 |
7 files changed, 43 insertions, 168 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 123dd602261f..d0981c2ffbda 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -2465,35 +2465,16 @@ out: | |||
2465 | return NETDEV_TX_OK; | 2465 | return NETDEV_TX_OK; |
2466 | } | 2466 | } |
2467 | 2467 | ||
2468 | int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype, struct net_device *orig_dev) | 2468 | void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, |
2469 | struct slave *slave) | ||
2469 | { | 2470 | { |
2470 | struct bonding *bond = netdev_priv(dev); | 2471 | if (skb->protocol != PKT_TYPE_LACPDU) |
2471 | struct slave *slave = NULL; | 2472 | return; |
2472 | int ret = NET_RX_DROP; | ||
2473 | |||
2474 | if (!(dev->flags & IFF_MASTER)) | ||
2475 | goto out; | ||
2476 | |||
2477 | skb = skb_share_check(skb, GFP_ATOMIC); | ||
2478 | if (!skb) | ||
2479 | goto out; | ||
2480 | 2473 | ||
2481 | if (!pskb_may_pull(skb, sizeof(struct lacpdu))) | 2474 | if (!pskb_may_pull(skb, sizeof(struct lacpdu))) |
2482 | goto out; | 2475 | return; |
2483 | 2476 | ||
2484 | read_lock(&bond->lock); | 2477 | read_lock(&bond->lock); |
2485 | slave = bond_get_slave_by_dev(netdev_priv(dev), orig_dev); | ||
2486 | if (!slave) | ||
2487 | goto out_unlock; | ||
2488 | |||
2489 | bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len); | 2478 | bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len); |
2490 | |||
2491 | ret = NET_RX_SUCCESS; | ||
2492 | |||
2493 | out_unlock: | ||
2494 | read_unlock(&bond->lock); | 2479 | read_unlock(&bond->lock); |
2495 | out: | ||
2496 | dev_kfree_skb(skb); | ||
2497 | |||
2498 | return ret; | ||
2499 | } | 2480 | } |
diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h index b28baff70864..291dbd4d1f3d 100644 --- a/drivers/net/bonding/bond_3ad.h +++ b/drivers/net/bonding/bond_3ad.h | |||
@@ -258,7 +258,6 @@ struct ad_bond_info { | |||
258 | * requested | 258 | * requested |
259 | */ | 259 | */ |
260 | struct timer_list ad_timer; | 260 | struct timer_list ad_timer; |
261 | struct packet_type ad_pkt_type; | ||
262 | }; | 261 | }; |
263 | 262 | ||
264 | struct ad_slave_info { | 263 | struct ad_slave_info { |
@@ -280,7 +279,8 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave); | |||
280 | void bond_3ad_handle_link_change(struct slave *slave, char link); | 279 | void bond_3ad_handle_link_change(struct slave *slave, char link); |
281 | int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); | 280 | int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); |
282 | int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); | 281 | int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); |
283 | int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype, struct net_device *orig_dev); | 282 | void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, |
283 | struct slave *slave); | ||
284 | int bond_3ad_set_carrier(struct bonding *bond); | 284 | int bond_3ad_set_carrier(struct bonding *bond); |
285 | #endif //__BOND_3AD_H__ | 285 | #endif //__BOND_3AD_H__ |
286 | 286 | ||
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index ba715826e2a8..3b7b0409406f 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -308,49 +308,33 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp) | |||
308 | _unlock_rx_hashtbl(bond); | 308 | _unlock_rx_hashtbl(bond); |
309 | } | 309 | } |
310 | 310 | ||
311 | static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct packet_type *ptype, struct net_device *orig_dev) | 311 | static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond, |
312 | struct slave *slave) | ||
312 | { | 313 | { |
313 | struct bonding *bond; | 314 | struct arp_pkt *arp; |
314 | struct arp_pkt *arp = (struct arp_pkt *)skb->data; | ||
315 | int res = NET_RX_DROP; | ||
316 | 315 | ||
317 | while (bond_dev->priv_flags & IFF_802_1Q_VLAN) | 316 | if (skb->protocol != cpu_to_be16(ETH_P_ARP)) |
318 | bond_dev = vlan_dev_real_dev(bond_dev); | 317 | return; |
319 | |||
320 | if (!(bond_dev->priv_flags & IFF_BONDING) || | ||
321 | !(bond_dev->flags & IFF_MASTER)) | ||
322 | goto out; | ||
323 | 318 | ||
319 | arp = (struct arp_pkt *) skb->data; | ||
324 | if (!arp) { | 320 | if (!arp) { |
325 | pr_debug("Packet has no ARP data\n"); | 321 | pr_debug("Packet has no ARP data\n"); |
326 | goto out; | 322 | return; |
327 | } | 323 | } |
328 | 324 | ||
329 | skb = skb_share_check(skb, GFP_ATOMIC); | 325 | if (!pskb_may_pull(skb, arp_hdr_len(bond->dev))) |
330 | if (!skb) | 326 | return; |
331 | goto out; | ||
332 | |||
333 | if (!pskb_may_pull(skb, arp_hdr_len(bond_dev))) | ||
334 | goto out; | ||
335 | 327 | ||
336 | if (skb->len < sizeof(struct arp_pkt)) { | 328 | if (skb->len < sizeof(struct arp_pkt)) { |
337 | pr_debug("Packet is too small to be an ARP\n"); | 329 | pr_debug("Packet is too small to be an ARP\n"); |
338 | goto out; | 330 | return; |
339 | } | 331 | } |
340 | 332 | ||
341 | if (arp->op_code == htons(ARPOP_REPLY)) { | 333 | if (arp->op_code == htons(ARPOP_REPLY)) { |
342 | /* update rx hash table for this ARP */ | 334 | /* update rx hash table for this ARP */ |
343 | bond = netdev_priv(bond_dev); | ||
344 | rlb_update_entry_from_arp(bond, arp); | 335 | rlb_update_entry_from_arp(bond, arp); |
345 | pr_debug("Server received an ARP Reply from client\n"); | 336 | pr_debug("Server received an ARP Reply from client\n"); |
346 | } | 337 | } |
347 | |||
348 | res = NET_RX_SUCCESS; | ||
349 | |||
350 | out: | ||
351 | dev_kfree_skb(skb); | ||
352 | |||
353 | return res; | ||
354 | } | 338 | } |
355 | 339 | ||
356 | /* Caller must hold bond lock for read */ | 340 | /* Caller must hold bond lock for read */ |
@@ -759,7 +743,6 @@ static void rlb_init_table_entry(struct rlb_client_info *entry) | |||
759 | static int rlb_initialize(struct bonding *bond) | 743 | static int rlb_initialize(struct bonding *bond) |
760 | { | 744 | { |
761 | struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); | 745 | struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); |
762 | struct packet_type *pk_type = &(BOND_ALB_INFO(bond).rlb_pkt_type); | ||
763 | struct rlb_client_info *new_hashtbl; | 746 | struct rlb_client_info *new_hashtbl; |
764 | int size = RLB_HASH_TABLE_SIZE * sizeof(struct rlb_client_info); | 747 | int size = RLB_HASH_TABLE_SIZE * sizeof(struct rlb_client_info); |
765 | int i; | 748 | int i; |
@@ -784,13 +767,8 @@ static int rlb_initialize(struct bonding *bond) | |||
784 | 767 | ||
785 | _unlock_rx_hashtbl(bond); | 768 | _unlock_rx_hashtbl(bond); |
786 | 769 | ||
787 | /*initialize packet type*/ | ||
788 | pk_type->type = cpu_to_be16(ETH_P_ARP); | ||
789 | pk_type->dev = bond->dev; | ||
790 | pk_type->func = rlb_arp_recv; | ||
791 | |||
792 | /* register to receive ARPs */ | 770 | /* register to receive ARPs */ |
793 | dev_add_pack(pk_type); | 771 | bond->recv_probe = rlb_arp_recv; |
794 | 772 | ||
795 | return 0; | 773 | return 0; |
796 | } | 774 | } |
@@ -799,8 +777,6 @@ static void rlb_deinitialize(struct bonding *bond) | |||
799 | { | 777 | { |
800 | struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); | 778 | struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); |
801 | 779 | ||
802 | dev_remove_pack(&(bond_info->rlb_pkt_type)); | ||
803 | |||
804 | _lock_rx_hashtbl(bond); | 780 | _lock_rx_hashtbl(bond); |
805 | 781 | ||
806 | kfree(bond_info->rx_hashtbl); | 782 | kfree(bond_info->rx_hashtbl); |
diff --git a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h index 8ca7158b2dda..90f140a2d197 100644 --- a/drivers/net/bonding/bond_alb.h +++ b/drivers/net/bonding/bond_alb.h | |||
@@ -129,7 +129,6 @@ struct alb_bond_info { | |||
129 | int lp_counter; | 129 | int lp_counter; |
130 | /* -------- rlb parameters -------- */ | 130 | /* -------- rlb parameters -------- */ |
131 | int rlb_enabled; | 131 | int rlb_enabled; |
132 | struct packet_type rlb_pkt_type; | ||
133 | struct rlb_client_info *rx_hashtbl; /* Receive hash table */ | 132 | struct rlb_client_info *rx_hashtbl; /* Receive hash table */ |
134 | spinlock_t rx_hashtbl_lock; | 133 | spinlock_t rx_hashtbl_lock; |
135 | u32 rx_hashtbl_head; | 134 | u32 rx_hashtbl_head; |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 4ce14bdf96dd..66d9dc6e5cac 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1439,27 +1439,17 @@ static void bond_setup_by_slave(struct net_device *bond_dev, | |||
1439 | } | 1439 | } |
1440 | 1440 | ||
1441 | /* On bonding slaves other than the currently active slave, suppress | 1441 | /* On bonding slaves other than the currently active slave, suppress |
1442 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and | 1442 | * duplicates except for alb non-mcast/bcast. |
1443 | * ARP on active-backup slaves with arp_validate enabled. | ||
1444 | */ | 1443 | */ |
1445 | static bool bond_should_deliver_exact_match(struct sk_buff *skb, | 1444 | static bool bond_should_deliver_exact_match(struct sk_buff *skb, |
1446 | struct slave *slave, | 1445 | struct slave *slave, |
1447 | struct bonding *bond) | 1446 | struct bonding *bond) |
1448 | { | 1447 | { |
1449 | if (bond_is_slave_inactive(slave)) { | 1448 | if (bond_is_slave_inactive(slave)) { |
1450 | if (slave_do_arp_validate(bond, slave) && | ||
1451 | skb->protocol == __cpu_to_be16(ETH_P_ARP)) | ||
1452 | return false; | ||
1453 | |||
1454 | if (bond->params.mode == BOND_MODE_ALB && | 1449 | if (bond->params.mode == BOND_MODE_ALB && |
1455 | skb->pkt_type != PACKET_BROADCAST && | 1450 | skb->pkt_type != PACKET_BROADCAST && |
1456 | skb->pkt_type != PACKET_MULTICAST) | 1451 | skb->pkt_type != PACKET_MULTICAST) |
1457 | return false; | ||
1458 | |||
1459 | if (bond->params.mode == BOND_MODE_8023AD && | ||
1460 | skb->protocol == __cpu_to_be16(ETH_P_SLOW)) | ||
1461 | return false; | 1452 | return false; |
1462 | |||
1463 | return true; | 1453 | return true; |
1464 | } | 1454 | } |
1465 | return false; | 1455 | return false; |
@@ -1483,6 +1473,15 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) | |||
1483 | if (bond->params.arp_interval) | 1473 | if (bond->params.arp_interval) |
1484 | slave->dev->last_rx = jiffies; | 1474 | slave->dev->last_rx = jiffies; |
1485 | 1475 | ||
1476 | if (bond->recv_probe) { | ||
1477 | struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC); | ||
1478 | |||
1479 | if (likely(nskb)) { | ||
1480 | bond->recv_probe(nskb, bond, slave); | ||
1481 | dev_kfree_skb(nskb); | ||
1482 | } | ||
1483 | } | ||
1484 | |||
1486 | if (bond_should_deliver_exact_match(skb, slave, bond)) { | 1485 | if (bond_should_deliver_exact_match(skb, slave, bond)) { |
1487 | return RX_HANDLER_EXACT; | 1486 | return RX_HANDLER_EXACT; |
1488 | } | 1487 | } |
@@ -2743,48 +2742,26 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32 | |||
2743 | } | 2742 | } |
2744 | } | 2743 | } |
2745 | 2744 | ||
2746 | static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) | 2745 | static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, |
2746 | struct slave *slave) | ||
2747 | { | 2747 | { |
2748 | struct arphdr *arp; | 2748 | struct arphdr *arp; |
2749 | struct slave *slave; | ||
2750 | struct bonding *bond; | ||
2751 | unsigned char *arp_ptr; | 2749 | unsigned char *arp_ptr; |
2752 | __be32 sip, tip; | 2750 | __be32 sip, tip; |
2753 | 2751 | ||
2754 | if (dev->priv_flags & IFF_802_1Q_VLAN) { | 2752 | if (skb->protocol != __cpu_to_be16(ETH_P_ARP)) |
2755 | /* | 2753 | return; |
2756 | * When using VLANS and bonding, dev and oriv_dev may be | ||
2757 | * incorrect if the physical interface supports VLAN | ||
2758 | * acceleration. With this change ARP validation now | ||
2759 | * works for hosts only reachable on the VLAN interface. | ||
2760 | */ | ||
2761 | dev = vlan_dev_real_dev(dev); | ||
2762 | orig_dev = dev_get_by_index_rcu(dev_net(skb->dev),skb->skb_iif); | ||
2763 | } | ||
2764 | |||
2765 | if (!(dev->priv_flags & IFF_BONDING) || !(dev->flags & IFF_MASTER)) | ||
2766 | goto out; | ||
2767 | 2754 | ||
2768 | bond = netdev_priv(dev); | ||
2769 | read_lock(&bond->lock); | 2755 | read_lock(&bond->lock); |
2770 | 2756 | ||
2771 | pr_debug("bond_arp_rcv: bond %s skb->dev %s orig_dev %s\n", | 2757 | pr_debug("bond_arp_rcv: bond %s skb->dev %s\n", |
2772 | bond->dev->name, skb->dev ? skb->dev->name : "NULL", | 2758 | bond->dev->name, skb->dev->name); |
2773 | orig_dev ? orig_dev->name : "NULL"); | ||
2774 | 2759 | ||
2775 | slave = bond_get_slave_by_dev(bond, orig_dev); | 2760 | if (!pskb_may_pull(skb, arp_hdr_len(bond->dev))) |
2776 | if (!slave || !slave_do_arp_validate(bond, slave)) | ||
2777 | goto out_unlock; | ||
2778 | |||
2779 | skb = skb_share_check(skb, GFP_ATOMIC); | ||
2780 | if (!skb) | ||
2781 | goto out_unlock; | ||
2782 | |||
2783 | if (!pskb_may_pull(skb, arp_hdr_len(dev))) | ||
2784 | goto out_unlock; | 2761 | goto out_unlock; |
2785 | 2762 | ||
2786 | arp = arp_hdr(skb); | 2763 | arp = arp_hdr(skb); |
2787 | if (arp->ar_hln != dev->addr_len || | 2764 | if (arp->ar_hln != bond->dev->addr_len || |
2788 | skb->pkt_type == PACKET_OTHERHOST || | 2765 | skb->pkt_type == PACKET_OTHERHOST || |
2789 | skb->pkt_type == PACKET_LOOPBACK || | 2766 | skb->pkt_type == PACKET_LOOPBACK || |
2790 | arp->ar_hrd != htons(ARPHRD_ETHER) || | 2767 | arp->ar_hrd != htons(ARPHRD_ETHER) || |
@@ -2793,9 +2770,9 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack | |||
2793 | goto out_unlock; | 2770 | goto out_unlock; |
2794 | 2771 | ||
2795 | arp_ptr = (unsigned char *)(arp + 1); | 2772 | arp_ptr = (unsigned char *)(arp + 1); |
2796 | arp_ptr += dev->addr_len; | 2773 | arp_ptr += bond->dev->addr_len; |
2797 | memcpy(&sip, arp_ptr, 4); | 2774 | memcpy(&sip, arp_ptr, 4); |
2798 | arp_ptr += 4 + dev->addr_len; | 2775 | arp_ptr += 4 + bond->dev->addr_len; |
2799 | memcpy(&tip, arp_ptr, 4); | 2776 | memcpy(&tip, arp_ptr, 4); |
2800 | 2777 | ||
2801 | pr_debug("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n", | 2778 | pr_debug("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n", |
@@ -2818,9 +2795,6 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack | |||
2818 | 2795 | ||
2819 | out_unlock: | 2796 | out_unlock: |
2820 | read_unlock(&bond->lock); | 2797 | read_unlock(&bond->lock); |
2821 | out: | ||
2822 | dev_kfree_skb(skb); | ||
2823 | return NET_RX_SUCCESS; | ||
2824 | } | 2798 | } |
2825 | 2799 | ||
2826 | /* | 2800 | /* |
@@ -3407,48 +3381,6 @@ static struct notifier_block bond_inetaddr_notifier = { | |||
3407 | .notifier_call = bond_inetaddr_event, | 3381 | .notifier_call = bond_inetaddr_event, |
3408 | }; | 3382 | }; |
3409 | 3383 | ||
3410 | /*-------------------------- Packet type handling ---------------------------*/ | ||
3411 | |||
3412 | /* register to receive lacpdus on a bond */ | ||
3413 | static void bond_register_lacpdu(struct bonding *bond) | ||
3414 | { | ||
3415 | struct packet_type *pk_type = &(BOND_AD_INFO(bond).ad_pkt_type); | ||
3416 | |||
3417 | /* initialize packet type */ | ||
3418 | pk_type->type = PKT_TYPE_LACPDU; | ||
3419 | pk_type->dev = bond->dev; | ||
3420 | pk_type->func = bond_3ad_lacpdu_recv; | ||
3421 | |||
3422 | dev_add_pack(pk_type); | ||
3423 | } | ||
3424 | |||
3425 | /* unregister to receive lacpdus on a bond */ | ||
3426 | static void bond_unregister_lacpdu(struct bonding *bond) | ||
3427 | { | ||
3428 | dev_remove_pack(&(BOND_AD_INFO(bond).ad_pkt_type)); | ||
3429 | } | ||
3430 | |||
3431 | void bond_register_arp(struct bonding *bond) | ||
3432 | { | ||
3433 | struct packet_type *pt = &bond->arp_mon_pt; | ||
3434 | |||
3435 | if (pt->type) | ||
3436 | return; | ||
3437 | |||
3438 | pt->type = htons(ETH_P_ARP); | ||
3439 | pt->dev = bond->dev; | ||
3440 | pt->func = bond_arp_rcv; | ||
3441 | dev_add_pack(pt); | ||
3442 | } | ||
3443 | |||
3444 | void bond_unregister_arp(struct bonding *bond) | ||
3445 | { | ||
3446 | struct packet_type *pt = &bond->arp_mon_pt; | ||
3447 | |||
3448 | dev_remove_pack(pt); | ||
3449 | pt->type = 0; | ||
3450 | } | ||
3451 | |||
3452 | /*---------------------------- Hashing Policies -----------------------------*/ | 3384 | /*---------------------------- Hashing Policies -----------------------------*/ |
3453 | 3385 | ||
3454 | /* | 3386 | /* |
@@ -3542,14 +3474,14 @@ static int bond_open(struct net_device *bond_dev) | |||
3542 | 3474 | ||
3543 | queue_delayed_work(bond->wq, &bond->arp_work, 0); | 3475 | queue_delayed_work(bond->wq, &bond->arp_work, 0); |
3544 | if (bond->params.arp_validate) | 3476 | if (bond->params.arp_validate) |
3545 | bond_register_arp(bond); | 3477 | bond->recv_probe = bond_arp_rcv; |
3546 | } | 3478 | } |
3547 | 3479 | ||
3548 | if (bond->params.mode == BOND_MODE_8023AD) { | 3480 | if (bond->params.mode == BOND_MODE_8023AD) { |
3549 | INIT_DELAYED_WORK(&bond->ad_work, bond_3ad_state_machine_handler); | 3481 | INIT_DELAYED_WORK(&bond->ad_work, bond_3ad_state_machine_handler); |
3550 | queue_delayed_work(bond->wq, &bond->ad_work, 0); | 3482 | queue_delayed_work(bond->wq, &bond->ad_work, 0); |
3551 | /* register to receive LACPDUs */ | 3483 | /* register to receive LACPDUs */ |
3552 | bond_register_lacpdu(bond); | 3484 | bond->recv_probe = bond_3ad_lacpdu_recv; |
3553 | bond_3ad_initiate_agg_selection(bond, 1); | 3485 | bond_3ad_initiate_agg_selection(bond, 1); |
3554 | } | 3486 | } |
3555 | 3487 | ||
@@ -3560,14 +3492,6 @@ static int bond_close(struct net_device *bond_dev) | |||
3560 | { | 3492 | { |
3561 | struct bonding *bond = netdev_priv(bond_dev); | 3493 | struct bonding *bond = netdev_priv(bond_dev); |
3562 | 3494 | ||
3563 | if (bond->params.mode == BOND_MODE_8023AD) { | ||
3564 | /* Unregister the receive of LACPDUs */ | ||
3565 | bond_unregister_lacpdu(bond); | ||
3566 | } | ||
3567 | |||
3568 | if (bond->params.arp_validate) | ||
3569 | bond_unregister_arp(bond); | ||
3570 | |||
3571 | write_lock_bh(&bond->lock); | 3495 | write_lock_bh(&bond->lock); |
3572 | 3496 | ||
3573 | /* signal timers not to re-arm */ | 3497 | /* signal timers not to re-arm */ |
@@ -3604,6 +3528,7 @@ static int bond_close(struct net_device *bond_dev) | |||
3604 | */ | 3528 | */ |
3605 | bond_alb_deinitialize(bond); | 3529 | bond_alb_deinitialize(bond); |
3606 | } | 3530 | } |
3531 | bond->recv_probe = NULL; | ||
3607 | 3532 | ||
3608 | return 0; | 3533 | return 0; |
3609 | } | 3534 | } |
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 259ff32cd573..935406aa5f0c 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -422,11 +422,6 @@ static ssize_t bonding_store_arp_validate(struct device *d, | |||
422 | bond->dev->name, arp_validate_tbl[new_value].modename, | 422 | bond->dev->name, arp_validate_tbl[new_value].modename, |
423 | new_value); | 423 | new_value); |
424 | 424 | ||
425 | if (!bond->params.arp_validate && new_value) | ||
426 | bond_register_arp(bond); | ||
427 | else if (bond->params.arp_validate && !new_value) | ||
428 | bond_unregister_arp(bond); | ||
429 | |||
430 | bond->params.arp_validate = new_value; | 425 | bond->params.arp_validate = new_value; |
431 | 426 | ||
432 | return count; | 427 | return count; |
@@ -923,7 +918,6 @@ static ssize_t bonding_store_miimon(struct device *d, | |||
923 | bond->dev->name); | 918 | bond->dev->name); |
924 | bond->params.arp_interval = 0; | 919 | bond->params.arp_interval = 0; |
925 | if (bond->params.arp_validate) { | 920 | if (bond->params.arp_validate) { |
926 | bond_unregister_arp(bond); | ||
927 | bond->params.arp_validate = | 921 | bond->params.arp_validate = |
928 | BOND_ARP_VALIDATE_NONE; | 922 | BOND_ARP_VALIDATE_NONE; |
929 | } | 923 | } |
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 6126c6a13a74..85fb8220e283 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -226,6 +226,8 @@ struct bonding { | |||
226 | struct slave *primary_slave; | 226 | struct slave *primary_slave; |
227 | bool force_primary; | 227 | bool force_primary; |
228 | s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ | 228 | s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ |
229 | void (*recv_probe)(struct sk_buff *, struct bonding *, | ||
230 | struct slave *); | ||
229 | rwlock_t lock; | 231 | rwlock_t lock; |
230 | rwlock_t curr_slave_lock; | 232 | rwlock_t curr_slave_lock; |
231 | s8 kill_timers; | 233 | s8 kill_timers; |
@@ -399,8 +401,6 @@ void bond_set_mode_ops(struct bonding *bond, int mode); | |||
399 | int bond_parse_parm(const char *mode_arg, const struct bond_parm_tbl *tbl); | 401 | int bond_parse_parm(const char *mode_arg, const struct bond_parm_tbl *tbl); |
400 | void bond_select_active_slave(struct bonding *bond); | 402 | void bond_select_active_slave(struct bonding *bond); |
401 | void bond_change_active_slave(struct bonding *bond, struct slave *new_active); | 403 | void bond_change_active_slave(struct bonding *bond, struct slave *new_active); |
402 | void bond_register_arp(struct bonding *); | ||
403 | void bond_unregister_arp(struct bonding *); | ||
404 | void bond_create_debugfs(void); | 404 | void bond_create_debugfs(void); |
405 | void bond_destroy_debugfs(void); | 405 | void bond_destroy_debugfs(void); |
406 | void bond_debug_register(struct bonding *bond); | 406 | void bond_debug_register(struct bonding *bond); |