Commit b1817524 authored by Michał Mirosław's avatar Michał Mirosław Committed by David S. Miller

net/core: use __vlan_hwaccel helpers

This removes assumptions about VLAN_TAG_PRESENT bit.
Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 35c4a95d
...@@ -4889,7 +4889,7 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc, ...@@ -4889,7 +4889,7 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc,
* and set skb->priority like in vlan_do_receive() * and set skb->priority like in vlan_do_receive()
* For the time being, just ignore Priority Code Point * For the time being, just ignore Priority Code Point
*/ */
skb->vlan_tci = 0; __vlan_hwaccel_clear_tag(skb);
} }
type = skb->protocol; type = skb->protocol;
...@@ -5386,7 +5386,9 @@ static struct list_head *gro_list_prepare(struct napi_struct *napi, ...@@ -5386,7 +5386,9 @@ static struct list_head *gro_list_prepare(struct napi_struct *napi,
} }
diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev; diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev;
diffs |= p->vlan_tci ^ skb->vlan_tci; diffs |= skb_vlan_tag_present(p) ^ skb_vlan_tag_present(skb);
if (skb_vlan_tag_present(p))
diffs |= p->vlan_tci ^ skb->vlan_tci;
diffs |= skb_metadata_dst_cmp(p, skb); diffs |= skb_metadata_dst_cmp(p, skb);
diffs |= skb_metadata_differs(p, skb); diffs |= skb_metadata_differs(p, skb);
if (maclen == ETH_HLEN) if (maclen == ETH_HLEN)
...@@ -5652,7 +5654,7 @@ static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb) ...@@ -5652,7 +5654,7 @@ static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb)
__skb_pull(skb, skb_headlen(skb)); __skb_pull(skb, skb_headlen(skb));
/* restore the reserve we had after netdev_alloc_skb_ip_align() */ /* restore the reserve we had after netdev_alloc_skb_ip_align() */
skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN - skb_headroom(skb)); skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN - skb_headroom(skb));
skb->vlan_tci = 0; __vlan_hwaccel_clear_tag(skb);
skb->dev = napi->dev; skb->dev = napi->dev;
skb->skb_iif = 0; skb->skb_iif = 0;
skb->encapsulation = 0; skb->encapsulation = 0;
......
...@@ -5166,7 +5166,7 @@ int skb_vlan_pop(struct sk_buff *skb) ...@@ -5166,7 +5166,7 @@ int skb_vlan_pop(struct sk_buff *skb)
int err; int err;
if (likely(skb_vlan_tag_present(skb))) { if (likely(skb_vlan_tag_present(skb))) {
skb->vlan_tci = 0; __vlan_hwaccel_clear_tag(skb);
} else { } else {
if (unlikely(!eth_type_vlan(skb->protocol))) if (unlikely(!eth_type_vlan(skb->protocol)))
return 0; return 0;
......
...@@ -63,7 +63,7 @@ static int tcf_vlan_act(struct sk_buff *skb, const struct tc_action *a, ...@@ -63,7 +63,7 @@ static int tcf_vlan_act(struct sk_buff *skb, const struct tc_action *a,
/* extract existing tag (and guarantee no hw-accel tag) */ /* extract existing tag (and guarantee no hw-accel tag) */
if (skb_vlan_tag_present(skb)) { if (skb_vlan_tag_present(skb)) {
tci = skb_vlan_tag_get(skb); tci = skb_vlan_tag_get(skb);
skb->vlan_tci = 0; __vlan_hwaccel_clear_tag(skb);
} else { } else {
/* in-payload vlan tag, pop it */ /* in-payload vlan tag, pop it */
err = __skb_vlan_pop(skb, &tci); err = __skb_vlan_pop(skb, &tci);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment