diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-04-07 15:48:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-12 17:15:19 -0400 |
commit | bcc6d47903612c3861201cc3a866fb604f26b8b2 (patch) | |
tree | bd02aeaa18984de46d09a1cb41b1f5e09ec89dbb /include/linux | |
parent | 143780c6562080c1117cd9197ee1b33c0d838376 (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')
-rw-r--r-- | include/linux/if_vlan.h | 10 |
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 | ||
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 bool vlan_hwaccel_do_receive(struct sk_buff **skb); | 135 | extern bool vlan_do_receive(struct sk_buff **skb); |
136 | extern struct sk_buff *vlan_untag(struct sk_buff *skb); | ||
136 | extern gro_result_t | 137 | extern gro_result_t |
137 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, | 138 | vlan_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 | ||
169 | static inline bool vlan_hwaccel_do_receive(struct sk_buff **skb) | 170 | static 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 | ||
177 | inline struct sk_buff *vlan_untag(struct sk_buff *skb) | ||
178 | { | ||
179 | return skb; | ||
180 | } | ||
181 | |||
176 | static inline gro_result_t | 182 | static inline gro_result_t |
177 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, | 183 | vlan_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) |