Message ID | 1486953556-87111-6-git-send-email-yi.y.yang@intel.com |
---|---|
State | Accepted |
Headers | show |
On Mon, Feb 13, 2017 at 10:39:16AM +0800, Yi Yang wrote: > The root cause is the upcall re-inserts the VLAN back into the raw > packet data, but the TPID is hard coded to 0x8100. This affects > kernels for which HAVE_VLAN_INSERT_TAG_SET_PROTO is not set. > > The below patch allows the cvlan and 802.ad tests to pass on debian > with 3.16 kernel. > > Signed-off-by: Eric Garver <e@erig.me> > Signed-off-by: Yi Yang <yi.y.yang@intel.com> > --- Acked-by: Eric Garver <e@erig.me>
diff --git a/datapath/linux/compat/include/linux/if_vlan.h b/datapath/linux/compat/include/linux/if_vlan.h index d51e5c9..fc95b04 100644 --- a/datapath/linux/compat/include/linux/if_vlan.h +++ b/datapath/linux/compat/include/linux/if_vlan.h @@ -24,8 +24,9 @@ * acceptable. */ #define vlan_insert_tag_set_proto(skb, proto, vlan_tci) \ - rpl_vlan_insert_tag_set_proto(skb, vlan_tci) + rpl_vlan_insert_tag_set_proto(skb, proto, vlan_tci) static inline struct sk_buff *rpl_vlan_insert_tag_set_proto(struct sk_buff *skb, + __be16 vlan_proto, u16 vlan_tci) { struct vlan_ethhdr *veth; @@ -41,12 +42,12 @@ static inline struct sk_buff *rpl_vlan_insert_tag_set_proto(struct sk_buff *skb, skb->mac_header -= VLAN_HLEN; /* first, the ethernet type */ - veth->h_vlan_proto = htons(ETH_P_8021Q); + veth->h_vlan_proto = vlan_proto; /* now, the TCI */ veth->h_vlan_TCI = htons(vlan_tci); - skb->protocol = htons(ETH_P_8021Q); + skb->protocol = vlan_proto; return skb; }