get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 29766,
    "url": "https://patches.dpdk.org/api/patches/29766/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1507218244-29568-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": "<1507218244-29568-5-git-send-email-mark.b.kavanagh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1507218244-29568-5-git-send-email-mark.b.kavanagh@intel.com",
    "date": "2017-10-05T15:44:02",
    "name": "[dpdk-dev,v8,4/6] gso: add GRE GSO support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "06b05e395c16830e3a1539521c180b0a7e80adee",
    "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/1507218244-29568-5-git-send-email-mark.b.kavanagh@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/29766/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/29766/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 6BA731B288;\n\tThu,  5 Oct 2017 17:44:20 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id 4735D1B255\n\tfor <dev@dpdk.org>; Thu,  5 Oct 2017 17:44:10 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby orsmga104.jf.intel.com with ESMTP; 05 Oct 2017 08:44:08 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga005.fm.intel.com with ESMTP; 05 Oct 2017 08:44:06 -0700",
            "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tv95Fi6Nh001763; Thu, 5 Oct 2017 16:44:06 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id v95Fi6bd029716;\n\tThu, 5 Oct 2017 16:44:06 +0100",
            "(from mbkavana@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id v95Fi6js029712;\n\tThu, 5 Oct 2017 16:44:06 +0100"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.42,481,1500966000\"; d=\"scan'208\";a=\"159257151\"",
        "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": "Thu,  5 Oct 2017 16:44:02 +0100",
        "Message-Id": "<1507218244-29568-5-git-send-email-mark.b.kavanagh@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": "<1507201331-228465-1-git-send-email-mark.b.kavanagh@intel.com>",
        "References": "<1507201331-228465-1-git-send-email-mark.b.kavanagh@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v8 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 |  2 ++\n lib/librte_gso/gso_common.h            |  5 +++++\n lib/librte_gso/gso_tunnel_tcp4.c       | 14 ++++++++++----\n lib/librte_gso/rte_gso.c               |  9 ++++++---\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 c58eeb1..2faa630 100644\n--- a/doc/guides/rel_notes/release_17_11.rst\n+++ b/doc/guides/rel_notes/release_17_11.rst\n@@ -50,6 +50,8 @@ New Features\n   * TCP/IPv4 packets.\n   * VxLAN packets, which must have an outer IPv4 header, and contain\n     an inner TCP/IPv4 packet.\n+  * GRE packets, which must contain an outer IPv4 header, and inner\n+    TCP/IPv4 headers.\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 95d54e7..145ea49 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 5e8c8e5..8d0cfd7 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 b4c3e34..4fc2dd2 100644\n--- a/lib/librte_gso/rte_gso.c\n+++ b/lib/librte_gso/rte_gso.c\n@@ -58,7 +58,8 @@\n \t\t\tnb_pkts_out < 1 ||\n \t\t\tgso_ctx->gso_size < RTE_GSO_SEG_SIZE_MIN ||\n \t\t\t((gso_ctx->gso_types & (DEV_TX_OFFLOAD_TCP_TSO |\n-\t\t\tDEV_TX_OFFLOAD_VXLAN_TNL_TSO)) == 0))\n+\t\t\tDEV_TX_OFFLOAD_VXLAN_TNL_TSO |\n+\t\t\tDEV_TX_OFFLOAD_GRE_TNL_TSO)) == 0))\n \t\treturn -EINVAL;\n \n \tif (gso_ctx->gso_size >= pkt->pkt_len) {\n@@ -73,8 +74,10 @@\n \tipid_delta = (gso_ctx->flag != RTE_GSO_FLAG_IPID_FIXED);\n \tol_flags = pkt->ol_flags;\n \n-\tif (IS_IPV4_VXLAN_TCP4(pkt->ol_flags)\n-\t\t&& (gso_ctx->gso_types & DEV_TX_OFFLOAD_VXLAN_TNL_TSO)) {\n+\tif ((IS_IPV4_VXLAN_TCP4(pkt->ol_flags) &&\n+\t\t\t(gso_ctx->gso_types & DEV_TX_OFFLOAD_VXLAN_TNL_TSO)) ||\n+\t\t\t((IS_IPV4_GRE_TCP4(pkt->ol_flags) &&\n+\t\t\t (gso_ctx->gso_types & DEV_TX_OFFLOAD_GRE_TNL_TSO)))) {\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",
        "v8",
        "4/6"
    ]
}