diff mbox series

[net-next,2/4] net/vlan: introduce __vlan_hwaccel_copy_tag() helper

Message ID ad2db328a6d2ad951ae09e0fcdd09e017b195910.1541610138.git.mirq-linux@rere.qmqm.pl
State Accepted, archived
Delegated to: David Miller
Headers show
Series net/vlan: prepare for removal of VLAN_TAG_PRESENT | expand

Commit Message

Michał Mirosław Nov. 7, 2018, 5:07 p.m. UTC
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 include/linux/if_vlan.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index c438fa0a1c6a..941da4bf3929 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