get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 28343,
    "url": "https://patches.dpdk.org/api/patches/28343/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1504598270-60080-5-git-send-email-jiayu.hu@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1504598270-60080-5-git-send-email-jiayu.hu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1504598270-60080-5-git-send-email-jiayu.hu@intel.com",
    "date": "2017-09-05T07:57:49",
    "name": "[dpdk-dev,v2,4/5] gso: add GRE GSO support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d4133d26c7a4317356479f02546e99d03317d576",
    "submitter": {
        "id": 539,
        "url": "https://patches.dpdk.org/api/people/539/?format=api",
        "name": "Hu, Jiayu",
        "email": "jiayu.hu@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1504598270-60080-5-git-send-email-jiayu.hu@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/28343/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/28343/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 15AC46841;\n\tTue,  5 Sep 2017 09:55:43 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id EFB757CC0\n\tfor <dev@dpdk.org>; Tue,  5 Sep 2017 09:55:40 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t05 Sep 2017 00:55:40 -0700",
            "from dpdk15.sh.intel.com ([10.67.111.77])\n\tby orsmga001.jf.intel.com with ESMTP; 05 Sep 2017 00:55:32 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.41,479,1498546800\"; d=\"scan'208\";\n\ta=\"1169183483\"",
        "From": "Jiayu Hu <jiayu.hu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "konstantin.ananyev@intel.com, mark.b.kavanagh@intel.com,\n\tjianfeng.tan@intel.com, Jiayu Hu <jiayu.hu@intel.com>",
        "Date": "Tue,  5 Sep 2017 15:57:49 +0800",
        "Message-Id": "<1504598270-60080-5-git-send-email-jiayu.hu@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1504598270-60080-1-git-send-email-jiayu.hu@intel.com>",
        "References": "<1503584144-63181-1-git-send-email-jiayu.hu@intel.com>\n\t<1504598270-60080-1-git-send-email-jiayu.hu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 4/5] gso: add GRE GSO support",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Mark Kavanagh <mark.b.kavanagh@intel.com>\n\nThis patch adds GSO support for GRE-tunneled packets. Supported GRE\npackets must contain an outer IPv4 header, and inner TCP/IPv4 headers.\nThey may also contain a single VLAN tag. GRE GSO assumes that all input\npackets have correct checksums and doesn't update checksums for output\npackets. Additionally, it doesn't process IP fragmented packets.\n\nAs with VxLAN GSO, GRE GSO uses a two-segment MBUF to organize each\noutput packet, which requires multi-segment mbuf support in the TX\nfunctions of the NIC driver. Also, if a packet is GSOed, GRE GSO reduces\nits MBUF refcnt by 1. As a result, when all of its GSOed segments are\nfreed, the packet is freed automatically.\n\nSigned-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>\nSigned-off-by: Jiayu Hu <jiayu.hu@intel.com>\n---\n lib/librte_gso/gso_common.c | 24 ++++++++++++++++++++++++\n lib/librte_gso/gso_common.h | 15 +++++++++++++++\n lib/librte_gso/rte_gso.c    |  2 ++\n 3 files changed, 41 insertions(+)",
    "diff": "diff --git a/lib/librte_gso/gso_common.c b/lib/librte_gso/gso_common.c\nindex 1e16c9c..668d2d0 100644\n--- a/lib/librte_gso/gso_common.c\n+++ b/lib/librte_gso/gso_common.c\n@@ -37,6 +37,7 @@\n #include <rte_malloc.h>\n \n #include <rte_ether.h>\n+#include <rte_gre.h>\n #include <rte_ip.h>\n #include <rte_tcp.h>\n #include <rte_udp.h>\n@@ -238,6 +239,25 @@ update_ipv4_vxlan_tcp4_header(struct rte_mbuf *pkt, uint8_t ipid_delta,\n \tupdate_inner_tcp4_header(pkt, ipid_delta, segs, nb_segs);\n }\n \n+static inline void\n+update_ipv4_gre_tcp4_header(struct rte_mbuf *pkt, uint8_t ipid_delta,\n+\t\tstruct rte_mbuf **segs, uint16_t nb_segs)\n+{\n+\tstruct ipv4_hdr *ipv4_hdr;\n+\tuint16_t i, id;\n+\n+\tipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +\n+\t\t\tpkt->outer_l2_len);\n+\tid = rte_be_to_cpu_16(ipv4_hdr->packet_id);\n+\tfor (i = 0; i < nb_segs; i++) {\n+\t\tupdate_outer_ipv4_header(segs[i], id);\n+\t\tid += ipid_delta;\n+\t}\n+\n+\t/* update inner TCP/IPv4 headers */\n+\tupdate_inner_tcp4_header(pkt, ipid_delta, segs, nb_segs);\n+}\n+\n void\n gso_update_pkt_headers(struct rte_mbuf *pkt, uint8_t ipid_delta,\n \t\tstruct rte_mbuf **segs, uint16_t nb_segs)\n@@ -249,6 +269,10 @@ gso_update_pkt_headers(struct rte_mbuf *pkt, uint8_t ipid_delta,\n \tcase ETHER_IPv4_UDP_VXLAN_IPv4_TCP_PKT:\n \t\tupdate_ipv4_vxlan_tcp4_header(pkt, ipid_delta, segs, nb_segs);\n \t\tbreak;\n+\tcase ETHER_VLAN_IPv4_GRE_IPv4_TCP_PKT:\n+\tcase ETHER_IPv4_GRE_IPv4_TCP_PKT:\n+\t\tupdate_ipv4_gre_tcp4_header(pkt, ipid_delta, segs, nb_segs);\n+\t\tbreak;\n \tcase ETHER_VLAN_IPv4_TCP_PKT:\n \tcase ETHER_IPv4_TCP_PKT:\n \t\tupdate_inner_tcp4_header(pkt, ipid_delta, segs, nb_segs);\ndiff --git a/lib/librte_gso/gso_common.h b/lib/librte_gso/gso_common.h\nindex 3f76fd1..bd53bde 100644\n--- a/lib/librte_gso/gso_common.h\n+++ b/lib/librte_gso/gso_common.h\n@@ -85,6 +85,21 @@\n \t\tRTE_PTYPE_TUNNEL_VXLAN | \\\n \t\tINNER_ETHER_VLAN_IPv4_TCP_PKT)\n \n+/* GRE packet. */\n+#define ETHER_IPv4_GRE_IPv4_TCP_PKT (\\\n+\t\tETHER_IPv4_PKT          | \\\n+\t\tRTE_PTYPE_TUNNEL_GRE    | \\\n+\t\tRTE_PTYPE_INNER_L3_IPV4 | \\\n+\t\tRTE_PTYPE_INNER_L4_TCP)\n+\n+/* GRE packet with VLAN tag. */\n+#define ETHER_VLAN_IPv4_GRE_IPv4_TCP_PKT (\\\n+\t\tRTE_PTYPE_L2_ETHER_VLAN | \\\n+\t\tRTE_PTYPE_L3_IPV4       | \\\n+\t\tRTE_PTYPE_TUNNEL_GRE    | \\\n+\t\tRTE_PTYPE_INNER_L3_IPV4 | \\\n+\t\tRTE_PTYPE_INNER_L4_TCP)\n+\n /**\n  * Internal function which updates relevant packet headers, following\n  * segmentation. This is required to update, for example, the IPv4\ndiff --git a/lib/librte_gso/rte_gso.c b/lib/librte_gso/rte_gso.c\nindex 0170abc..d40fda9 100644\n--- a/lib/librte_gso/rte_gso.c\n+++ b/lib/librte_gso/rte_gso.c\n@@ -76,6 +76,8 @@ rte_gso_segment(struct rte_mbuf *pkt,\n \tcase ETHER_VLAN_IPv4_UDP_VXLAN_IPv4_TCP_PKT:\n \tcase ETHER_IPv4_UDP_VXLAN_VLAN_IPv4_TCP_PKT:\n \tcase ETHER_IPv4_UDP_VXLAN_IPv4_TCP_PKT:\n+\tcase ETHER_VLAN_IPv4_GRE_IPv4_TCP_PKT:\n+\tcase ETHER_IPv4_GRE_IPv4_TCP_PKT:\n \t\tret = gso_tunnel_segment(pkt, gso_size, ipid_delta,\n \t\t\t\tdirect_pool, indirect_pool,\n \t\t\t\tpkts_out, nb_pkts_out);\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "4/5"
    ]
}