From: Michał Mirosław Date: Wed, 7 Nov 2018 17:07:02 +0000 (+0100) Subject: net/vlan: introduce __vlan_hwaccel_copy_tag() helper X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e0a6b8097351255a2dbbb45274a8b9c52850cbb6;p=linux.git net/vlan: introduce __vlan_hwaccel_copy_tag() helper Signed-off-by: Michał Mirosław Signed-off-by: David S. Miller --- diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index c438fa0a1c6ae..941da4bf39292 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -472,6 +472,19 @@ static inline void __vlan_hwaccel_clear_tag(struct sk_buff *skb) skb->vlan_tci = 0; } +/** + * __vlan_hwaccel_copy_tag - copy hardware accelerated VLAN info from another skb + * @dst: skbuff to copy to + * @src: skbuff to copy from + * + * Copies VLAN information from @src to @dst (for branchless code) + */ +static inline void __vlan_hwaccel_copy_tag(struct sk_buff *dst, const struct sk_buff *src) +{ + dst->vlan_proto = src->vlan_proto; + dst->vlan_tci = src->vlan_tci; +} + /* * __vlan_hwaccel_push_inside - pushes vlan tag to the payload * @skb: skbuff to tag