get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2450,
    "url": "https://patches.dpdk.org/api/patches/2450/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1421883395-27235-11-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-11-git-send-email-olivier.matz@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1421883395-27235-11-git-send-email-olivier.matz@6wind.com",
    "date": "2015-01-21T23:36:29",
    "name": "[dpdk-dev,RFC,10/16] testpmd: add csum parse_tunnel command",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ba9ba2e45633b977f544f318e403aad59c37c737",
    "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-11-git-send-email-olivier.matz@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/2450/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/2450/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 C56935ACE;\n\tThu, 22 Jan 2015 00:37:05 +0100 (CET)",
            "from mail-we0-f171.google.com (mail-we0-f171.google.com\n\t[74.125.82.171]) by dpdk.org (Postfix) with ESMTP id 36E4F5AB3\n\tfor <dev@dpdk.org>; Thu, 22 Jan 2015 00:36:56 +0100 (CET)",
            "by mail-we0-f171.google.com with SMTP id q58so478870wes.2\n\tfor <dev@dpdk.org>; Wed, 21 Jan 2015 15:36:56 -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.55\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 21 Jan 2015 15:36:55 -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=OpIaSHuPUE+rgz6hfNp3C830vM+kH+rI9Oh9YZI4gVc=;\n\tb=KVSs/ZYQFcAGzdmi/wtlaBNmP0F9P6nicBwI7Od8TFQMLVFLTM4Q6kD63KTv31AuDn\n\tGgk+nTIGLSXAq8pyBpjFzy6XJ0oDMq2B1roVsTjvSed7v2M1JmVIIhswmIB4q790KNwF\n\tv6jp+U4Q+2s+kutIkptQyx9HwXVpaNw5dSF6czJgS+q4GeX13NLnhQ62z70QLVhwxkMI\n\tgqsWBu1BJ6rZti30aXEWbeMDhZzcLvkfzt/ut0DSALvfkCSU+X6gWK2resjXCkt7PJyR\n\t7lPQXm7TJSBLa6EuMtF24X21EiS5mYIrFJquGGTJcB7dZ1+ikWhjwo3aTo3KTpFabF/A\n\tszpQ==",
        "X-Gm-Message-State": "ALoCoQlqzyX/rPrz1RRAYdKPu/a14J7JGoTAiU/S+GdSgh+5nI4i5yR91OnFu+OosRYwyO3ow8u+",
        "X-Received": "by 10.181.27.199 with SMTP id ji7mr62269012wid.76.1421883416073; \n\tWed, 21 Jan 2015 15:36:56 -0800 (PST)",
        "From": "Olivier Matz <olivier.matz@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Thu, 22 Jan 2015 00:36:29 +0100",
        "Message-Id": "<1421883395-27235-11-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 10/16] testpmd: add csum parse_tunnel command",
        "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 a new command related to csum forward engine:\n\n  csum parse-tunnel (on|off) (port_id)\n\nIf enabled, the tunnel packets received by the csum forward engine are\nparsed and seen as \"outer-headers/inner-headers/data\".\n\nIf disabled, the parsing of the csum forward engine stops at the first\nl4 layer. A tunnel packet is seens as \"headers/data\" (inner headers are\nincluded in payload).\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n app/test-pmd/cmdline.c  | 64 +++++++++++++++++++++++++++++++++++++++++++++++++\n app/test-pmd/csumonly.c |  3 ++-\n app/test-pmd/testpmd.h  |  5 +++-\n 3 files changed, 70 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 260a273..1d294bc 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -326,6 +326,10 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\" the forward engine)\\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\"\n+\t\t\t\"    If disabled, treat tunnel packets as non-tunneled\"\n+\t\t\t\" packets (treat inner headers as payload).\\n\\n\"\n+\n \t\t\t\"csum show (port_id)\\n\"\n \t\t\t\"    Display tx checksum offload configuration\\n\\n\"\n \n@@ -2873,6 +2877,8 @@ csum_show(int port_id)\n \tuint16_t ol_flags;\n \n \tol_flags = ports[port_id].tx_ol_flags;\n+\tprintf(\"Parse tunnel is %s\\n\",\n+\t\t(ol_flags & TESTPMD_TX_OFFLOAD_PARSE_TUNNEL) ? \"on\" : \"off\");\n \tprintf(\"IP checksum offload is %s\\n\",\n \t\t(ol_flags & TESTPMD_TX_OFFLOAD_IP_CKSUM) ? \"hw\" : \"sw\");\n \tprintf(\"UDP checksum offload is %s\\n\",\n@@ -2995,6 +3001,63 @@ cmdline_parse_inst_t cmd_csum_show = {\n \t},\n };\n \n+/* Enable/disable tunnel parsing */\n+struct cmd_csum_tunnel_result {\n+\tcmdline_fixed_string_t csum;\n+\tcmdline_fixed_string_t parse;\n+\tcmdline_fixed_string_t onoff;\n+\tuint8_t port_id;\n+};\n+\n+static void\n+cmd_csum_tunnel_parsed(void *parsed_result,\n+\t\t       __attribute__((unused)) struct cmdline *cl,\n+\t\t       __attribute__((unused)) void *data)\n+{\n+\tstruct cmd_csum_tunnel_result *res = parsed_result;\n+\n+\tif (port_id_is_invalid(res->port_id)) {\n+\t\tprintf(\"invalid port %d\\n\", res->port_id);\n+\t\treturn;\n+\t}\n+\n+\tif (!strcmp(res->onoff, \"on\"))\n+\t\tports[res->port_id].tx_ol_flags |=\n+\t\t\tTESTPMD_TX_OFFLOAD_PARSE_TUNNEL;\n+\telse\n+\t\tports[res->port_id].tx_ol_flags &=\n+\t\t\t(~TESTPMD_TX_OFFLOAD_PARSE_TUNNEL);\n+\n+\tcsum_show(res->port_id);\n+}\n+\n+cmdline_parse_token_string_t cmd_csum_tunnel_csum =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_csum_tunnel_result,\n+\t\t\t\tcsum, \"csum\");\n+cmdline_parse_token_string_t cmd_csum_tunnel_parse =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_csum_tunnel_result,\n+\t\t\t\tparse, \"parse_tunnel\");\n+cmdline_parse_token_string_t cmd_csum_tunnel_onoff =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_csum_tunnel_result,\n+\t\t\t\tonoff, \"on#off\");\n+cmdline_parse_token_num_t cmd_csum_tunnel_portid =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_csum_tunnel_result,\n+\t\t\t\tport_id, UINT8);\n+\n+cmdline_parse_inst_t cmd_csum_tunnel = {\n+\t.f = cmd_csum_tunnel_parsed,\n+\t.data = NULL,\n+\t.help_str = \"enable/disable parsing of tunnels for csum engine: \"\n+\t\"csum parse_tunnel on|off <port>\",\n+\t.tokens = {\n+\t\t(void *)&cmd_csum_tunnel_csum,\n+\t\t(void *)&cmd_csum_tunnel_parse,\n+\t\t(void *)&cmd_csum_tunnel_onoff,\n+\t\t(void *)&cmd_csum_tunnel_portid,\n+\t\tNULL,\n+\t},\n+};\n+\n /* *** ENABLE HARDWARE SEGMENTATION IN TX PACKETS *** */\n struct cmd_tso_set_result {\n \tcmdline_fixed_string_t tso;\n@@ -8731,6 +8794,7 @@ cmdline_parse_ctx_t main_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_tx_vlan_set_pvid,\n \t(cmdline_parse_inst_t *)&cmd_csum_set,\n \t(cmdline_parse_inst_t *)&cmd_csum_show,\n+\t(cmdline_parse_inst_t *)&cmd_csum_tunnel,\n \t(cmdline_parse_inst_t *)&cmd_tso_set,\n \t(cmdline_parse_inst_t *)&cmd_tso_show,\n \t(cmdline_parse_inst_t *)&cmd_link_flow_control_set,\ndiff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c\nindex ca5ca39..858eb47 100644\n--- a/app/test-pmd/csumonly.c\n+++ b/app/test-pmd/csumonly.c\n@@ -373,7 +373,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \t\tl3_hdr = (char *)eth_hdr + l2_len;\n \n \t\t/* check if it's a supported tunnel (only vxlan for now) */\n-\t\tif (l4_proto == IPPROTO_UDP) {\n+\t\tif ((testpmd_ol_flags & TESTPMD_TX_OFFLOAD_PARSE_TUNNEL) &&\n+\t\t\tl4_proto == IPPROTO_UDP) {\n \t\t\tudp_hdr = (struct udp_hdr *)((char *)l3_hdr + l3_len);\n \n \t\t\t/* check udp destination port, 4789 is the default\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex 8f5e6c7..36277de 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -127,8 +127,11 @@ struct fwd_stream {\n #define TESTPMD_TX_OFFLOAD_SCTP_CKSUM        0x0008\n /** Offload VxLAN checksum in csum forward engine */\n #define TESTPMD_TX_OFFLOAD_VXLAN_CKSUM       0x0010\n+/** Parse tunnel in csum forward engine. If set, dissect tunnel headers\n+ * of rx packets. If not set, treat inner headers as payload. */\n+#define TESTPMD_TX_OFFLOAD_PARSE_TUNNEL      0x0020\n /** Insert VLAN header in forward engine */\n-#define TESTPMD_TX_OFFLOAD_INSERT_VLAN       0x0020\n+#define TESTPMD_TX_OFFLOAD_INSERT_VLAN       0x0040\n \n /**\n  * The data structure associated with each port.\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "10/16"
    ]
}