From patchwork Tue Nov 20 12:20:31 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: 10690341 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 6990616B1 for ; Tue, 20 Nov 2018 12:20:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B57C2A57F for ; Tue, 20 Nov 2018 12:20:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FCF62A5A2; Tue, 20 Nov 2018 12:20:46 +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 E97952A57F for ; Tue, 20 Nov 2018 12:20:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728041AbeKTWtZ (ORCPT ); Tue, 20 Nov 2018 17:49:25 -0500 Received: from rere.qmqm.pl ([91.227.64.183]:9633 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728494AbeKTWtZ (ORCPT ); Tue, 20 Nov 2018 17:49:25 -0500 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 42zlBP20Nwz60; Tue, 20 Nov 2018 13:19:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1542716365; bh=nnvDNuBYGKXjTeSuCgAsalcyLiMpvELCFuUjj+Ow0Xs=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=ikcn8FP/DXNNInajMmS9m5HzO9P+QzN3SDovQATdbeaYNdA6DtvXu8ovHYsYp6ib7 o/5vOcTMivAC5ul2flhGSpBGGHE2udGFLafdb1yyTlYU4V5kL1aGucd3p32fqV9+SP ujCkYkFAKqSmLza4YCAvkToU/coa8ZbKHQIRTy4nj2aEQEk+2H+S8K9xJYvQqXlLNy cELKHeZugHi+bYaQPDu8utSqG+QA2viNXZs/eCZ3bqPqGLq32zLsdwX/z7L4izkVMo jU/nxd/uECWHg1vYm9reJyXIK2sv7W4eDnS0z3EHR+Vf3ghJxoQUCYhpMmrj7aMD9x QGKJ1BceXYbpw== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.2 at mail Date: Tue, 20 Nov 2018 13:20:31 +0100 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH net-next 1/4] net/vlan: introduce skb_vlan_tag_get_cfi() helper MIME-Version: 1.0 To: netdev@vger.kernel.org Cc: Ajit Khaparde , devel@linuxdriverproject.org, Haiyang Zhang , "K. Y. Srinivasan" , Leon Romanovsky , linux-rdma@vger.kernel.org, Saeed Mahameed , Sathya Perla , Somnath Kotur , Sriharsha Basavapatna , Stephen Hemminger 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 Abstract CFI/DEI bit access consistently with other VLAN tag fields. Signed-off-by: Michał Mirosław --- include/linux/if_vlan.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 7a541eadf78e..4cca4da7a6de 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -65,7 +65,7 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb) #define VLAN_PRIO_MASK 0xe000 /* Priority Code Point */ #define VLAN_PRIO_SHIFT 13 -#define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator */ +#define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator / Drop Eligible Indicator */ #define VLAN_VID_MASK 0x0fff /* VLAN Identifier */ #define VLAN_N_VID 4096 @@ -80,6 +80,7 @@ static inline bool is_vlan_dev(const struct net_device *dev) #define skb_vlan_tag_present(__skb) ((__skb)->vlan_present) #define skb_vlan_tag_get(__skb) ((__skb)->vlan_tci) #define skb_vlan_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) +#define skb_vlan_tag_get_cfi(__skb) (!!((__skb)->vlan_tci & VLAN_CFI_MASK)) #define skb_vlan_tag_get_prio(__skb) (((__skb)->vlan_tci & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT) static inline int vlan_get_rx_ctag_filter_info(struct net_device *dev) From patchwork Tue Nov 20 12:20:32 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: 10690335 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 9DD6913BB for ; Tue, 20 Nov 2018 12:20:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 904B02A57F for ; Tue, 20 Nov 2018 12:20:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 849F72A5A2; Tue, 20 Nov 2018 12:20:38 +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 39AEB2A57F for ; Tue, 20 Nov 2018 12:20:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729562AbeKTWt0 (ORCPT ); Tue, 20 Nov 2018 17:49:26 -0500 Received: from rere.qmqm.pl ([91.227.64.183]:45768 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728601AbeKTWt0 (ORCPT ); Tue, 20 Nov 2018 17:49:26 -0500 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 42zlBP48CWzSL; Tue, 20 Nov 2018 13:19:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1542716365; bh=nqstBcI6tID66TX8WpxXdVNk9BYwcQFLKLdTiHh3dJs=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=qCCIpUpxkI8dhnm17g/ZTJ6ZVpSNgzimmWg3ldFK2WqCz5Pul9JjrtABtTrZhkKBx gtgZAsBvVjTsuFHYmEhx0rBcq9wsQoFm4sJ4gTr4wIz2tjxzBs3Z+rma7EswAX/vjw zYRih9CRpDOm4wCgH8lWgz2owG2ke6xT6sFZl8DchpZfgEyIaH34el8r6w8iHFLQjZ SrMOBFZV/vlhx2LNLXh//QbpDQ19ETuD8ERwswIcDTst97RBodcam0ylTwdVZ+V7X/ qlA4kE4Se237frdwaloaizn1jN6Jt1E35/+BP6bXboH3wowxwcG85/zXk2hIvgJTa2 iobitz7ETrpmg== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.2 at mail Date: Tue, 20 Nov 2018 13:20:32 +0100 Message-Id: <61f737ec45c9905d5c86fbe8492eaa604bf6549f.1542716156.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH net-next 2/4] net/hyperv: use skb_vlan_tag_*() helpers MIME-Version: 1.0 To: netdev@vger.kernel.org Cc: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , devel@linuxdriverproject.org, Ajit Khaparde , Leon Romanovsky , linux-rdma@vger.kernel.org, Saeed Mahameed , Sathya Perla , Somnath Kotur , Sriharsha Basavapatna 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 Replace open-coded bitfield manipulation with skb_vlan_tag_*() helpers. This also enables correctly passing of VLAN.CFI bit. Signed-off-by: Michał Mirosław Reviewed-by: Haiyang Zhang --- drivers/net/hyperv/netvsc_drv.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index cf36e7ff3191..85936ed9e952 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -605,9 +605,9 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) IEEE_8021Q_INFO); vlan->value = 0; - vlan->vlanid = skb->vlan_tci & VLAN_VID_MASK; - vlan->pri = (skb->vlan_tci & VLAN_PRIO_MASK) >> - VLAN_PRIO_SHIFT; + vlan->vlanid = skb_vlan_tag_get_id(skb); + vlan->cfi = skb_vlan_tag_get_cfi(skb); + vlan->pri = skb_vlan_tag_get_prio(skb); } if (skb_is_gso(skb)) { @@ -781,7 +781,8 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net, } if (vlan) { - u16 vlan_tci = vlan->vlanid | (vlan->pri << VLAN_PRIO_SHIFT); + u16 vlan_tci = vlan->vlanid | (vlan->pri << VLAN_PRIO_SHIFT) | + (vlan->cfi ? VLAN_CFI_MASK : 0); __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tci); From patchwork Tue Nov 20 12:20:32 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: 10690339 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 D46FE13BB for ; Tue, 20 Nov 2018 12:20:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8A962A57F for ; Tue, 20 Nov 2018 12:20:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD3992A5A2; Tue, 20 Nov 2018 12:20:44 +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 5403C2A57F for ; Tue, 20 Nov 2018 12:20:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728601AbeKTWt2 (ORCPT ); Tue, 20 Nov 2018 17:49:28 -0500 Received: from rere.qmqm.pl ([91.227.64.183]:64302 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728782AbeKTWt0 (ORCPT ); Tue, 20 Nov 2018 17:49:26 -0500 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 42zlBQ00TvzbW; Tue, 20 Nov 2018 13:19:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1542716366; bh=+PIhvLqRA/MfGt9pdfuwCHRbQcE5w5nx74x+CCowD3Y=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=RQitZzuxQO1/+hBc8Hc35Oat0Y7NLD+kEXsRk1CxAPQOjXui/jUJTSgn/xpEUSZp4 WVmDwROOSrPaWxyKmtHLM2AY9gZ6LN5DHUshWJpirCVfVOweeW+7hMLiyqM4sn3EKV UO40Ab/ABTui0GusE+vlb2IsXlsZopmznmGtsl1esaiZTqygNcPGO2LLMNuUBeIEfo K0m9pYf0iDcoP/MQU5MVPr3AztSVJoh7yoW+JBSF8r40h2rD2F6kHPJJoWVVkrut2C SWnxZ+c3U3Cv8JNftjgIKues+PxVOhmrLwDU9sI71vCFyGVzMidGXTI1u6s3VTQUkY D8fkRhxb/rUYg== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.2 at mail Date: Tue, 20 Nov 2018 13:20:32 +0100 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH net-next 3/4] benet: use skb_vlan_tag_get_prio() MIME-Version: 1.0 To: netdev@vger.kernel.org Cc: Sathya Perla , Ajit Khaparde , Sriharsha Basavapatna , Somnath Kotur , devel@linuxdriverproject.org, Haiyang Zhang , "K. Y. Srinivasan" , Leon Romanovsky , linux-rdma@vger.kernel.org, Saeed Mahameed , Stephen Hemminger 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 80b2bd3747ce..245abf0d19c0 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -796,7 +796,7 @@ static inline u16 be_get_tx_vlan_tag(struct be_adapter *adapter, u16 vlan_tag; vlan_tag = skb_vlan_tag_get(skb); - vlan_prio = (vlan_tag & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT; + vlan_prio = skb_vlan_tag_get_prio(skb); /* If vlan priority provided by OS is NOT in available bmap */ if (!(adapter->vlan_prio_bmap & (1 << vlan_prio))) vlan_tag = (vlan_tag & ~VLAN_PRIO_MASK) | From patchwork Tue Nov 20 12:20:33 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: 10690337 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 2342A13BB for ; Tue, 20 Nov 2018 12:20:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15C952A5A1 for ; Tue, 20 Nov 2018 12:20:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 098E62A5AC; Tue, 20 Nov 2018 12:20:44 +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 8E5982A5A1 for ; Tue, 20 Nov 2018 12:20:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728782AbeKTWtb (ORCPT ); Tue, 20 Nov 2018 17:49:31 -0500 Received: from rere.qmqm.pl ([91.227.64.183]:31886 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729521AbeKTWt0 (ORCPT ); Tue, 20 Nov 2018 17:49:26 -0500 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 42zlBQ3KFyzdt; Tue, 20 Nov 2018 13:19:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1542716366; bh=Oo8d6E0e1cnfv8jWdqyzj7VpdpVuu4lVgZB9S1jqWk4=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=ecMNQntN/LLZfGNZ4c4MiLiwYIRG7K63WVdoz1lEGpUidpfT5kPCF+WjK44M7tleX 0yECuTsaZISklKIPuNmT44bcSHONI0C+4910NNwqz9io+2sFm4o7Tya2Fep5UBXWaI 6cA0PUAQBFF7+QANVHSwaM3ZgkrCh/ZRkAxDBE3/+xBiOrlMFOlMohPPt72KAkGtLF ozV8buRTxQcpwIfFxqHT1cECpl1W7LJn72ElD3vXcPJoTPNhU+ndpTB/pAPHq6KK3b 4XnqWAIehVMI0bXVv6CSaGAIDqxwbrzHwwsopo58VT8S+dxlidfp8pdl2Z3/up+O86 a71uJqhjetI9w== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.2 at mail Date: Tue, 20 Nov 2018 13:20:33 +0100 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH net-next 4/4] mlx5: use skb_vlan_tag_get_prio() MIME-Version: 1.0 To: netdev@vger.kernel.org Cc: Saeed Mahameed , Leon Romanovsky , linux-rdma@vger.kernel.org, Ajit Khaparde , devel@linuxdriverproject.org, Haiyang Zhang , "K. Y. Srinivasan" , Sathya Perla , Somnath Kotur , Sriharsha Basavapatna , Stephen Hemminger 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/mellanox/mlx5/core/en_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c index 6dacaeba2fbf..9afdf955f2bc 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c @@ -127,7 +127,7 @@ u16 mlx5e_select_queue(struct net_device *dev, struct sk_buff *skb, else #endif if (skb_vlan_tag_present(skb)) - up = skb->vlan_tci >> VLAN_PRIO_SHIFT; + up = skb_vlan_tag_get_prio(skb); /* channel_ix can be larger than num_channels since * dev->num_real_tx_queues = num_channels * num_tc