diff options
author | Jesse Gross <jesse@nicira.com> | 2010-10-20 09:56:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-21 04:26:53 -0400 |
commit | 3701e51382a026cba10c60b03efabe534fba4ca4 (patch) | |
tree | 9f205d8ad0edf65b4405d9b60cb65f3cd8e44ae4 /include | |
parent | 65ac6a5fa658b90f1be700c55e7cd72e4611015d (diff) |
vlan: Centralize handling of hardware acceleration.
Currently each driver that is capable of vlan hardware acceleration
must be aware of the vlan groups that are configured and then pass
the stripped tag to a specialized receive function. This is
different from other types of hardware offload in that it places a
significant amount of knowledge in the driver itself rather keeping
it in the networking core.
This makes vlan offloading function more similarly to other forms
of offloading (such as checksum offloading or TSO) by doing the
following:
* On receive, stripped vlans are passed directly to the network
core, without attempting to check for vlan groups or reconstructing
the header if no group
* vlans are made less special by folding the logic into the main
receive routines
* On transmit, the device layer will add the vlan header in software
if the hardware doesn't support it, instead of spreading that logic
out in upper layers, such as bonding.
There are a number of advantages to this:
* Fixes all bugs with drivers incorrectly dropping vlan headers at once.
* Avoids having to disable VLAN acceleration when in promiscuous mode
(good for bridging since it always puts devices in promiscuous mode).
* Keeps VLAN tag separate until given to ultimate consumer, which
avoids needing to do header reconstruction as in tg3 unless absolutely
necessary.
* Consolidates common code in core networking.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/if_vlan.h | 6 | ||||
-rw-r--r-- | include/linux/netdevice.h | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 4047781da727..a0d9786c202d 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -132,7 +132,7 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev); | |||
132 | 132 | ||
133 | extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | 133 | extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, |
134 | u16 vlan_tci, int polling); | 134 | u16 vlan_tci, int polling); |
135 | extern void vlan_hwaccel_do_receive(struct sk_buff *skb); | 135 | extern bool vlan_hwaccel_do_receive(struct sk_buff **skb); |
136 | extern gro_result_t | 136 | extern gro_result_t |
137 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, | 137 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, |
138 | unsigned int vlan_tci, struct sk_buff *skb); | 138 | unsigned int vlan_tci, struct sk_buff *skb); |
@@ -166,8 +166,10 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | |||
166 | return NET_XMIT_SUCCESS; | 166 | return NET_XMIT_SUCCESS; |
167 | } | 167 | } |
168 | 168 | ||
169 | static inline void vlan_hwaccel_do_receive(struct sk_buff *skb) | 169 | static inline bool vlan_hwaccel_do_receive(struct sk_buff **skb) |
170 | { | 170 | { |
171 | BUG(); | ||
172 | return false; | ||
171 | } | 173 | } |
172 | 174 | ||
173 | static inline gro_result_t | 175 | static inline gro_result_t |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9c78312ce142..ed7db7eebbf3 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1768,7 +1768,6 @@ extern int netdev_rx_handler_register(struct net_device *dev, | |||
1768 | void *rx_handler_data); | 1768 | void *rx_handler_data); |
1769 | extern void netdev_rx_handler_unregister(struct net_device *dev); | 1769 | extern void netdev_rx_handler_unregister(struct net_device *dev); |
1770 | 1770 | ||
1771 | extern void netif_nit_deliver(struct sk_buff *skb); | ||
1772 | extern int dev_valid_name(const char *name); | 1771 | extern int dev_valid_name(const char *name); |
1773 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | 1772 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); |
1774 | extern int dev_ethtool(struct net *net, struct ifreq *); | 1773 | extern int dev_ethtool(struct net *net, struct ifreq *); |