mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
net: remove VLAN_TAG_PRESENT
Replace VLAN_TAG_PRESENT with single bit flag and free up VLAN.CFI overload. Now VLAN.CFI is visible in networking stack and can be passed around intact. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4b50d23179
commit
0c4b2d3705
7 changed files with 23 additions and 34 deletions
|
@ -66,7 +66,6 @@ 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_TAG_PRESENT VLAN_CFI_MASK
|
||||
#define VLAN_VID_MASK 0x0fff /* VLAN Identifier */
|
||||
#define VLAN_N_VID 4096
|
||||
|
||||
|
@ -78,8 +77,8 @@ static inline bool is_vlan_dev(const struct net_device *dev)
|
|||
return dev->priv_flags & IFF_802_1Q_VLAN;
|
||||
}
|
||||
|
||||
#define skb_vlan_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT)
|
||||
#define skb_vlan_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
|
||||
#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_prio(__skb) (((__skb)->vlan_tci & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT)
|
||||
|
||||
|
@ -480,7 +479,7 @@ static inline struct sk_buff *vlan_insert_tag_set_proto(struct sk_buff *skb,
|
|||
*/
|
||||
static inline void __vlan_hwaccel_clear_tag(struct sk_buff *skb)
|
||||
{
|
||||
skb->vlan_tci = 0;
|
||||
skb->vlan_present = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -492,6 +491,7 @@ static inline void __vlan_hwaccel_clear_tag(struct sk_buff *skb)
|
|||
*/
|
||||
static inline void __vlan_hwaccel_copy_tag(struct sk_buff *dst, const struct sk_buff *src)
|
||||
{
|
||||
dst->vlan_present = src->vlan_present;
|
||||
dst->vlan_proto = src->vlan_proto;
|
||||
dst->vlan_tci = src->vlan_tci;
|
||||
}
|
||||
|
@ -526,7 +526,8 @@ static inline void __vlan_hwaccel_put_tag(struct sk_buff *skb,
|
|||
__be16 vlan_proto, u16 vlan_tci)
|
||||
{
|
||||
skb->vlan_proto = vlan_proto;
|
||||
skb->vlan_tci = VLAN_TAG_PRESENT | vlan_tci;
|
||||
skb->vlan_tci = vlan_tci;
|
||||
skb->vlan_present = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue