mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 07:01:23 +00:00
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>
This commit is contained in:
parent
65ac6a5fa6
commit
3701e51382
5 changed files with 48 additions and 140 deletions
|
@ -132,7 +132,7 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev);
|
|||
|
||||
extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
|
||||
u16 vlan_tci, int polling);
|
||||
extern void vlan_hwaccel_do_receive(struct sk_buff *skb);
|
||||
extern bool vlan_hwaccel_do_receive(struct sk_buff **skb);
|
||||
extern gro_result_t
|
||||
vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
|
||||
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,
|
|||
return NET_XMIT_SUCCESS;
|
||||
}
|
||||
|
||||
static inline void vlan_hwaccel_do_receive(struct sk_buff *skb)
|
||||
static inline bool vlan_hwaccel_do_receive(struct sk_buff **skb)
|
||||
{
|
||||
BUG();
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline gro_result_t
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue