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>
This commit is contained in:
Jiri Pirko
2011-04-19 03:48:16 +00:00
committed by David S. Miller
parent 22d5969fb4
commit 3aba891dde
8 changed files with 43 additions and 189 deletions

View File

@@ -3077,25 +3077,6 @@ void netdev_rx_handler_unregister(struct net_device *dev)
}
EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister);
static void vlan_on_bond_hook(struct sk_buff *skb)
{
/*
* Make sure ARP frames received on VLAN interfaces stacked on
* bonding interfaces still make their way to any base bonding
* device that may have registered for a specific ptype.
*/
if (skb->dev->priv_flags & IFF_802_1Q_VLAN &&
vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING &&
skb->protocol == htons(ETH_P_ARP)) {
struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
if (!skb2)
return;
skb2->dev = vlan_dev_real_dev(skb->dev);
netif_rx(skb2);
}
}
static int __netif_receive_skb(struct sk_buff *skb)
{
struct packet_type *ptype, *pt_prev;
@@ -3191,8 +3172,6 @@ ncls:
goto out;
}
vlan_on_bond_hook(skb);
/* deliver only exact match when indicated */
null_or_dev = deliver_exact ? skb->dev : NULL;