From patchwork Thu Nov 8 23:18:02 2018 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: 10675117 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7BB15175A for ; Thu, 8 Nov 2018 23:18:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DE112E7D4 for ; Thu, 8 Nov 2018 23:18:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 613FF2E7D6; Thu, 8 Nov 2018 23:18:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02E732E7FE for ; Thu, 8 Nov 2018 23:18:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727289AbeKIIz5 (ORCPT ); Fri, 9 Nov 2018 03:55:57 -0500 Received: from rere.qmqm.pl ([91.227.64.183]:59122 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726926AbeKIIz4 (ORCPT ); Fri, 9 Nov 2018 03:55:56 -0500 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 42rfLm5Q31zXW; Fri, 9 Nov 2018 00:17:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1541719024; bh=IVVBSmwrquIo56fC2fNYc4DEAHn5Hh2VoiI664DBOt8=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=bG1HLOQHoNGKGWrjDuIyiPY5Nkf2ij7lMTSs4Bb13RqWvlDCZ4/E9AIdwfTKOuGk6 WF1cZZ0bbWD3YntRhkxHRZt7StOyg7+QqxzLlvsiafe6bNht/J5l5VnwczQWyiWdyZ kEFrHWYllPave6I0rVN0V5VigqhlQXYDb6ZgStzq/CsjCX3WTNgWmqjYcxqTQTOAS3 bKDktl/dfeUBAAcclbGoEo+rYcyGhItGbUWzVih5606sVv4Mxv3Re3mwE/2EPM4gzL de1Ysl448pqHqa2+5u/Y/G07/qAZWW8B8nbKiJwAzOWmG0NaJBwcXR+99dMnXTfgYL +BkbZ5BubCDPg== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.2 at mail Date: Fri, 09 Nov 2018 00:18:02 +0100 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH net-next 3/9] net/core: use __vlan_hwaccel helpers MIME-Version: 1.0 To: netdev@vger.kernel.org Cc: "David S. Miller" , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Ajit Khaparde , Alexey Kuznetsov , bridge@lists.linux-foundation.org, coreteam@netfilter.org, Florian Westphal , Hideaki YOSHIFUJI , Jozsef Kadlecsik , linux-rdma@vger.kernel.org, Mirko Lindner , netfilter-devel@vger.kernel.org, Nikolay Aleksandrov , Pablo Neira Ayuso , Roopa Prabhu , Sathya Perla , Somnath Kotur , Sriharsha Basavapatna , Stephen Hemminger , Steve Wise , Tariq Toukan Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This removes assumptions about VLAN_TAG_PRESENT bit. Signed-off-by: Michał Mirosław --- net/core/dev.c | 8 +++++--- net/core/skbuff.c | 2 +- net/sched/act_vlan.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index 0ffcbdd55fa9..bf7e0a471186 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4889,7 +4889,7 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc, * and set skb->priority like in vlan_do_receive() * For the time being, just ignore Priority Code Point */ - skb->vlan_tci = 0; + __vlan_hwaccel_clear_tag(skb); } type = skb->protocol; @@ -5386,7 +5386,9 @@ static struct list_head *gro_list_prepare(struct napi_struct *napi, } diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev; - diffs |= p->vlan_tci ^ skb->vlan_tci; + diffs |= skb_vlan_tag_present(p) ^ skb_vlan_tag_present(skb); + if (skb_vlan_tag_present(p)) + diffs |= p->vlan_tci ^ skb->vlan_tci; diffs |= skb_metadata_dst_cmp(p, skb); diffs |= skb_metadata_differs(p, skb); if (maclen == ETH_HLEN) @@ -5652,7 +5654,7 @@ static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb) __skb_pull(skb, skb_headlen(skb)); /* restore the reserve we had after netdev_alloc_skb_ip_align() */ skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN - skb_headroom(skb)); - skb->vlan_tci = 0; + __vlan_hwaccel_clear_tag(skb); skb->dev = napi->dev; skb->skb_iif = 0; skb->encapsulation = 0; diff --git a/net/core/skbuff.c b/net/core/skbuff.c index b4ee5c8b928f..5bb5eb500605 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -5123,7 +5123,7 @@ int skb_vlan_pop(struct sk_buff *skb) int err; if (likely(skb_vlan_tag_present(skb))) { - skb->vlan_tci = 0; + __vlan_hwaccel_clear_tag(skb); } else { if (unlikely(!eth_type_vlan(skb->protocol))) return 0; diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index ba677d54a7af..93fdaf707313 100644 --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c @@ -63,7 +63,7 @@ static int tcf_vlan_act(struct sk_buff *skb, const struct tc_action *a, /* extract existing tag (and guarantee no hw-accel tag) */ if (skb_vlan_tag_present(skb)) { tci = skb_vlan_tag_get(skb); - skb->vlan_tci = 0; + __vlan_hwaccel_clear_tag(skb); } else { /* in-payload vlan tag, pop it */ err = __skb_vlan_pop(skb, &tci);