diff options
| -rw-r--r-- | drivers/net/macvlan.c | 17 | ||||
| -rw-r--r-- | drivers/net/macvtap.c | 3 | ||||
| -rw-r--r-- | include/linux/if_macvlan.h | 7 |
3 files changed, 7 insertions, 20 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 | ||
| 134 | static u32 macvlan_hash_mix(const struct macvlan_dev *vlan) | 134 | static 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 | ||
| 256 | out: | 256 | out: |
| 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 | ||
| 805 | int macvlan_common_newlink(struct net *src_net, struct net_device *dev, | 805 | int 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); | |||
| 894 | static int macvlan_newlink(struct net *src_net, struct net_device *dev, | 889 | static 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 | ||
| 902 | void macvlan_dellink(struct net_device *dev, struct list_head *head) | 895 | void macvlan_dellink(struct net_device *dev, struct list_head *head) |
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index 85ecfccf9c60..64409af0da31 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c | |||
| @@ -400,8 +400,7 @@ static int macvtap_newlink(struct net *src_net, | |||
| 400 | /* Don't put anything that may fail after macvlan_common_newlink | 400 | /* Don't put anything that may fail after macvlan_common_newlink |
| 401 | * because we can't undo what it does. | 401 | * because we can't undo what it does. |
| 402 | */ | 402 | */ |
| 403 | return macvlan_common_newlink(src_net, dev, tb, data, | 403 | return macvlan_common_newlink(src_net, dev, tb, data); |
| 404 | netif_rx, dev_forward_skb); | ||
| 405 | } | 404 | } |
| 406 | 405 | ||
| 407 | static void macvtap_dellink(struct net_device *dev, | 406 | static void macvtap_dellink(struct net_device *dev, |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 84ba5ac39e03..ea22721ba269 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
| @@ -69,8 +69,6 @@ struct macvlan_dev { | |||
| 69 | netdev_features_t set_features; | 69 | netdev_features_t set_features; |
| 70 | enum macvlan_mode mode; | 70 | enum macvlan_mode mode; |
| 71 | u16 flags; | 71 | u16 flags; |
| 72 | int (*receive)(struct sk_buff *skb); | ||
| 73 | int (*forward)(struct net_device *dev, struct sk_buff *skb); | ||
| 74 | /* This array tracks active taps. */ | 72 | /* This array tracks active taps. */ |
| 75 | struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES]; | 73 | struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES]; |
| 76 | /* This list tracks all taps (both enabled and disabled) */ | 74 | /* This list tracks all taps (both enabled and disabled) */ |
| @@ -103,10 +101,7 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | |||
| 103 | extern void macvlan_common_setup(struct net_device *dev); | 101 | extern void macvlan_common_setup(struct net_device *dev); |
| 104 | 102 | ||
| 105 | extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, | 103 | extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, |
| 106 | struct nlattr *tb[], struct nlattr *data[], | 104 | struct nlattr *tb[], struct nlattr *data[]); |
| 107 | int (*receive)(struct sk_buff *skb), | ||
| 108 | int (*forward)(struct net_device *dev, | ||
| 109 | struct sk_buff *skb)); | ||
| 110 | 105 | ||
| 111 | extern void macvlan_count_rx(const struct macvlan_dev *vlan, | 106 | extern void macvlan_count_rx(const struct macvlan_dev *vlan, |
| 112 | unsigned int len, bool success, | 107 | unsigned int len, bool success, |
