[{"id":1773115,"web_url":"http://patchwork.ozlabs.org/comment/1773115/","msgid":"<20170921212536.GA814@electric-eye.fr.zoreil.com>","list_archive_url":null,"date":"2017-09-21T21:25:36","subject":"Re: [PATCH 2/2] ip_tunnel: add mpls over gre encapsulation","submitter":{"id":513,"url":"http://patchwork.ozlabs.org/api/people/513/","name":"Francois Romieu","email":"romieu@fr.zoreil.com"},"content":"Amine Kherbouche <amine.kherbouche@6wind.com> :\n[...]\n> diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c\n> index 36ea2ad..060ed07 100644\n> --- a/net/mpls/af_mpls.c\n> +++ b/net/mpls/af_mpls.c\n[...]\n> @@ -39,6 +40,40 @@ static int one = 1;\n>  static int label_limit = (1 << 20) - 1;\n>  static int ttl_max = 255;\n>  \n> +size_t ipgre_mpls_encap_hlen(struct ip_tunnel_encap *e)\n> +{\n> +\treturn sizeof(struct mpls_shim_hdr);\n> +}\n> +\n> +int ipgre_mpls_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,\n> +\t\t\t    u8 *protocol, struct flowi4 *fl4)\n> +{\n> +\treturn 0;\n> +}\n> +\n> +static const struct ip_tunnel_encap_ops mpls_iptun_ops = {\n> +\t.encap_hlen = ipgre_mpls_encap_hlen,\n> +\t.build_header = ipgre_mpls_build_header,\n> +};\n\nNit: af_mpls.c uses tab before '=' in such places.\n\n> +\n> +int ipgre_tunnel_encap_add_mpls_ops(void)\n> +{\n> +\tint ret;\n> +\n> +\tret = ip_tunnel_encap_add_ops(&mpls_iptun_ops, TUNNEL_ENCAP_MPLS);\n\nip_tunnel_encap_add_ops is CONFIG_NET_IP_TUNNEL dependant.\n\nAfaics CONFIG_MPLS does not enforce it.\n\n[...]\n> @@ -2486,6 +2521,7 @@ static int __init mpls_init(void)\n>  \t\t      0);\n>  \trtnl_register(PF_MPLS, RTM_GETNETCONF, mpls_netconf_get_devconf,\n>  \t\t      mpls_netconf_dump_devconf, 0);\n> +\tipgre_tunnel_encap_add_mpls_ops();\n>  \terr = 0;\n>  out:\n>  \treturn err;\n\nipgre_tunnel_encap_add_mpls_ops status return code is not checked.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyqR66htDz9s7c\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 22 Sep 2017 07:25:54 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751794AbdIUVZu (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 21 Sep 2017 17:25:50 -0400","from violet.fr.zoreil.com ([92.243.8.30]:57370 \"EHLO\n\tviolet.fr.zoreil.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751707AbdIUVZt (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 21 Sep 2017 17:25:49 -0400","from violet.fr.zoreil.com (localhost [127.0.0.1])\n\tby violet.fr.zoreil.com (8.14.9/8.14.9) with ESMTP id v8LLPbZn000823; \n\tThu, 21 Sep 2017 23:25:37 +0200","(from romieu@localhost)\n\tby violet.fr.zoreil.com (8.14.9/8.14.5/Submit) id v8LLPaC7000822;\n\tThu, 21 Sep 2017 23:25:36 +0200"],"Date":"Thu, 21 Sep 2017 23:25:36 +0200","From":"Francois Romieu <romieu@fr.zoreil.com>","To":"Amine Kherbouche <amine.kherbouche@6wind.com>","Cc":"netdev@vger.kernel.org, xeb@mail.ru, roopa@cumulusnetworks.com,\n\tequinox@diac24.net","Subject":"Re: [PATCH 2/2] ip_tunnel: add mpls over gre encapsulation","Message-ID":"<20170921212536.GA814@electric-eye.fr.zoreil.com>","References":"<1505985924-12479-1-git-send-email-amine.kherbouche@6wind.com>\n\t<1505985924-12479-3-git-send-email-amine.kherbouche@6wind.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<1505985924-12479-3-git-send-email-amine.kherbouche@6wind.com>","X-Organisation":"Land of Sunshine Inc.","User-Agent":"Mutt/1.5.23 (2014-03-12)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1773126,"web_url":"http://patchwork.ozlabs.org/comment/1773126/","msgid":"<dd6e449c-af1b-47ad-5bfb-1406a711b609@6wind.com>","list_archive_url":null,"date":"2017-09-21T21:39:13","subject":"Re: [PATCH 2/2] ip_tunnel: add mpls over gre encapsulation","submitter":{"id":72147,"url":"http://patchwork.ozlabs.org/api/people/72147/","name":"Amine Kherbouche","email":"amine.kherbouche@6wind.com"},"content":"Hi Francois,\n\nThanks for the feedback, I'll make it for the next version.\n\nOn 21/09/2017 23:25, Francois Romieu wrote:\n> Amine Kherbouche <amine.kherbouche@6wind.com> :\n> [...]\n>> diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c\n>> index 36ea2ad..060ed07 100644\n>> --- a/net/mpls/af_mpls.c\n>> +++ b/net/mpls/af_mpls.c\n> [...]\n>> @@ -39,6 +40,40 @@ static int one = 1;\n>>   static int label_limit = (1 << 20) - 1;\n>>   static int ttl_max = 255;\n>>   \n>> +size_t ipgre_mpls_encap_hlen(struct ip_tunnel_encap *e)\n>> +{\n>> +\treturn sizeof(struct mpls_shim_hdr);\n>> +}\n>> +\n>> +int ipgre_mpls_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,\n>> +\t\t\t    u8 *protocol, struct flowi4 *fl4)\n>> +{\n>> +\treturn 0;\n>> +}\n>> +\n>> +static const struct ip_tunnel_encap_ops mpls_iptun_ops = {\n>> +\t.encap_hlen = ipgre_mpls_encap_hlen,\n>> +\t.build_header = ipgre_mpls_build_header,\n>> +};\n> Nit: af_mpls.c uses tab before '=' in such places.\n>\n>> +\n>> +int ipgre_tunnel_encap_add_mpls_ops(void)\n>> +{\n>> +\tint ret;\n>> +\n>> +\tret = ip_tunnel_encap_add_ops(&mpls_iptun_ops, TUNNEL_ENCAP_MPLS);\n> ip_tunnel_encap_add_ops is CONFIG_NET_IP_TUNNEL dependant.\n>\n> Afaics CONFIG_MPLS does not enforce it.\n>\n> [...]\n>> @@ -2486,6 +2521,7 @@ static int __init mpls_init(void)\n>>   \t\t      0);\n>>   \trtnl_register(PF_MPLS, RTM_GETNETCONF, mpls_netconf_get_devconf,\n>>   \t\t      mpls_netconf_dump_devconf, 0);\n>> +\tipgre_tunnel_encap_add_mpls_ops();\n>>   \terr = 0;\n>>   out:\n>>   \treturn err;\n> ipgre_tunnel_encap_add_mpls_ops status return code is not checked.\n>","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=6wind-com.20150623.gappssmtp.com\n\theader.i=@6wind-com.20150623.gappssmtp.com\n\theader.b=\"XK26039h\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyqkS5fV8z9t2Q\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 22 Sep 2017 07:39:12 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751791AbdIUVjK (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 21 Sep 2017 17:39:10 -0400","from mail-wr0-f180.google.com ([209.85.128.180]:43052 \"EHLO\n\tmail-wr0-f180.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751728AbdIUVjJ (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 21 Sep 2017 17:39:09 -0400","by mail-wr0-f180.google.com with SMTP id a43so5546724wrc.0\n\tfor <netdev@vger.kernel.org>; Thu, 21 Sep 2017 14:39:09 -0700 (PDT)","from [172.20.10.4] ([80.215.225.55])\n\tby smtp.gmail.com with ESMTPSA id\n\tb89sm3628393wrd.42.2017.09.21.14.39.07\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 21 Sep 2017 14:39:07 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=subject:to:references:cc:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-transfer-encoding;\n\tbh=Aclj/4kVfRhRToQdmuREJV2zmkTEKTeY5/9VH++KYqM=;\n\tb=XK26039hpbfcd0v3d8Xj+wdsJGeEsmKGjXSD+KNuNPbb02sxMFKTfrjqN9SZpXnP/X\n\tRMUKYqEcJ+DWveu43Iw5HZtsuzAJqp0qCadYwAiEbrNou7NkXGbvQoocsedCUDDjibg7\n\tN75CUTbLEgzqLXecCWFKi6sQJP1+FdccbmnXRHWF6JVh4TFd3vDCwUlchN01I/2ck6f8\n\tuKQef7dGucXIZGf4pU/vHNhokFoEsuP19V7CzYWPgzk0JLWNzKp2bxLDFK/kV45rSVga\n\tHptN12m95XCLcEHo1OLkoFWN4SbCzRNmZQJ23UDnnhR96Ff7fF+ogYZHUZt2UpohmV4G\n\twLuQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:references:cc:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-transfer-encoding;\n\tbh=Aclj/4kVfRhRToQdmuREJV2zmkTEKTeY5/9VH++KYqM=;\n\tb=jci63dy2NuAby7+4YhVgTRnLe49P7dei7vZNaAEHDi9a2ozUrzp5S91i3g/LQem3XV\n\tNRId77eLq7rjYrPDERi21j7GiV8alTYr7uqM9SnsJtbcfIbcHfkbU1fAbnmCD7FiSD8J\n\tLz8sYYdkekQsGQmjGGnNujS+d3wZv8F94/Djn6kHHI2gW2S6+91ctHALp2hD9SPxMBui\n\tFKC885J6Bl7VWhKvyjU8NG82tqvYqzTF1sf/+dCfF0qNytzlqAgSec5BxTzmOmp0dW/R\n\tacwMMA+XHrXo4JFxTSTvTTHIvYJrViDgH/8cwrh+bVP+H7Ngcnzvg9AgGgpVdhSXwPON\n\t8iNQ==","X-Gm-Message-State":"AHPjjUgohwVjB9cDF9jNtoZoALCsXwMiSYfWtGQssnlVmLUs4BhyO/J1\n\tUAqJ4qKP8xH8gmNOMTBOJ5P6Mg==","X-Google-Smtp-Source":"AOwi7QA2Xfnr+DVo7DLk5LmnGRjWktCy6/2Xeul7l8rHJf4kNADNqetgTPeWS4C8+07WujmGBbUFXA==","X-Received":"by 10.223.142.82 with SMTP id n76mr3318045wrb.272.1506029948465; \n\tThu, 21 Sep 2017 14:39:08 -0700 (PDT)","Subject":"Re: [PATCH 2/2] ip_tunnel: add mpls over gre encapsulation","To":"Francois Romieu <romieu@fr.zoreil.com>","References":"<1505985924-12479-1-git-send-email-amine.kherbouche@6wind.com>\n\t<1505985924-12479-3-git-send-email-amine.kherbouche@6wind.com>\n\t<20170921212536.GA814@electric-eye.fr.zoreil.com>","Cc":"netdev@vger.kernel.org, xeb@mail.ru, roopa@cumulusnetworks.com,\n\tequinox@diac24.net","From":"Amine Kherbouche <amine.kherbouche@6wind.com>","Message-ID":"<dd6e449c-af1b-47ad-5bfb-1406a711b609@6wind.com>","Date":"Thu, 21 Sep 2017 23:39:13 +0200","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0)\n\tGecko/20100101 Thunderbird/45.0","MIME-Version":"1.0","In-Reply-To":"<20170921212536.GA814@electric-eye.fr.zoreil.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1773149,"web_url":"http://patchwork.ozlabs.org/comment/1773149/","msgid":"<CAJieiUicOTaxeT4t-y6QzoPibi1i7WJ31X978OP6sqjMjVuVNw@mail.gmail.com>","list_archive_url":null,"date":"2017-09-21T22:35:27","subject":"Re: [PATCH 2/2] ip_tunnel: add mpls over gre encapsulation","submitter":{"id":23500,"url":"http://patchwork.ozlabs.org/api/people/23500/","name":"Roopa Prabhu","email":"roopa@cumulusnetworks.com"},"content":"On Thu, Sep 21, 2017 at 2:25 AM, Amine Kherbouche\n<amine.kherbouche@6wind.com> wrote:\n> This commit introduces the MPLSoGRE support (RFC 4023), using ip tunnel\n> API.\n>\n> Encap:\n>   - Add a new iptunnel type mpls.\n>\n> Decap:\n>   - pull gre hdr and call mpls_forward().\n>\n> Signed-off-by: Amine Kherbouche <amine.kherbouche@6wind.com>\n> ---\n>  include/net/gre.h              |  3 +++\n>  include/uapi/linux/if_tunnel.h |  1 +\n>  net/ipv4/gre_demux.c           | 22 ++++++++++++++++++++++\n>  net/ipv4/ip_gre.c              |  9 +++++++++\n>  net/ipv6/ip6_gre.c             |  7 +++++++\n>  net/mpls/af_mpls.c             | 37 +++++++++++++++++++++++++++++++++++++\n>  6 files changed, 79 insertions(+)\n>\n> diff --git a/include/net/gre.h b/include/net/gre.h\n> index d25d836..88a8343 100644\n> --- a/include/net/gre.h\n> +++ b/include/net/gre.h\n> @@ -35,6 +35,9 @@ struct net_device *gretap_fb_dev_create(struct net *net, const char *name,\n>                                        u8 name_assign_type);\n>  int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi,\n>                      bool *csum_err, __be16 proto, int nhs);\n> +#if IS_ENABLED(CONFIG_MPLS)\n> +int mpls_gre_rcv(struct sk_buff *skb, int gre_hdr_len);\n> +#endif\n>\n>  static inline int gre_calc_hlen(__be16 o_flags)\n>  {\n> diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h\n> index 2e52088..a2f48c0 100644\n> --- a/include/uapi/linux/if_tunnel.h\n> +++ b/include/uapi/linux/if_tunnel.h\n> @@ -84,6 +84,7 @@ enum tunnel_encap_types {\n>         TUNNEL_ENCAP_NONE,\n>         TUNNEL_ENCAP_FOU,\n>         TUNNEL_ENCAP_GUE,\n> +       TUNNEL_ENCAP_MPLS,\n>  };\n>\n>  #define TUNNEL_ENCAP_FLAG_CSUM         (1<<0)\n> diff --git a/net/ipv4/gre_demux.c b/net/ipv4/gre_demux.c\n> index b798862..a6a937e 100644\n> --- a/net/ipv4/gre_demux.c\n> +++ b/net/ipv4/gre_demux.c\n> @@ -23,6 +23,9 @@\n>  #include <linux/netdevice.h>\n>  #include <linux/if_tunnel.h>\n>  #include <linux/spinlock.h>\n> +#if IS_ENABLED(CONFIG_MPLS)\n> +#include <linux/mpls.h>\n> +#endif\n>  #include <net/protocol.h>\n>  #include <net/gre.h>\n>\n> @@ -122,6 +125,25 @@ int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi,\n>  }\n>  EXPORT_SYMBOL(gre_parse_header);\n>\n> +#if IS_ENABLED(CONFIG_MPLS)\n> +int mpls_gre_rcv(struct sk_buff *skb, int gre_hdr_len)\n> +{\n> +       if (unlikely(!pskb_may_pull(skb, gre_hdr_len)))\n> +               goto drop;\n> +\n> +       /* Pop GRE hdr and reset the skb */\n> +       skb_pull(skb, gre_hdr_len);\n> +       skb_reset_network_header(skb);\n> +\n> +       mpls_forward(skb, skb->dev, NULL, NULL);\n> +\n> +       return 0;\n> +drop:\n> +       return NET_RX_DROP;\n> +}\n> +EXPORT_SYMBOL(mpls_gre_rcv);\n> +#endif\n> +\n>  static int gre_rcv(struct sk_buff *skb)\n>  {\n>         const struct gre_protocol *proto;\n> diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c\n> index 9cee986..dd4431c 100644\n> --- a/net/ipv4/ip_gre.c\n> +++ b/net/ipv4/ip_gre.c\n> @@ -412,10 +412,19 @@ static int gre_rcv(struct sk_buff *skb)\n>                         return 0;\n>         }\n>\n> +#if IS_ENABLED(CONFIG_MPLS)\n> +       if (unlikely(tpi.proto == htons(ETH_P_MPLS_UC))) {\n> +               if (mpls_gre_rcv(skb, hdr_len))\n> +                       goto drop;\n> +               return 0;\n> +       }\n> +#endif\n> +\n>         if (ipgre_rcv(skb, &tpi, hdr_len) == PACKET_RCVD)\n>                 return 0;\n>\n>         icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);\n> +\n>  drop:\n>         kfree_skb(skb);\n>         return 0;\n> diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c\n> index c82d41e..e52396d 100644\n> --- a/net/ipv6/ip6_gre.c\n> +++ b/net/ipv6/ip6_gre.c\n> @@ -476,6 +476,13 @@ static int gre_rcv(struct sk_buff *skb)\n>         if (hdr_len < 0)\n>                 goto drop;\n>\n> +#if IS_ENABLED(CONFIG_MPLS)\n> +       if (unlikely(tpi.proto == htons(ETH_P_MPLS_UC))) {\n> +               if (mpls_gre_rcv(skb, hdr_len))\n> +                       goto drop;\n> +               return 0;\n> +       }\n> +#endif\n>         if (iptunnel_pull_header(skb, hdr_len, tpi.proto, false))\n>                 goto drop;\n>\n> diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c\n> index 36ea2ad..060ed07 100644\n> --- a/net/mpls/af_mpls.c\n> +++ b/net/mpls/af_mpls.c\n> @@ -16,6 +16,7 @@\n>  #include <net/arp.h>\n>  #include <net/ip_fib.h>\n>  #include <net/netevent.h>\n> +#include <net/ip_tunnels.h>\n>  #include <net/netns/generic.h>\n>  #if IS_ENABLED(CONFIG_IPV6)\n>  #include <net/ipv6.h>\n> @@ -39,6 +40,40 @@ static int one = 1;\n>  static int label_limit = (1 << 20) - 1;\n>  static int ttl_max = 255;\n>\n> +size_t ipgre_mpls_encap_hlen(struct ip_tunnel_encap *e)\n> +{\n> +       return sizeof(struct mpls_shim_hdr);\n> +}\n> +\n> +int ipgre_mpls_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,\n> +                           u8 *protocol, struct flowi4 *fl4)\n> +{\n> +       return 0;\n> +}\n\n\nany reason you are supporting only rx ?\n\n\n> +\n> +static const struct ip_tunnel_encap_ops mpls_iptun_ops = {\n> +       .encap_hlen = ipgre_mpls_encap_hlen,\n> +       .build_header = ipgre_mpls_build_header,\n> +};\n> +\n> +int ipgre_tunnel_encap_add_mpls_ops(void)\n> +{\n> +       int ret;\n> +\n> +       ret = ip_tunnel_encap_add_ops(&mpls_iptun_ops, TUNNEL_ENCAP_MPLS);\n> +       if (ret < 0) {\n> +               pr_err(\"can't add mplsgre ops\\n\");\n> +               return ret;\n> +       }\n> +\n> +       return 0;\n> +}\n> +\n> +static void ipgre_tunnel_encap_del_mpls_ops(void)\n> +{\n> +       ip_tunnel_encap_del_ops(&mpls_iptun_ops, TUNNEL_ENCAP_MPLS);\n> +}\n> +\n>  static void rtmsg_lfib(int event, u32 label, struct mpls_route *rt,\n>                        struct nlmsghdr *nlh, struct net *net, u32 portid,\n>                        unsigned int nlm_flags);\n> @@ -2486,6 +2521,7 @@ static int __init mpls_init(void)\n>                       0);\n>         rtnl_register(PF_MPLS, RTM_GETNETCONF, mpls_netconf_get_devconf,\n>                       mpls_netconf_dump_devconf, 0);\n> +       ipgre_tunnel_encap_add_mpls_ops();\n>         err = 0;\n>  out:\n>         return err;\n> @@ -2503,6 +2539,7 @@ static void __exit mpls_exit(void)\n>         dev_remove_pack(&mpls_packet_type);\n>         unregister_netdevice_notifier(&mpls_dev_notifier);\n>         unregister_pernet_subsys(&mpls_net_ops);\n> +       ipgre_tunnel_encap_del_mpls_ops();\n>  }\n>  module_exit(mpls_exit);\n>\n> --\n> 2.1.4\n>","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=cumulusnetworks.com\n\theader.i=@cumulusnetworks.com header.b=\"W9NFTk12\"; \n\tdkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyrzS2Yb8z9t30\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 22 Sep 2017 08:35:32 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751859AbdIUWfa (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 21 Sep 2017 18:35:30 -0400","from mail-vk0-f49.google.com ([209.85.213.49]:45022 \"EHLO\n\tmail-vk0-f49.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751728AbdIUWf3 (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 21 Sep 2017 18:35:29 -0400","by mail-vk0-f49.google.com with SMTP id d12so539846vkf.1\n\tfor <netdev@vger.kernel.org>; Thu, 21 Sep 2017 15:35:28 -0700 (PDT)","by 10.176.73.112 with HTTP; Thu, 21 Sep 2017 15:35:27 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=cumulusnetworks.com; s=google;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=zyO+Nzb9pPDWyzM5wyOJe7ibWXJ67h9aAKSXR6qyDHk=;\n\tb=W9NFTk12xkRHIvyZPXGEcvCihOfcc/VCO4dl/gbL7h6PxkaAJlwFIrKlwyHPvUvY01\n\tprpsZTgHRGvn/EdKd2GbJJnH/ejsl+8Ql/4gElEhlYkMSEN0LwfHoWlAmj3DvrCh88t1\n\tzAehF1Qv9a8KuWDojWBILxpDueIk5T3wsfFqA=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=zyO+Nzb9pPDWyzM5wyOJe7ibWXJ67h9aAKSXR6qyDHk=;\n\tb=WXCyO/CmKhcut6DumpjGgueTF7ge2vlJJlGRYA5d6A698Mh1IDIMfRvwdZ6MZKnPhc\n\tCacVse48a3wFH4QcyFElJqkr4qrLXb+IlakRLQQf+wKwpSVce8nKl7UdvUERoiJO//6r\n\tPdu4My4eHvw1SJYGGSv5aPMl5uhI79EjEiZHFPhSfVlCYlNKk70VGuqjH9UCfUiklDfs\n\tA9Z8QRxFa0PZzlOc4FF0xXx+aScnBzRbtcmSa+Cv2lC86wiltTVukrchJFzIx2r0v82v\n\tafPRwNx6pPRV+j+LGi7lwyY2nM829TY/tDnz28nhck53tKDkDAAiTqGLtjxHDuigkCKl\n\txg+Q==","X-Gm-Message-State":"AHPjjUjHAc5flO0xxASQKhV6mIhJKi9+jbMzDi9ekZUGpTZlulQiqHCZ\n\tFXHMjmyX3JV8wxQbCyXLIYxGyUnGrVfzc6voaHT2yA==","X-Google-Smtp-Source":"AOwi7QAKlHFE9L+XKYBihugbQDws3FNWS3faG0GXb8liySyhRgxZUCCti8gx3aG3nODYwESjwvIq3H23J+6NygYGnFU=","X-Received":"by 10.31.60.203 with SMTP id j194mr3025161vka.134.1506033328168; \n\tThu, 21 Sep 2017 15:35:28 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<1505985924-12479-3-git-send-email-amine.kherbouche@6wind.com>","References":"<1505985924-12479-1-git-send-email-amine.kherbouche@6wind.com>\n\t<1505985924-12479-3-git-send-email-amine.kherbouche@6wind.com>","From":"Roopa Prabhu <roopa@cumulusnetworks.com>","Date":"Thu, 21 Sep 2017 15:35:27 -0700","Message-ID":"<CAJieiUicOTaxeT4t-y6QzoPibi1i7WJ31X978OP6sqjMjVuVNw@mail.gmail.com>","Subject":"Re: [PATCH 2/2] ip_tunnel: add mpls over gre encapsulation","To":"Amine Kherbouche <amine.kherbouche@6wind.com>","Cc":"\"netdev@vger.kernel.org\" <netdev@vger.kernel.org>, xeb@mail.ru,\n\tDavid Lamparter <equinox@diac24.net>","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1773365,"web_url":"http://patchwork.ozlabs.org/comment/1773365/","msgid":"<30bfaab5-d4ba-e9bf-a4e4-f3058c71f517@6wind.com>","list_archive_url":null,"date":"2017-09-22T08:39:31","subject":"Re: [PATCH 2/2] ip_tunnel: add mpls over gre encapsulation","submitter":{"id":72147,"url":"http://patchwork.ozlabs.org/api/people/72147/","name":"Amine Kherbouche","email":"amine.kherbouche@6wind.com"},"content":"On 09/22/2017 12:35 AM, Roopa Prabhu wrote:\n>> > diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c\n>> > index 36ea2ad..060ed07 100644\n>> > --- a/net/mpls/af_mpls.c\n>> > +++ b/net/mpls/af_mpls.c\n>> > @@ -16,6 +16,7 @@\n>> >  #include <net/arp.h>\n>> >  #include <net/ip_fib.h>\n>> >  #include <net/netevent.h>\n>> > +#include <net/ip_tunnels.h>\n>> >  #include <net/netns/generic.h>\n>> >  #if IS_ENABLED(CONFIG_IPV6)\n>> >  #include <net/ipv6.h>\n>> > @@ -39,6 +40,40 @@ static int one = 1;\n>> >  static int label_limit = (1 << 20) - 1;\n>> >  static int ttl_max = 255;\n>> >\n>> > +size_t ipgre_mpls_encap_hlen(struct ip_tunnel_encap *e)\n>> > +{\n>> > +       return sizeof(struct mpls_shim_hdr);\n>> > +}\n>> > +\n>> > +int ipgre_mpls_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,\n>> > +                           u8 *protocol, struct flowi4 *fl4)\n>> > +{\n>> > +       return 0;\n>> > +}\n>\n> any reason you are supporting only rx ?\n\nTx path doesn't need changes, all gre hdr fields remain the same except \nfor the protocol type which is loaded from skb->protocol this last is \nset by the mpls stack before entering gre device.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=6wind-com.20150623.gappssmtp.com\n\theader.i=@6wind-com.20150623.gappssmtp.com\n\theader.b=\"LhHamrD9\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xz6Nf03p1z9sBd\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 22 Sep 2017 18:39:46 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751876AbdIVIjn (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 22 Sep 2017 04:39:43 -0400","from mail-wm0-f45.google.com ([74.125.82.45]:50655 \"EHLO\n\tmail-wm0-f45.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751792AbdIVIjm (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 22 Sep 2017 04:39:42 -0400","by mail-wm0-f45.google.com with SMTP id b195so1758385wmb.5\n\tfor <netdev@vger.kernel.org>; Fri, 22 Sep 2017 01:39:42 -0700 (PDT)","from [10.16.0.135] (host.78.145.23.62.rev.coltfrance.com.\n\t[62.23.145.78]) by smtp.gmail.com with ESMTPSA id\n\t4sm3672021wmg.20.2017.09.22.01.39.40\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 22 Sep 2017 01:39:40 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=subject:to:references:cc:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-transfer-encoding;\n\tbh=B2Q4OuE2IRKM/zL2wJO6upfabANifVxW5ELy0aBg53E=;\n\tb=LhHamrD9uhHLM941umMSSEGFFed7tOYTiOquVXOftsj9hXjD9s8xgnwbpyPsSehYTu\n\thIKRRbWnbKwe4bg4GpvReWp8zRMgeWWuwRp08MC78YYzM4tWavEyIIC4g2tqqf4m22m0\n\tFvtkHpwpPPNEdpZEP8bUu8lf9xewSQ1CuPBDHm49SLZiJ9NZKAqs43/Dn5SfVcP2r3Qh\n\tnccREBH0kaN/PObYmrLlnPiWTen2qhlLeRlZCjO3ApdjySrdPx2KKzuf1FXAVPppbpv3\n\ta2h12QWi76aMbzJS2r4eU28LifxnTfcl0QTpn+0sza8LE4RzsaPOqI3AnN3XyOLSBn63\n\tfAWQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:references:cc:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-transfer-encoding;\n\tbh=B2Q4OuE2IRKM/zL2wJO6upfabANifVxW5ELy0aBg53E=;\n\tb=WQZnWZP7bGPmN+JGs2mDvinBYH074ShHinoIEmdscmop+2XgWJR6hwetVBsX+MFT3s\n\t4XNAPzhDRGlBCQfZEvRQ/3WuDNyw8UTcsi5G2Z49GxslW2oNZZBTgpsVw5+uKHkdtBzd\n\tFxuZEO6wY+Sj/fmW6whc9FQYITGzfN0OmFy/fW1EXM7p9CDCb24cupYVoLpVNU/0xyt+\n\thFEfirDn15PMEI3jbGS7k+5E9ZptkfMJqtmTqt09ALioGkwU4hiP8D6fqSHCaNjCiXoJ\n\tzOR4DeBbrJyqZ74jSNeR0lM4Qabqc1MTZBRuJKqYJsHQO/+F9Pcys64oNBubpgAvFCmB\n\tCBpQ==","X-Gm-Message-State":"AHPjjUgxfDEBjkjwODuovWuSMxz5tiAHZMnmSPL89/P0Rwq0muKkooyn\n\tnNTf/ZGM3QLzY1BmjVSG20lD7A==","X-Google-Smtp-Source":"AOwi7QDxPXnKZgWEC/h8N6Vr5zcWtaljSr+t83zK/don3HdEMjX2/1avUjGUBMrQPd0JUqTATUHq8g==","X-Received":"by 10.28.12.134 with SMTP id 128mr3347210wmm.147.1506069581514; \n\tFri, 22 Sep 2017 01:39:41 -0700 (PDT)","Subject":"Re: [PATCH 2/2] ip_tunnel: add mpls over gre encapsulation","To":"Roopa Prabhu <roopa@cumulusnetworks.com>","References":"<1505985924-12479-1-git-send-email-amine.kherbouche@6wind.com>\n\t<1505985924-12479-3-git-send-email-amine.kherbouche@6wind.com>\n\t<CAJieiUicOTaxeT4t-y6QzoPibi1i7WJ31X978OP6sqjMjVuVNw@mail.gmail.com>","Cc":"\"netdev@vger.kernel.org\" <netdev@vger.kernel.org>, xeb@mail.ru,\n\tDavid Lamparter <equinox@diac24.net>","From":"Amine Kherbouche <amine.kherbouche@6wind.com>","Message-ID":"<30bfaab5-d4ba-e9bf-a4e4-f3058c71f517@6wind.com>","Date":"Fri, 22 Sep 2017 10:39:31 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101\n\tThunderbird/45.1.1","MIME-Version":"1.0","In-Reply-To":"<CAJieiUicOTaxeT4t-y6QzoPibi1i7WJ31X978OP6sqjMjVuVNw@mail.gmail.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}}]