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/bond_3ad.c | |
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/bond_3ad.c')
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 29 |
1 files changed, 5 insertions, 24 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 | } |