From patchwork Tue Jan 3 20:52:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 710639 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3ttR3W1dQMz9svs for ; Wed, 4 Jan 2017 07:52:55 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935927AbdACUwt (ORCPT ); Tue, 3 Jan 2017 15:52:49 -0500 Received: from rere.qmqm.pl ([84.10.57.10]:34676 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935890AbdACUwh (ORCPT ); Tue, 3 Jan 2017 15:52:37 -0500 Received: by rere.qmqm.pl (Postfix, from userid 1000) id B58F96081; Tue, 3 Jan 2017 21:52:33 +0100 (CET) Message-Id: <1ecd41d32565a178302ffe8ff1f6364804d60e49.1483475202.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Subject: [PATCH net-next v2 02/27] net/vlan: introduce __vlan_hwaccel_copy_tag() helper MIME-Version: 1.0 To: netdev@vger.kernel.org Cc: Patrick McHardy Date: Tue, 3 Jan 2017 21:52:33 +0100 (CET) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Michał Mirosław --- include/linux/if_vlan.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 38be9041cde4..75e839b84a63 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -393,6 +393,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