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)