diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2018-11-20 15:20:31 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-22 02:41:30 +0300 |
commit | a2e768b861108d846b6df21074cff738660b45b7 (patch) | |
tree | 2791c0a18b81a537fd4fd82569be1e4b2c6e4c0f /include/linux/if_vlan.h | |
parent | 11c6c0c22857967815b65cc7692181866549a06f (diff) | |
download | linux-a2e768b861108d846b6df21074cff738660b45b7.tar.xz |
net/vlan: introduce skb_vlan_tag_get_cfi() helper
Abstract CFI/DEI bit access consistently with other VLAN tag fields.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/if_vlan.h')
-rw-r--r-- | include/linux/if_vlan.h | 3 |
1 files changed, 2 insertions, 1 deletions
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) |