net: dsa: tag_8021q: only call skb_push/skb_pull around __skb_vlan_pop
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 15 Feb 2022 20:47:22 +0000 (22:47 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 17 Feb 2022 04:35:35 +0000 (20:35 -0800)
commitc8620335951d38f26094877f83167dfd09074224
treeae6bddea3dccfd8ea5d677274f6d1b534a36851b
parenta5e516d026cbfa3f36bd12e5bb39c33258795542
net: dsa: tag_8021q: only call skb_push/skb_pull around __skb_vlan_pop

__skb_vlan_pop() needs skb->data to point at the mac_header, while
skb_vlan_tag_present() and skb_vlan_tag_get() don't, because they don't
look at skb->data at all.

So we can avoid uselessly moving around skb->data for the case where the
VLAN tag was offloaded by the DSA master.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20220215204722.2134816-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/dsa/tag_8021q.c