Re: [PATCH v4 2/2] ip_tunnel: add mpls over gre encapsulation
From: Amine Kherbouche <hidden>
Date: 2017-10-04 17:03:34
On 09/29/2017 06:11 AM, Tom Herbert wrote:
quoted
quoted
@@ -122,6 +125,30 @@ int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi, } EXPORT_SYMBOL(gre_parse_header); +#if IS_ENABLED(CONFIG_MPLS) +int mpls_gre_rcv(struct sk_buff *skb, int gre_hdr_len) +{ + if (unlikely(!pskb_may_pull(skb, gre_hdr_len))) + goto drop; + + /* Pop GRE hdr and reset the skb */ + skb_pull(skb, gre_hdr_len); + skb_reset_network_header(skb); +I don't see why MPLS/GRE needs to be a special case in gre_rcv. Can't we just follow the normal processing patch which calls the proto ops handler for the protocol in the GRE header? Also, if protocol specific code is added to rcv function that most likely means that we need to update the related offloads also (grant it that MPLS doesn't support GRO but it looks like it supports GSO). Additionally, we'd need to consider if flow dissector needs a similar special case (I will point out that my recently posted patches there eliminated TEB as the one special case in GRE dissection). Thanks, Tom
Hi Tom, Thanks for the feedback, I think this is the best way to do it, I'll do a v6 asap. Regards, Amine