Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/3285/?format=api
http://patches.dpdk.org/api/patches/3285/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1423819371-24222-9-git-send-email-olivier.matz@6wind.com/", "project": { "id": 1, "url": "http://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": "<1423819371-24222-9-git-send-email-olivier.matz@6wind.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1423819371-24222-9-git-send-email-olivier.matz@6wind.com", "date": "2015-02-13T09:22:39", "name": "[dpdk-dev,v3,08/20] testpmd: add csum parse_tunnel command", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "69ec3e3424bf2547b3704ea19b19cc4c2ba9b06a", "submitter": { "id": 8, "url": "http://patches.dpdk.org/api/people/8/?format=api", "name": "Olivier Matz", "email": "olivier.matz@6wind.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1423819371-24222-9-git-send-email-olivier.matz@6wind.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/3285/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/3285/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 3936CB40C;\n\tFri, 13 Feb 2015 10:23:25 +0100 (CET)", "from mail-wi0-f170.google.com (mail-wi0-f170.google.com\n\t[209.85.212.170]) by dpdk.org (Postfix) with ESMTP id 90B04B3DB\n\tfor <dev@dpdk.org>; Fri, 13 Feb 2015 10:23:07 +0100 (CET)", "by mail-wi0-f170.google.com with SMTP id hi2so10655883wib.1\n\tfor <dev@dpdk.org>; Fri, 13 Feb 2015 01:23:07 -0800 (PST)", "from glumotte.dev.6wind.com (6wind.net2.nerim.net.\n\t[213.41.180.237]) by mx.google.com with ESMTPSA id\n\ta5sm2100153wib.20.2015.02.13.01.23.06\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tFri, 13 Feb 2015 01:23:07 -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=yX4B36NEBfcZAQQ8+o5ZH9X3/6WBRDBLb0O8ykYbutg=;\n\tb=ZrJM1/d/cw+wVNFbfB2WYpHabIMV/bL/PGOrUUDDluQ58oCeqcEDPgV66AGNAZGeb8\n\tKf2bemyGLQ0ebn9FeaQuyDaz2qE9JGbzod4nQSGU60XPg94xbojO5+61ImZqjV4wij+M\n\tPyKIoTpeggDLe5fIwex1MbB9DbkDqqXPvGb9xsAMfh4x/J/8ShmH8hybvQyKuo8G/deb\n\tP3T+fnfvxdq4Mtte0O/mvXNq1Arw5a/o6OKZPfHRv8+AXOfTj6mrLz/ZXfho2dX6Ukdw\n\toFTd58TmlvJPtlQXwzC1I65c6582BNQSlbdBBtcgSo5qOdDBM48giQ0UUS+2s6UMq9bA\n\tDPOQ==", "X-Gm-Message-State": "ALoCoQmVDFxWy2aTgj3okcnZJuxoBs0Ys8XkBQJixHr3vx0Yvs8emV+naNkV1cfcAMV5WTsWiN7Z", "X-Received": "by 10.194.205.228 with SMTP id lj4mr15896778wjc.77.1423819387485;\n\tFri, 13 Feb 2015 01:23:07 -0800 (PST)", "From": "Olivier Matz <olivier.matz@6wind.com>", "To": "dev@dpdk.org", "Date": "Fri, 13 Feb 2015 10:22:39 +0100", "Message-Id": "<1423819371-24222-9-git-send-email-olivier.matz@6wind.com>", "X-Mailer": "git-send-email 2.1.4", "In-Reply-To": "<1423819371-24222-1-git-send-email-olivier.matz@6wind.com>", "References": "<1423041925-26956-1-git-send-email-olivier.matz@6wind.com>\n\t<1423819371-24222-1-git-send-email-olivier.matz@6wind.com>", "Subject": "[dpdk-dev] [PATCH v3 08/20] 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) (tx_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\nNote: the port argument is the tx_port. It's more coherent compared\nto all other testpmd csum flags.\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n app/test-pmd/cmdline.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++\n app/test-pmd/csumonly.c | 3 ++-\n app/test-pmd/testpmd.h | 5 +++-\n 3 files changed, 72 insertions(+), 2 deletions(-)", "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 55768f1..f57bf0b 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -327,6 +327,12 @@ 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) (tx_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). The port\\n\"\n+\t\t\t\" argument is the port used for TX in csum forward\"\n+\t\t\t\" engine.\\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@@ -2889,6 +2895,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@@ -3011,6 +3019,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 <tx-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@@ -9060,6 +9125,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", "v3", "08/20" ] }{ "id": 3285, "url": "