aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macvlan.c
diff options
context:
space:
mode:
authorVlad Yasevich <vyasevic@redhat.com>2013-12-11 13:27:11 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-12 13:38:39 -0500
commit2f6a1b6607fd6b0eb9501843a40e0c7555f37b4a (patch)
tree80d2a3c5c9396bdd07c751eaa2ccfd42cd9c87c2 /drivers/net/macvlan.c
parent6acf54f1cf0a6747bac9fea26f34cfc5a9029523 (diff)
macvlan: Remove custom recieve and forward handlers
Since now macvlan and macvtap use the same receive and forward handlers, we can remove them completely and use netif_rx and dev_forward_skb() directly. Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macvlan.c')
-rw-r--r--drivers/net/macvlan.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index cfb91570cddd..24ea994b6274 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -120,7 +120,7 @@ static int macvlan_broadcast_one(struct sk_buff *skb,
120 struct net_device *dev = vlan->dev; 120 struct net_device *dev = vlan->dev;
121 121
122 if (local) 122 if (local)
123 return vlan->forward(dev, skb); 123 return dev_forward_skb(dev, skb);
124 124
125 skb->dev = dev; 125 skb->dev = dev;
126 if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast)) 126 if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast))
@@ -128,7 +128,7 @@ static int macvlan_broadcast_one(struct sk_buff *skb,
128 else 128 else
129 skb->pkt_type = PACKET_MULTICAST; 129 skb->pkt_type = PACKET_MULTICAST;
130 130
131 return vlan->receive(skb); 131 return netif_rx(skb);
132} 132}
133 133
134static u32 macvlan_hash_mix(const struct macvlan_dev *vlan) 134static u32 macvlan_hash_mix(const struct macvlan_dev *vlan)
@@ -251,7 +251,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
251 skb->dev = dev; 251 skb->dev = dev;
252 skb->pkt_type = PACKET_HOST; 252 skb->pkt_type = PACKET_HOST;
253 253
254 ret = vlan->receive(skb); 254 ret = netif_rx(skb);
255 255
256out: 256out:
257 macvlan_count_rx(vlan, len, ret == NET_RX_SUCCESS, 0); 257 macvlan_count_rx(vlan, len, ret == NET_RX_SUCCESS, 0);
@@ -803,10 +803,7 @@ static int macvlan_validate(struct nlattr *tb[], struct nlattr *data[])
803} 803}
804 804
805int macvlan_common_newlink(struct net *src_net, struct net_device *dev, 805int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
806 struct nlattr *tb[], struct nlattr *data[], 806 struct nlattr *tb[], struct nlattr *data[])
807 int (*receive)(struct sk_buff *skb),
808 int (*forward)(struct net_device *dev,
809 struct sk_buff *skb))
810{ 807{
811 struct macvlan_dev *vlan = netdev_priv(dev); 808 struct macvlan_dev *vlan = netdev_priv(dev);
812 struct macvlan_port *port; 809 struct macvlan_port *port;
@@ -848,8 +845,6 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
848 vlan->lowerdev = lowerdev; 845 vlan->lowerdev = lowerdev;
849 vlan->dev = dev; 846 vlan->dev = dev;
850 vlan->port = port; 847 vlan->port = port;
851 vlan->receive = receive;
852 vlan->forward = forward;
853 vlan->set_features = MACVLAN_FEATURES; 848 vlan->set_features = MACVLAN_FEATURES;
854 849
855 vlan->mode = MACVLAN_MODE_VEPA; 850 vlan->mode = MACVLAN_MODE_VEPA;
@@ -894,9 +889,7 @@ EXPORT_SYMBOL_GPL(macvlan_common_newlink);
894static int macvlan_newlink(struct net *src_net, struct net_device *dev, 889static int macvlan_newlink(struct net *src_net, struct net_device *dev,
895 struct nlattr *tb[], struct nlattr *data[]) 890 struct nlattr *tb[], struct nlattr *data[])
896{ 891{
897 return macvlan_common_newlink(src_net, dev, tb, data, 892 return macvlan_common_newlink(src_net, dev, tb, data);
898 netif_rx,
899 dev_forward_skb);
900} 893}
901 894
902void macvlan_dellink(struct net_device *dev, struct list_head *head) 895void macvlan_dellink(struct net_device *dev, struct list_head *head)