Commit 2064c3d4 authored by Jianbo Liu's avatar Jianbo Liu Committed by David S. Miller

net/flow_dissector: Save vlan ethertype from headers

Change vlan dissector key to save vlan tpid to support both 802.1Q
and 802.1AD ethertype.
Signed-off-by: default avatarJianbo Liu <jianbol@mellanox.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 94c76351
...@@ -47,7 +47,7 @@ struct flow_dissector_key_tags { ...@@ -47,7 +47,7 @@ struct flow_dissector_key_tags {
struct flow_dissector_key_vlan { struct flow_dissector_key_vlan {
u16 vlan_id:12, u16 vlan_id:12,
vlan_priority:3; vlan_priority:3;
u16 padding; __be16 vlan_tpid;
}; };
struct flow_dissector_key_mpls { struct flow_dissector_key_mpls {
......
...@@ -751,6 +751,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb, ...@@ -751,6 +751,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
const struct vlan_hdr *vlan; const struct vlan_hdr *vlan;
struct vlan_hdr _vlan; struct vlan_hdr _vlan;
bool vlan_tag_present = skb && skb_vlan_tag_present(skb); bool vlan_tag_present = skb && skb_vlan_tag_present(skb);
__be16 saved_vlan_tpid = proto;
if (vlan_tag_present) if (vlan_tag_present)
proto = skb->protocol; proto = skb->protocol;
...@@ -789,6 +790,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb, ...@@ -789,6 +790,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
(ntohs(vlan->h_vlan_TCI) & (ntohs(vlan->h_vlan_TCI) &
VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT; VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT;
} }
key_vlan->vlan_tpid = saved_vlan_tpid;
} }
fdret = FLOW_DISSECT_RET_PROTO_AGAIN; fdret = FLOW_DISSECT_RET_PROTO_AGAIN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment