get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/819464/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 819464,
    "url": "http://patchwork.ozlabs.org/api/patches/819464/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/2e611d0f6e0c39ff54bfe464cdf9cf6eeb7843e1.1506590878.git.amine.kherbouche@6wind.com/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<2e611d0f6e0c39ff54bfe464cdf9cf6eeb7843e1.1506590878.git.amine.kherbouche@6wind.com>",
    "list_archive_url": null,
    "date": "2017-09-28T09:34:20",
    "name": "[v4,2/2] ip_tunnel: add mpls over gre encapsulation",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "324ba834be53b9420aedb44a4baac0abce2ff428",
    "submitter": {
        "id": 72147,
        "url": "http://patchwork.ozlabs.org/api/people/72147/?format=api",
        "name": "Amine Kherbouche",
        "email": "amine.kherbouche@6wind.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/2e611d0f6e0c39ff54bfe464cdf9cf6eeb7843e1.1506590878.git.amine.kherbouche@6wind.com/mbox/",
    "series": [
        {
            "id": 5523,
            "url": "http://patchwork.ozlabs.org/api/series/5523/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=5523",
            "date": "2017-09-28T09:34:20",
            "name": "Introduce MPLS over GRE",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/5523/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/819464/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/819464/checks/",
    "tags": {},
    "related": [],
    "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=\"iB/qvOhJ\"; dkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y2qKK1SMQz9t3C\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 28 Sep 2017 19:34:45 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752552AbdI1Jen (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 28 Sep 2017 05:34:43 -0400",
            "from mail-wm0-f49.google.com ([74.125.82.49]:51583 \"EHLO\n\tmail-wm0-f49.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752432AbdI1Jel (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 28 Sep 2017 05:34:41 -0400",
            "by mail-wm0-f49.google.com with SMTP id i131so982694wma.0\n\tfor <netdev@vger.kernel.org>; Thu, 28 Sep 2017 02:34:41 -0700 (PDT)",
            "from griffon.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com.\n\t[62.23.145.78]) by smtp.gmail.com with ESMTPSA id\n\th56sm1453908ede.15.2017.09.28.02.34.39\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 28 Sep 2017 02:34:39 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=MMjpiUKasFT5R+LmSsV8Y/4dolM4+yn6J64obJjHgus=;\n\tb=iB/qvOhJ51qawTYFWAOpVc1tol61LxoyTLy+Lc+kehpc/FLF2dzzSKbW7grYYOFEFn\n\tRO7YXMq6A/7Lnj6ggW+tRcWQQY7PU1rdv39RysnBgFr/MUV7rY0A5EJm7Z+xYIKhVNl8\n\tqI96e8X1y4jnrrNHhtKN+z5lvpXxXyGC0+4VJEAzIYAwRMDd9ChUmJQVVRBGUw/de2K5\n\tSjtI+MkKIAVeFsBGrFGD7GNkO+XIsZu9ctij6HIXON//D0Zm1kF+BdcmmjZ19NAxunMg\n\tBER9dKzuHT/LFVJd+fKSf44EVJUpMt7ZQqOzA4+9qndWj8wgBZqWxZKbP8Jysoe6Uq0u\n\tEsBw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=MMjpiUKasFT5R+LmSsV8Y/4dolM4+yn6J64obJjHgus=;\n\tb=PNyzCpprDqAqB7lijcN9V7hFwATwEtoiCMxRFxlPISr6nfTiAVgRfa92ardfIATdr7\n\t828FGGsi/33bYqF+QihDR3qkO7F7EJoae1VOnAomor5mkyPs8lm56kpcoMUURUS/o4hG\n\tVkBOLPOfKb8VWILUBJvrqH04MYIaQxr3AwErImvX8nz1O+a6nNUEX4G3+EBrIgGXI3M8\n\tVPI6M86njuuQ0TNVV/lOzI8nqt9X0I+IOmQi0SLbGO8m03T/ehbm8HIgYYdtqV8rsa87\n\trAwgRe14D5AsGfTLp8cr73ksSOVLazO3CrzkzRDKgauqhZXBYya7j1dSMeHsO2b6hdIm\n\tUbsw==",
        "X-Gm-Message-State": "AHPjjUguf7S2XnZTqDmWzd6e5j4ViaIkAX3Ut/t34rNSFcyXZ0Kvom1s\n\tw8Pu59LeU5WBNp+DC077XLBffHRu",
        "X-Google-Smtp-Source": "AOwi7QCz1IMnZb6PxWMtyzTHICcHTJvc/kIdBCa605VZPfDwgq1NU/lrziAyDXEPuIDt1qEqABoFZw==",
        "X-Received": "by 10.80.244.11 with SMTP id r11mr5150776edm.26.1506591280124;\n\tThu, 28 Sep 2017 02:34:40 -0700 (PDT)",
        "From": "Amine Kherbouche <amine.kherbouche@6wind.com>",
        "To": "netdev@vger.kernel.org, xeb@mail.ru, roopa@cumulusnetworks.com",
        "Cc": "amine.kherbouche@6wind.com, equinox@diac24.net",
        "Subject": "[PATCH v4 2/2] ip_tunnel: add mpls over gre encapsulation",
        "Date": "Thu, 28 Sep 2017 11:34:20 +0200",
        "Message-Id": "<2e611d0f6e0c39ff54bfe464cdf9cf6eeb7843e1.1506590878.git.amine.kherbouche@6wind.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<cover.1506590878.git.amine.kherbouche@6wind.com>",
        "References": "<cover.1506590878.git.amine.kherbouche@6wind.com>",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "This commit introduces the MPLSoGRE support (RFC 4023), using ip tunnel\nAPI.\n\nEncap:\n  - Add a new iptunnel type mpls.\n  - Share tx path: gre type mpls loaded from skb->protocol.\n\nDecap:\n  - pull gre hdr and call mpls_forward().\n\nSigned-off-by: Amine Kherbouche <amine.kherbouche@6wind.com>\nAcked-by: Roopa Prabhu <roopa@cumulusnetworks.com>\n---\n include/net/gre.h              |  1 +\n include/uapi/linux/if_tunnel.h |  1 +\n net/ipv4/gre_demux.c           | 27 +++++++++++++++++++++++++++\n net/ipv4/ip_gre.c              |  3 +++\n net/ipv6/ip6_gre.c             |  3 +++\n net/mpls/af_mpls.c             | 36 ++++++++++++++++++++++++++++++++++++\n 6 files changed, 71 insertions(+)",
    "diff": "diff --git a/include/net/gre.h b/include/net/gre.h\nindex d25d836..aa3c4d3 100644\n--- a/include/net/gre.h\n+++ b/include/net/gre.h\n@@ -35,6 +35,7 @@ struct net_device *gretap_fb_dev_create(struct net *net, const char *name,\n \t\t\t\t       u8 name_assign_type);\n int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi,\n \t\t     bool *csum_err, __be16 proto, int nhs);\n+int mpls_gre_rcv(struct sk_buff *skb, int gre_hdr_len);\n \n static inline int gre_calc_hlen(__be16 o_flags)\n {\ndiff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h\nindex 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 \tTUNNEL_ENCAP_NONE,\n \tTUNNEL_ENCAP_FOU,\n \tTUNNEL_ENCAP_GUE,\n+\tTUNNEL_ENCAP_MPLS,\n };\n \n #define TUNNEL_ENCAP_FLAG_CSUM\t\t(1<<0)\ndiff --git a/net/ipv4/gre_demux.c b/net/ipv4/gre_demux.c\nindex b798862..40484a3 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,30 @@ 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+\tif (unlikely(!pskb_may_pull(skb, gre_hdr_len)))\n+\t\tgoto drop;\n+\n+\t/* Pop GRE hdr and reset the skb */\n+\tskb_pull(skb, gre_hdr_len);\n+\tskb_reset_network_header(skb);\n+\n+\treturn mpls_forward(skb, skb->dev, NULL, NULL);\n+drop:\n+\tkfree_skb(skb);\n+\treturn NET_RX_DROP;\n+}\n+#else\n+int mpls_gre_rcv(struct sk_buff *skb, int gre_hdr_len)\n+{\n+\tkfree_skb(skb);\n+\treturn NET_RX_DROP;\n+}\n+#endif\n+EXPORT_SYMBOL(mpls_gre_rcv);\n+\n static int gre_rcv(struct sk_buff *skb)\n {\n \tconst struct gre_protocol *proto;\ndiff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c\nindex 9cee986..7a50e4f 100644\n--- a/net/ipv4/ip_gre.c\n+++ b/net/ipv4/ip_gre.c\n@@ -412,6 +412,9 @@ static int gre_rcv(struct sk_buff *skb)\n \t\t\treturn 0;\n \t}\n \n+\tif (unlikely(tpi.proto == htons(ETH_P_MPLS_UC)))\n+\t\treturn mpls_gre_rcv(skb, hdr_len);\n+\n \tif (ipgre_rcv(skb, &tpi, hdr_len) == PACKET_RCVD)\n \t\treturn 0;\n \ndiff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c\nindex c82d41e..440efb1 100644\n--- a/net/ipv6/ip6_gre.c\n+++ b/net/ipv6/ip6_gre.c\n@@ -476,6 +476,9 @@ static int gre_rcv(struct sk_buff *skb)\n \tif (hdr_len < 0)\n \t\tgoto drop;\n \n+\tif (unlikely(tpi.proto == htons(ETH_P_MPLS_UC)))\n+\t\treturn mpls_gre_rcv(skb, hdr_len);\n+\n \tif (iptunnel_pull_header(skb, hdr_len, tpi.proto, false))\n \t\tgoto drop;\n \ndiff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c\nindex 36ea2ad..4274243 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,36 @@ static int one = 1;\n static int label_limit = (1 << 20) - 1;\n static int ttl_max = 255;\n \n+#if IS_ENABLED(CONFIG_NET_IP_TUNNEL)\n+size_t ipgre_mpls_encap_hlen(struct ip_tunnel_encap *e)\n+{\n+\treturn sizeof(struct mpls_shim_hdr);\n+}\n+\n+static const struct ip_tunnel_encap_ops mpls_iptun_ops = {\n+\t.encap_hlen\t= ipgre_mpls_encap_hlen,\n+};\n+\n+static int ipgre_tunnel_encap_add_mpls_ops(void)\n+{\n+\treturn ip_tunnel_encap_add_ops(&mpls_iptun_ops, TUNNEL_ENCAP_MPLS);\n+}\n+\n+static void ipgre_tunnel_encap_del_mpls_ops(void)\n+{\n+\tip_tunnel_encap_del_ops(&mpls_iptun_ops, TUNNEL_ENCAP_MPLS);\n+}\n+#else\n+static int ipgre_tunnel_encap_add_mpls_ops(void)\n+{\n+\treturn 0;\n+}\n+\n+static void ipgre_tunnel_encap_del_mpls_ops(void)\n+{\n+}\n+#endif\n+\n static void rtmsg_lfib(int event, u32 label, struct mpls_route *rt,\n \t\t       struct nlmsghdr *nlh, struct net *net, u32 portid,\n \t\t       unsigned int nlm_flags);\n@@ -2486,6 +2517,10 @@ 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+\terr = ipgre_tunnel_encap_add_mpls_ops();\n+\tif (err)\n+\t\tpr_err(\"Can't add mpls over gre tunnel ops\\n\");\n+\n \terr = 0;\n out:\n \treturn err;\n@@ -2503,6 +2538,7 @@ static void __exit mpls_exit(void)\n \tdev_remove_pack(&mpls_packet_type);\n \tunregister_netdevice_notifier(&mpls_dev_notifier);\n \tunregister_pernet_subsys(&mpls_net_ops);\n+\tipgre_tunnel_encap_del_mpls_ops();\n }\n module_exit(mpls_exit);\n \n",
    "prefixes": [
        "v4",
        "2/2"
    ]
}