Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/17189/?format=api
https://patches.dpdk.org/api/patches/17189/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1479922585-8640-7-git-send-email-tomaszx.kulasek@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": "<1479922585-8640-7-git-send-email-tomaszx.kulasek@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1479922585-8640-7-git-send-email-tomaszx.kulasek@intel.com", "date": "2016-11-23T17:36:25", "name": "[dpdk-dev,v12,6/6] testpmd: use Tx preparation in csum engine", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "b0ec2100540f63431a51c2a3616f24dbd6d2792d", "submitter": { "id": 155, "url": "https://patches.dpdk.org/api/people/155/?format=api", "name": "Tomasz Kulasek", "email": "tomaszx.kulasek@intel.com" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1479922585-8640-7-git-send-email-tomaszx.kulasek@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/17189/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/17189/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 803585688;\n\tWed, 23 Nov 2016 18:41:52 +0100 (CET)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id B083498\n\tfor <dev@dpdk.org>; Wed, 23 Nov 2016 18:41:50 +0100 (CET)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga103.jf.intel.com with ESMTP; 23 Nov 2016 09:41:49 -0800", "from unknown (HELO Sent) ([10.103.102.79])\n\tby fmsmga002.fm.intel.com with SMTP; 23 Nov 2016 09:41:43 -0800", "by Sent (sSMTP sendmail emulation); Wed, 23 Nov 2016 18:41:01 +0100" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.31,539,1473145200\"; d=\"scan'208\";\n\ta=\"1089550515\"", "From": "Tomasz Kulasek <tomaszx.kulasek@intel.com>", "To": "dev@dpdk.org", "Cc": "konstantin.ananyev@intel.com,\n\tolivier.matz@6wind.com", "Date": "Wed, 23 Nov 2016 18:36:25 +0100", "Message-Id": "<1479922585-8640-7-git-send-email-tomaszx.kulasek@intel.com>", "X-Mailer": "git-send-email 2.1.4", "In-Reply-To": "<1479922585-8640-1-git-send-email-tomaszx.kulasek@intel.com>", "References": "<1477486575-25148-1-git-send-email-tomaszx.kulasek@intel.com>\n\t<1479922585-8640-1-git-send-email-tomaszx.kulasek@intel.com>", "Subject": "[dpdk-dev] [PATCH v12 6/6] testpmd: use Tx preparation in csum\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": "Added \"csum txprep (on|off)\" command which allows to switch to the\ntx path using Tx preparation API.\n\nBy default unchanged implementation is used.\n\nUsing Tx preparation path, pseudo header calculation for udp/tcp/tso\npackets from application, and used Tx preparation API for\npacket preparation and verification.\n\nAdding additional step to the csum engine costs about 3-4% of performance\ndrop, on my setup with ixgbe driver. It's caused mostly by the need\nof reaccessing and modification of packet data.\n\nSigned-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>\nAcked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n---\n app/test-pmd/cmdline.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++\n app/test-pmd/csumonly.c | 33 ++++++++++++++++++++++++-------\n app/test-pmd/testpmd.c | 5 +++++\n app/test-pmd/testpmd.h | 2 ++\n 4 files changed, 82 insertions(+), 7 deletions(-)", "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 63b55dc..373fc59 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -366,6 +366,10 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"csum show (port_id)\\n\"\n \t\t\t\" Display tx checksum offload configuration\\n\\n\"\n \n+\t\t\t\"csum txprep (on|off)\"\n+\t\t\t\" Enable tx preparation path in csum forward engine\"\n+\t\t\t\"\\n\\n\"\n+\n \t\t\t\"tso set (segsize) (portid)\\n\"\n \t\t\t\" Enable TCP Segmentation Offload in csum forward\"\n \t\t\t\" engine.\\n\"\n@@ -3523,6 +3527,50 @@ struct cmd_csum_tunnel_result {\n \t},\n };\n \n+/* Enable/disable tx preparation path */\n+struct cmd_csum_txprep_result {\n+\tcmdline_fixed_string_t csum;\n+\tcmdline_fixed_string_t parse;\n+\tcmdline_fixed_string_t onoff;\n+};\n+\n+static void\n+cmd_csum_txprep_parsed(void *parsed_result,\n+\t\t __attribute__((unused)) struct cmdline *cl,\n+\t\t __attribute__((unused)) void *data)\n+{\n+\tstruct cmd_csum_txprep_result *res = parsed_result;\n+\n+\tif (!strcmp(res->onoff, \"on\"))\n+\t\ttx_prepare = 1;\n+\telse\n+\t\ttx_prepare = 0;\n+\n+}\n+\n+cmdline_parse_token_string_t cmd_csum_txprep_csum =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_csum_txprep_result,\n+\t\t\t\tcsum, \"csum\");\n+cmdline_parse_token_string_t cmd_csum_txprep_parse =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_csum_txprep_result,\n+\t\t\t\tparse, \"txprep\");\n+cmdline_parse_token_string_t cmd_csum_txprep_onoff =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_csum_txprep_result,\n+\t\t\t\tonoff, \"on#off\");\n+\n+cmdline_parse_inst_t cmd_csum_txprep = {\n+\t.f = cmd_csum_txprep_parsed,\n+\t.data = NULL,\n+\t.help_str = \"enable/disable tx preparation path for csum engine: \"\n+\t\"csum txprep on|off\",\n+\t.tokens = {\n+\t\t(void *)&cmd_csum_txprep_csum,\n+\t\t(void *)&cmd_csum_txprep_parse,\n+\t\t(void *)&cmd_csum_txprep_onoff,\n+\t\tNULL,\n+\t},\n+};\n+\n /* *** ENABLE HARDWARE SEGMENTATION IN TX NON-TUNNELED PACKETS *** */\n struct cmd_tso_set_result {\n \tcmdline_fixed_string_t tso;\n@@ -11470,6 +11518,7 @@ struct cmd_set_vf_mac_addr_result {\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_csum_txprep,\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_tunnel_tso_set,\ndiff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c\nindex 57e6ae2..3afa9ab 100644\n--- a/app/test-pmd/csumonly.c\n+++ b/app/test-pmd/csumonly.c\n@@ -372,8 +372,10 @@ struct simple_gre_hdr {\n \t\t\tudp_hdr->dgram_cksum = 0;\n \t\t\tif (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_UDP_CKSUM) {\n \t\t\t\tol_flags |= PKT_TX_UDP_CKSUM;\n-\t\t\t\tudp_hdr->dgram_cksum = get_psd_sum(l3_hdr,\n-\t\t\t\t\tinfo->ethertype, ol_flags);\n+\t\t\t\tif (!tx_prepare)\n+\t\t\t\t\tudp_hdr->dgram_cksum = get_psd_sum(\n+\t\t\t\t\t\t\tl3_hdr, info->ethertype,\n+\t\t\t\t\t\t\tol_flags);\n \t\t\t} else {\n \t\t\t\tudp_hdr->dgram_cksum =\n \t\t\t\t\tget_udptcp_checksum(l3_hdr, udp_hdr,\n@@ -385,12 +387,15 @@ struct simple_gre_hdr {\n \t\ttcp_hdr->cksum = 0;\n \t\tif (tso_segsz) {\n \t\t\tol_flags |= PKT_TX_TCP_SEG;\n-\t\t\ttcp_hdr->cksum = get_psd_sum(l3_hdr, info->ethertype,\n-\t\t\t\tol_flags);\n+\t\t\tif (!tx_prepare)\n+\t\t\t\ttcp_hdr->cksum = get_psd_sum(l3_hdr,\n+\t\t\t\t\t\tinfo->ethertype, ol_flags);\n+\n \t\t} else if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_TCP_CKSUM) {\n \t\t\tol_flags |= PKT_TX_TCP_CKSUM;\n-\t\t\ttcp_hdr->cksum = get_psd_sum(l3_hdr, info->ethertype,\n-\t\t\t\tol_flags);\n+\t\t\tif (!tx_prepare)\n+\t\t\t\ttcp_hdr->cksum = get_psd_sum(l3_hdr,\n+\t\t\t\t\t\tinfo->ethertype, ol_flags);\n \t\t} else {\n \t\t\ttcp_hdr->cksum =\n \t\t\t\tget_udptcp_checksum(l3_hdr, tcp_hdr,\n@@ -648,6 +653,7 @@ struct simple_gre_hdr {\n \tvoid *l3_hdr = NULL, *outer_l3_hdr = NULL; /* can be IPv4 or IPv6 */\n \tuint16_t nb_rx;\n \tuint16_t nb_tx;\n+\tuint16_t nb_prep;\n \tuint16_t i;\n \tuint64_t rx_ol_flags, tx_ol_flags;\n \tuint16_t testpmd_ol_flags;\n@@ -857,7 +863,20 @@ struct simple_gre_hdr {\n \t\t\tprintf(\"\\n\");\n \t\t}\n \t}\n-\tnb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_rx);\n+\n+\tif (tx_prepare) {\n+\t\tnb_prep = rte_eth_tx_prepare(fs->tx_port, fs->tx_queue,\n+\t\t\t\tpkts_burst, nb_rx);\n+\t\tif (nb_prep != nb_rx)\n+\t\t\tprintf(\"Preparing packet burst to transmit failed: %s\\n\",\n+\t\t\t\t\trte_strerror(rte_errno));\n+\n+\t\tnb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst,\n+\t\t\t\tnb_prep);\n+\t} else\n+\t\tnb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst,\n+\t\t\t\tnb_rx);\n+\n \t/*\n \t * Retry if necessary\n \t */\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex a0332c2..c18bc28 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -180,6 +180,11 @@ struct fwd_engine * fwd_engines[] = {\n enum tx_pkt_split tx_pkt_split = TX_PKT_SPLIT_OFF;\n /**< Split policy for packets to TX. */\n \n+/*\n+ * Enable Tx preparation path in the \"csum\" engine.\n+ */\n+uint8_t tx_prepare = 0;\n+\n uint16_t nb_pkt_per_burst = DEF_PKT_BURST; /**< Number of packets per burst. */\n uint16_t mb_mempool_cache = DEF_MBUF_CACHE; /**< Size of mbuf mempool cache. */\n \ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex 9c1e703..488a6e1 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -383,6 +383,8 @@ enum tx_pkt_split {\n \n extern enum tx_pkt_split tx_pkt_split;\n \n+extern uint8_t tx_prepare;\n+\n extern uint16_t nb_pkt_per_burst;\n extern uint16_t mb_mempool_cache;\n extern int8_t rx_pthresh;\n", "prefixes": [ "dpdk-dev", "v12", "6/6" ] }{ "id": 17189, "url": "