mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 06:32:08 +00:00
net: vlan: make non-hw-accel rx path similar to hw-accel
Now there are 2 paths for rx vlan frames. When rx-vlan-hw-accel is enabled, skb is untagged by NIC, vlan_tci is set and the skb gets into vlan code in __netif_receive_skb - vlan_hwaccel_do_receive. For non-rx-vlan-hw-accel however, tagged skb goes thru whole __netif_receive_skb, it's untagged in ptype_base hander and reinjected This incosistency is fixed by this patch. Vlan untagging happens early in __netif_receive_skb so the rest of code (ptype_all handlers, rx_handlers) see the skb like it was untagged by hw. Signed-off-by: Jiri Pirko <jpirko@redhat.com> v1->v2: remove "inline" from vlan_core.c functions Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
143780c656
commit
bcc6d47903
6 changed files with 99 additions and 187 deletions
|
@ -132,7 +132,8 @@ 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 bool vlan_hwaccel_do_receive(struct sk_buff **skb);
|
||||
extern bool vlan_do_receive(struct sk_buff **skb);
|
||||
extern struct sk_buff *vlan_untag(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,13 +167,18 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
|
|||
return NET_XMIT_SUCCESS;
|
||||
}
|
||||
|
||||
static inline bool vlan_hwaccel_do_receive(struct sk_buff **skb)
|
||||
static inline bool vlan_do_receive(struct sk_buff **skb)
|
||||
{
|
||||
if ((*skb)->vlan_tci & VLAN_VID_MASK)
|
||||
(*skb)->pkt_type = PACKET_OTHERHOST;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline struct sk_buff *vlan_untag(struct sk_buff *skb)
|
||||
{
|
||||
return skb;
|
||||
}
|
||||
|
||||
static inline gro_result_t
|
||||
vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
|
||||
unsigned int vlan_tci, struct sk_buff *skb)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue