From patchwork Thu Nov 8 23:18:04 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: 10675125 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 DFFB213BF for ; Thu, 8 Nov 2018 23:18:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D17592E7FE for ; Thu, 8 Nov 2018 23:18:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2BE72E817; Thu, 8 Nov 2018 23:18:20 +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 6FBF42E7FE for ; Thu, 8 Nov 2018 23:18:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726140AbeKII4G (ORCPT ); Fri, 9 Nov 2018 03:56:06 -0500 Received: from rere.qmqm.pl ([91.227.64.183]:4793 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbeKIIz6 (ORCPT ); Fri, 9 Nov 2018 03:55:58 -0500 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 42rfLp55vJzt1; Fri, 9 Nov 2018 00:17:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1541719026; bh=Z+HNaM5fXyVuKUciR7QSnLsdYJK4FdXmDw4Sv4STP4I=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=IouwOZhEURVgmCgVYXMvjKvX41KQpKfCuBLDv8+wUi7LGkRb1rO0kRGHPj4VkshZn eO1OS6l9+6qUiMxhh54jPLRqCs1mdpvjDKlwe/0O2EccRABJoYKY8On+omibR2I8/H 0zWYokVTsV0FUps3v6GZNza/8h1HYwteulzOOVMIX8mLlHTnohbfJg8pPzU3SHh7cn LHl7paCWDDbIfE7I7oCoWvnfB4cP3g4d5ycQqu4ELenfYJVHC6BZ45KZMoQ/LbrndW GR3YOeOTXPeJsFtdX1EnCxlMKd/lDOLiISOZL3b5gieUdMfVQDVubUU7EEK9dn81Fe k/61gM58lIi1g== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.2 at mail Date: Fri, 09 Nov 2018 00:18:04 +0100 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH net-next 7/9] benet: use __vlan_hwaccel helpers MIME-Version: 1.0 To: netdev@vger.kernel.org Cc: Sathya Perla , Ajit Khaparde , Sriharsha Basavapatna , Somnath Kotur , Alexey Kuznetsov , bridge@lists.linux-foundation.org, Cong Wang , coreteam@netfilter.org, "David S. Miller" , Florian Westphal , Hideaki YOSHIFUJI , Jamal Hadi Salim , Jiri Pirko , Jozsef Kadlecsik , linux-rdma@vger.kernel.org, Mirko Lindner , netfilter-devel@vger.kernel.org, Nikolay Aleksandrov , Pablo Neira Ayuso , Roopa Prabhu , 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 Signed-off-by: Michał Mirosław --- drivers/net/ethernet/emulex/benet/be_main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index c5ad7a4f4d83..80b2bd3747ce 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -1049,30 +1049,35 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter, struct be_wrb_params *wrb_params) { + bool insert_vlan = false; u16 vlan_tag = 0; skb = skb_share_check(skb, GFP_ATOMIC); if (unlikely(!skb)) return skb; - if (skb_vlan_tag_present(skb)) + if (skb_vlan_tag_present(skb)) { vlan_tag = be_get_tx_vlan_tag(adapter, skb); + insert_vlan = true; + } if (qnq_async_evt_rcvd(adapter) && adapter->pvid) { - if (!vlan_tag) + if (!insert_vlan) { vlan_tag = adapter->pvid; + insert_vlan = true; + } /* f/w workaround to set skip_hw_vlan = 1, informs the F/W to * skip VLAN insertion */ BE_WRB_F_SET(wrb_params->features, VLAN_SKIP_HW, 1); } - if (vlan_tag) { + if (insert_vlan) { skb = vlan_insert_tag_set_proto(skb, htons(ETH_P_8021Q), vlan_tag); if (unlikely(!skb)) return skb; - skb->vlan_tci = 0; + __vlan_hwaccel_clear_tag(skb); } /* Insert the outer VLAN, if any */