aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/if_vlan.h
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2011-04-07 15:48:33 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-12 17:15:19 -0400
commitbcc6d47903612c3861201cc3a866fb604f26b8b2 (patch)
treebd02aeaa18984de46d09a1cb41b1f5e09ec89dbb /include/linux/if_vlan.h
parent143780c6562080c1117cd9197ee1b33c0d838376 (diff)
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>
Diffstat (limited to 'include/linux/if_vlan.h')
-rw-r--r--include/linux/if_vlan.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 635e1faec412..998b29930b80 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -132,7 +132,8 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev);
132 132
133extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, 133extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
134 u16 vlan_tci, int polling); 134 u16 vlan_tci, int polling);
135extern bool vlan_hwaccel_do_receive(struct sk_buff **skb); 135extern bool vlan_do_receive(struct sk_buff **skb);
136extern struct sk_buff *vlan_untag(struct sk_buff *skb);
136extern gro_result_t 137extern gro_result_t
137vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, 138vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
138 unsigned int vlan_tci, struct sk_buff *skb); 139 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,
166 return NET_XMIT_SUCCESS; 167 return NET_XMIT_SUCCESS;
167} 168}
168 169
169static inline bool vlan_hwaccel_do_receive(struct sk_buff **skb) 170static inline bool vlan_do_receive(struct sk_buff **skb)
170{ 171{
171 if ((*skb)->vlan_tci & VLAN_VID_MASK) 172 if ((*skb)->vlan_tci & VLAN_VID_MASK)
172 (*skb)->pkt_type = PACKET_OTHERHOST; 173 (*skb)->pkt_type = PACKET_OTHERHOST;
173 return false; 174 return false;
174} 175}
175 176
177inline struct sk_buff *vlan_untag(struct sk_buff *skb)
178{
179 return skb;
180}
181
176static inline gro_result_t 182static inline gro_result_t
177vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, 183vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
178 unsigned int vlan_tci, struct sk_buff *skb) 184 unsigned int vlan_tci, struct sk_buff *skb)