net/vlan: introduce __vlan_hwaccel_copy_tag() helper
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Wed, 7 Nov 2018 17:07:02 +0000 (18:07 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Nov 2018 06:41:19 +0000 (22:41 -0800)
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/if_vlan.h

index c438fa0a1c6ae74fb6c0ffc50cc050c8241a60ae..941da4bf39292c11eddf5d5a43737565bbe9a45d 100644 (file)
@@ -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