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: 1000435 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rere.qmqm.pl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=rere.qmqm.pl header.i=@rere.qmqm.pl header.b="ikcn8FP/"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42zlCm2fCXz9s3q for ; Tue, 20 Nov 2018 23:20:36 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729559AbeKTWt0 (ORCPT ); Tue, 20 Nov 2018 17:49:26 -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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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)