get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 29496,
    "url": "https://patches.dpdk.org/api/patches/29496/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1506962749-106779-5-git-send-email-mark.b.kavanagh@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": "<1506962749-106779-5-git-send-email-mark.b.kavanagh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1506962749-106779-5-git-send-email-mark.b.kavanagh@intel.com",
    "date": "2017-10-02T16:45:47",
    "name": "[dpdk-dev,v6,4/6] gso: add GRE GSO support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4af818ff405ddd664335475d3637609c315fc76d",
    "submitter": {
        "id": 133,
        "url": "https://patches.dpdk.org/api/people/133/?format=api",
        "name": "Mark Kavanagh",
        "email": "mark.b.kavanagh@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1506962749-106779-5-git-send-email-mark.b.kavanagh@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/29496/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/29496/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7E14D1B292;\n\tMon,  2 Oct 2017 18:46:10 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id DE4A01B297\n\tfor <dev@dpdk.org>; Mon,  2 Oct 2017 18:46:08 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Oct 2017 09:46:08 -0700",
            "from silpixa00380299.ir.intel.com ([10.237.222.17])\n\tby orsmga001.jf.intel.com with ESMTP; 02 Oct 2017 09:46:06 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.42,470,1500966000\"; d=\"scan'208\";\n\ta=\"1177834615\"",
        "From": "Mark Kavanagh <mark.b.kavanagh@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "jiayu.hu@intel.com, jianfeng.tan@intel.com, konstantin.ananyev@intel.com,\n\tferruh.yigit@intel.com, thomas@monjalon.net,\n\tMark Kavanagh <mark.b.kavanagh@intel.com>",
        "Date": "Mon,  2 Oct 2017 17:45:47 +0100",
        "Message-Id": "<1506962749-106779-5-git-send-email-mark.b.kavanagh@intel.com>",
        "X-Mailer": "git-send-email 1.9.3",
        "In-Reply-To": "<1506962749-106779-1-git-send-email-mark.b.kavanagh@intel.com>",
        "References": "<1506636833-25851-1-git-send-email-mark.b.kavanagh@intel.com>\n\t<1506962749-106779-1-git-send-email-mark.b.kavanagh@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v6 4/6] 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": "This 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 doesn't check if all\ninput packets have correct checksums and doesn't update checksums for\noutput packets. 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 doc/guides/rel_notes/release_17_11.rst |  3 +++\n lib/librte_gso/gso_common.h            |  5 +++++\n lib/librte_gso/gso_tunnel_tcp4.c       | 14 ++++++++++----\n lib/librte_gso/rte_gso.c               |  8 +++++---\n 4 files changed, 23 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst\nindex 25b8a78..808f537 100644\n--- a/doc/guides/rel_notes/release_17_11.rst\n+++ b/doc/guides/rel_notes/release_17_11.rst\n@@ -51,6 +51,9 @@ New Features\n   * VxLAN packets, which must have an outer IPv4 header (prepended by\n     an optional VLAN tag), and contain an inner TCP/IPv4 packet (with\n     an optional VLAN tag).\n+  * GRE packets, which must contain an outer IPv4 header (prepended by\n+    an optional VLAN tag), and inner TCP/IPv4 headers (with an optional\n+    VLAN tag).\n \n   The GSO library doesn't check if the input packets have correct\n   checksums, and doesn't update checksums for output packets.\ndiff --git a/lib/librte_gso/gso_common.h b/lib/librte_gso/gso_common.h\nindex c051295..1e99cc0 100644\n--- a/lib/librte_gso/gso_common.h\n+++ b/lib/librte_gso/gso_common.h\n@@ -55,6 +55,11 @@\n \t\t(PKT_TX_TCP_SEG | PKT_TX_IPV4 | PKT_TX_OUTER_IPV4 | \\\n \t\t PKT_TX_TUNNEL_VXLAN))\n \n+#define IS_IPV4_GRE_TCP4(flag) (((flag) & (PKT_TX_TCP_SEG | PKT_TX_IPV4 | \\\n+\t\t\t\tPKT_TX_OUTER_IPV4 | PKT_TX_TUNNEL_GRE)) == \\\n+\t\t(PKT_TX_TCP_SEG | PKT_TX_IPV4 | PKT_TX_OUTER_IPV4 | \\\n+\t\t PKT_TX_TUNNEL_GRE))\n+\n /**\n  * Internal function which updates the UDP header of a packet, following\n  * segmentation. This is required to update the header's datagram length field.\ndiff --git a/lib/librte_gso/gso_tunnel_tcp4.c b/lib/librte_gso/gso_tunnel_tcp4.c\nindex 34bbbd7..d79fc6b 100644\n--- a/lib/librte_gso/gso_tunnel_tcp4.c\n+++ b/lib/librte_gso/gso_tunnel_tcp4.c\n@@ -42,11 +42,13 @@\n \tstruct tcp_hdr *tcp_hdr;\n \tuint32_t sent_seq;\n \tuint16_t outer_id, inner_id, tail_idx, i;\n-\tuint16_t outer_ipv4_offset, inner_ipv4_offset, udp_offset, tcp_offset;\n+\tuint16_t outer_ipv4_offset, inner_ipv4_offset;\n+\tuint16_t udp_gre_offset, tcp_offset;\n+\tuint8_t update_udp_hdr;\n \n \touter_ipv4_offset = pkt->outer_l2_len;\n-\tudp_offset = outer_ipv4_offset + pkt->outer_l3_len;\n-\tinner_ipv4_offset = udp_offset + pkt->l2_len;\n+\tudp_gre_offset = outer_ipv4_offset + pkt->outer_l3_len;\n+\tinner_ipv4_offset = udp_gre_offset + pkt->l2_len;\n \ttcp_offset = inner_ipv4_offset + pkt->l3_len;\n \n \t/* Outer IPv4 header. */\n@@ -63,9 +65,13 @@\n \tsent_seq = rte_be_to_cpu_32(tcp_hdr->sent_seq);\n \ttail_idx = nb_segs - 1;\n \n+\t/* Only update UDP header for VxLAN packets. */\n+\tupdate_udp_hdr = (pkt->ol_flags & PKT_TX_TUNNEL_VXLAN) ? 1 : 0;\n+\n \tfor (i = 0; i < nb_segs; i++) {\n \t\tupdate_ipv4_header(segs[i], outer_ipv4_offset, outer_id);\n-\t\tupdate_udp_header(segs[i], udp_offset);\n+\t\tif (update_udp_hdr)\n+\t\t\tupdate_udp_header(segs[i], udp_gre_offset);\n \t\tupdate_ipv4_header(segs[i], inner_ipv4_offset, inner_id);\n \t\tupdate_tcp_header(segs[i], tcp_offset, sent_seq, i < tail_idx);\n \t\touter_id++;\ndiff --git a/lib/librte_gso/rte_gso.c b/lib/librte_gso/rte_gso.c\nindex 6095689..b748ab1 100644\n--- a/lib/librte_gso/rte_gso.c\n+++ b/lib/librte_gso/rte_gso.c\n@@ -60,8 +60,9 @@\n \n \tif ((gso_ctx->gso_size >= pkt->pkt_len) || (gso_ctx->gso_types &\n \t\t\t\t(DEV_TX_OFFLOAD_TCP_TSO |\n-\t\t\t\t DEV_TX_OFFLOAD_VXLAN_TNL_TSO)) !=\n-\t\t\t\tgso_ctx->gso_types) {\n+\t\t\t\t DEV_TX_OFFLOAD_VXLAN_TNL_TSO |\n+\t\t\t\t DEV_TX_OFFLOAD_GRE_TNL_TSO)) !=\n+\t\t\t\t gso_ctx->gso_types) {\n \t\tpkt->ol_flags &= (~PKT_TX_TCP_SEG);\n \t\tpkts_out[0] = pkt;\n \t\treturn 1;\n@@ -73,7 +74,8 @@\n \tipid_delta = (gso_ctx->ipid_flag != RTE_GSO_IPID_FIXED);\n \tol_flags = pkt->ol_flags;\n \n-\tif (IS_IPV4_VXLAN_TCP4(pkt->ol_flags)) {\n+\tif (IS_IPV4_VXLAN_TCP4(pkt->ol_flags) ||\n+\t\t\tIS_IPV4_GRE_TCP4(pkt->ol_flags)) {\n \t\tpkt->ol_flags &= (~PKT_TX_TCP_SEG);\n \t\tret = gso_tunnel_tcp4_segment(pkt, gso_size, ipid_delta,\n \t\t\t\tdirect_pool, indirect_pool,\n",
    "prefixes": [
        "dpdk-dev",
        "v6",
        "4/6"
    ]
}