get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2454,
    "url": "https://patches.dpdk.org/api/patches/2454/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1421883395-27235-16-git-send-email-olivier.matz@6wind.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": "<1421883395-27235-16-git-send-email-olivier.matz@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1421883395-27235-16-git-send-email-olivier.matz@6wind.com",
    "date": "2015-01-21T23:36:34",
    "name": "[dpdk-dev,RFC,15/16] testpmd: support gre tunnels in csum fwd engine",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e04876c432fb434d7d9b4f866c4b4199d9afc8d3",
    "submitter": {
        "id": 8,
        "url": "https://patches.dpdk.org/api/people/8/?format=api",
        "name": "Olivier Matz",
        "email": "olivier.matz@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1421883395-27235-16-git-send-email-olivier.matz@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/2454/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/2454/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 20BB75ADB;\n\tThu, 22 Jan 2015 00:37:16 +0100 (CET)",
            "from mail-we0-f173.google.com (mail-we0-f173.google.com\n\t[74.125.82.173]) by dpdk.org (Postfix) with ESMTP id 697105ACA\n\tfor <dev@dpdk.org>; Thu, 22 Jan 2015 00:37:05 +0100 (CET)",
            "by mail-we0-f173.google.com with SMTP id w62so5532843wes.4\n\tfor <dev@dpdk.org>; Wed, 21 Jan 2015 15:37:05 -0800 (PST)",
            "from glumotte.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net.\n\t[82.239.227.177]) by mx.google.com with ESMTPSA id\n\twa5sm1710761wjc.8.2015.01.21.15.36.59\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 21 Jan 2015 15:37:00 -0800 (PST)"
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=ykYJBYWF6PGd05lYO9ZpTcxBYZFy0Mt+ckR4L2bXisM=;\n\tb=AbVH+YEwaqCtiCwYaRjWnKGr0vCFSyjQUVBxVih9tyvkU1ad9+326YJpL1Me8Txns8\n\tZ1cUZ4efd0otS5orTXwOfFHh/xPt4hTOtHkAoijc+MINGKO51A43efei2qYRdARRnOfJ\n\tseHzzwtNmW2wABZOIxWVrI6Yv70rvltLlZ08dbeKEa1TmwLzDg6UKvd8KQ/Mlnc6vXf+\n\tDjLMlmNkutXBxOmGTvn13ZFgxuraPUyAl++HddWNmH2/wybkX1AhWXa+GaD4bOGTD48H\n\txnbcPi6ejVnOENKel5ck9fJHqN40jQ+0x8NOYzQ6NIHX3ODW8tPn2Ofpo644L/jTjXGK\n\tOzIQ==",
        "X-Gm-Message-State": "ALoCoQkqQ4PUP7k+pulmh7b233P3yXo/R8qI5mwBCv5voA/BJE8BMqHX8JRfPVa5CsBgm8PcRejl",
        "X-Received": "by 10.194.203.199 with SMTP id\n\tks7mr85606196wjc.105.1421883425305; \n\tWed, 21 Jan 2015 15:37:05 -0800 (PST)",
        "From": "Olivier Matz <olivier.matz@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Thu, 22 Jan 2015 00:36:34 +0100",
        "Message-Id": "<1421883395-27235-16-git-send-email-olivier.matz@6wind.com>",
        "X-Mailer": "git-send-email 2.1.3",
        "In-Reply-To": "<1421883395-27235-1-git-send-email-olivier.matz@6wind.com>",
        "References": "<1421883395-27235-1-git-send-email-olivier.matz@6wind.com>",
        "Subject": "[dpdk-dev] [RFC 15/16] testpmd: support gre tunnels in csum fwd\n\tengine",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <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": "Add support for Ethernet over GRE and IP over GRE tunnels.\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n app/test-pmd/cmdline.c  |  6 ++--\n app/test-pmd/csumonly.c | 87 +++++++++++++++++++++++++++++++++++++++++++++----\n 2 files changed, 84 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 451c728..9304207 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -321,9 +321,9 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\" checksum with when transmitting a packet using the\"\n \t\t\t\" csum forward engine.\\n\"\n \t\t\t\"    ip|udp|tcp|sctp always concern the inner layer.\\n\"\n-\t\t\t\"    outer-ip concerns the outer IP layer (in\"\n-\t\t\t\" case the packet is recognized as a vxlan packet by\"\n-\t\t\t\" the forward engine)\\n\"\n+\t\t\t\"    outer-ip concerns the outer IP layer in\"\n+\t\t\t\" case the packet is recognized as a tunnel packet by\"\n+\t\t\t\" the forward engine (vxlan and gre are supported)\\n\"\n \t\t\t\"    Please check the NIC datasheet for HW limits.\\n\\n\"\n \n \t\t\t\"csum parse-tunnel (on|off) (port_id)\\n\"\ndiff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c\nindex 52af0e7..02c01f6 100644\n--- a/app/test-pmd/csumonly.c\n+++ b/app/test-pmd/csumonly.c\n@@ -100,6 +100,12 @@ struct testpmd_offload_info {\n \tuint16_t tso_segsz;\n };\n \n+/* simplified GRE header (flags must be 0) */\n+struct simple_gre_hdr {\n+\tuint16_t flags;\n+\tuint16_t proto;\n+};\n+\n static uint16_t\n get_psd_sum(void *l3_hdr, uint16_t ethertype, uint64_t ol_flags)\n {\n@@ -218,6 +224,60 @@ parse_vxlan(struct udp_hdr *udp_hdr, struct testpmd_offload_info *info,\n \tinfo->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */\n }\n \n+/* Parse a gre header */\n+static void\n+parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)\n+{\n+\tstruct ether_hdr *eth_hdr;\n+\tstruct ipv4_hdr *ipv4_hdr;\n+\tstruct ipv6_hdr *ipv6_hdr;\n+\n+\t/* if flags != 0; it's not supported */\n+\tif (gre_hdr->flags != 0)\n+\t\treturn;\n+\n+\tif (gre_hdr->proto == _htons(ETHER_TYPE_IPv4)) {\n+\t\tinfo->is_tunnel = 1;\n+\t\tinfo->outer_ethertype = info->ethertype;\n+\t\tinfo->outer_l2_len = info->l2_len;\n+\t\tinfo->outer_l3_len = info->l3_len;\n+\n+\t\tipv4_hdr = (struct ipv4_hdr *)((char *)gre_hdr +\n+\t\t\tsizeof(struct simple_gre_hdr));\n+\n+\t\tparse_ipv4(ipv4_hdr, info);\n+\t\tinfo->ethertype = _htons(ETHER_TYPE_IPv4);\n+\t\tinfo->l2_len = 0;\n+\n+\t} else if (gre_hdr->proto == _htons(ETHER_TYPE_IPv6)) {\n+\t\tinfo->is_tunnel = 1;\n+\t\tinfo->outer_ethertype = info->ethertype;\n+\t\tinfo->outer_l2_len = info->l2_len;\n+\t\tinfo->outer_l3_len = info->l3_len;\n+\n+\t\tipv6_hdr = (struct ipv6_hdr *)((char *)gre_hdr +\n+\t\t\tsizeof(struct simple_gre_hdr));\n+\n+\t\tinfo->ethertype = _htons(ETHER_TYPE_IPv6);\n+\t\tparse_ipv6(ipv6_hdr, info);\n+\t\tinfo->l2_len = 0;\n+\n+\t} else if (gre_hdr->proto == _htons(0x6558)) { /* ETH_P_TEB in linux */\n+\t\tinfo->is_tunnel = 1;\n+\t\tinfo->outer_ethertype = info->ethertype;\n+\t\tinfo->outer_l2_len = info->l2_len;\n+\t\tinfo->outer_l3_len = info->l3_len;\n+\n+\t\teth_hdr = (struct ether_hdr *)((char *)gre_hdr +\n+\t\t\tsizeof(struct simple_gre_hdr));\n+\n+\t\tparse_ethernet(eth_hdr, info);\n+\t} else\n+\t\treturn;\n+\n+\tinfo->l2_len += sizeof(struct simple_gre_hdr);\n+}\n+\n /* modify the IPv4 or IPv4 source address of a packet */\n static void\n change_ip_addresses(void *l3_hdr, uint16_t ethertype)\n@@ -368,6 +428,8 @@ uint16_t testpmd_ol_flags)\n  *   Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP .\n  *   Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /\n  *           UDP|TCP|SCTP\n+ *   Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP\n+ *   Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP\n  *\n  * The testpmd command line for this forward engine sets the flags\n  * TESTPMD_TX_OFFLOAD_* in ports[tx_port].tx_ol_flags. They control\n@@ -437,12 +499,25 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \t\tparse_ethernet(eth_hdr, &info);\n \t\tl3_hdr = (char *)eth_hdr + info.l2_len;\n \n-\t\t/* check if it's a supported tunnel (only vxlan for now) */\n-\t\tif ((testpmd_ol_flags & TESTPMD_TX_OFFLOAD_PARSE_TUNNEL) &&\n-\t\t\tinfo.l4_proto == IPPROTO_UDP) {\n-\t\t\tstruct udp_hdr *udp_hdr;\n-\t\t\tudp_hdr = (struct udp_hdr *)((char *)l3_hdr + info.l3_len);\n-\t\t\tparse_vxlan(udp_hdr, &info, m->ol_flags);\n+\t\t/* check if it's a supported tunnel */\n+\t\tif (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_PARSE_TUNNEL) {\n+\t\t\tif (info.l4_proto == IPPROTO_UDP) {\n+\t\t\t\tstruct udp_hdr *udp_hdr;\n+\t\t\t\tudp_hdr = (struct udp_hdr *)((char *)l3_hdr +\n+\t\t\t\t\tinfo.l3_len);\n+\t\t\t\tparse_vxlan(udp_hdr, &info, m->ol_flags);\n+\t\t\t} else if (info.l4_proto == IPPROTO_GRE) {\n+\t\t\t\tstruct simple_gre_hdr *gre_hdr;\n+\t\t\t\tgre_hdr = (struct simple_gre_hdr *)\n+\t\t\t\t\t((char *)l3_hdr + info.l3_len);\n+\t\t\t\tparse_gre(gre_hdr, &info);\n+\t\t\t}\n+\t\t}\n+\t\t\tinfo.l4_proto == IPPROTO_GRE) {\n+\t\t\tstruct simple_gre_hdr *gre_hdr;\n+\t\t\tgre_hdr = (struct simple_gre_hdr *)((char *)l3_hdr +\n+\t\t\t\tinfo.l3_len);\n+\t\t\tparse_gre(gre_hdr, &info);\n \t\t}\n \n \t\t/* update l3_hdr and outer_l3_hdr if a tunnel was parsed */\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "15/16"
    ]
}