From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60077.outbound.protection.outlook.com [40.107.6.77]) by dpdk.org (Postfix) with ESMTP id 6979B1B1D1 for ; Wed, 10 Jan 2018 10:10:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SRNJYOPkSHQBTX6ZH9oz7TFWGSORlDjqf0rDPWEoZ4k=; b=uUH5+/rC+CRMXJv9ZRCngE6rXLBzAHDpPclYmRY34OdXgxWE315qr663ZCsKxdScPbtrLd13/yXaWZ0bx0FF5Gd7kdQ7wwfHoPgqCZSyXe88FBOCHynUp1MLDrPYFWgRP4dw8AV9Rh3YIf8lamml3KU4yO5TvvPc1lGtRDG5byM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by AM4PR05MB3137.eurprd05.prod.outlook.com (2603:10a6:205:3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 09:10:01 +0000 From: Shahaf Shuler To: jingjing.wu@intel.com, thomas@monjalon.net, ferruh.yigit@intel.com Cc: dev@dpdk.org Date: Wed, 10 Jan 2018 11:09:15 +0200 Message-Id: X-Mailer: git-send-email 2.12.0 In-Reply-To: References: <20171123120804.143897-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: VI1PR0202CA0030.eurprd02.prod.outlook.com (2603:10a6:803:14::43) To AM4PR05MB3137.eurprd05.prod.outlook.com (2603:10a6:205:3::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: de05077c-14d8-41ae-1232-08d55809eea3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM4PR05MB3137; X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3137; 3:fJo5X3R5ZiBBrJ61E70ttP673MXg1z3F2Enm8o8lfLislBIMHqCDqKCk6O8GsUH0lspOd2GCcexeAFzFZBo56MXjUjwS80PFWeGxq9gGlp2ULK7NFPO+x1ndqHRfaDd3PmWtjhw5pgIGO47U0Gej8v5VQuBw3N1T3CjfjyRjy3RAuGKtaMDAmEjCocnmZJZGbvyV4peZ4zjUmVJQ+2bSzLamYuWzKSExAglDpevUrY2r4EHjYvViYjv38A6nkBSK; 25:Ll9HCVpgYp7mrp4lb/UN9V0Ag53ZvdmMQZEAzblEAZryJQKEdd2/o+5wQqajNc+9rYJcBuGlEzWF0AbeNf1ZR2mpxrrzyQvZtWqXOs9YXq0OVLMuUDTxCddWzUmevYVT+ai13e5WcOBZ2T7GJ78fIsSjlfmj7dwhNqxr8z0hC27BypxkZVJ/2csgrvyB9q2AHJ6bwQYIUEk3VfFRL/B4W9TPHI4MmuTgyvSc0EMbfTXbd9G/nhCtFO5slTZg+dH9hJ5QuqKp7jCHhgIDrO59tiaoU47FL4nKPx7+clIgmDCO+SgB0KrXtlVQmb/ShFx2Z0OvwztCsbZCf21vOBROrg==; 31:WyfCAa9MgF7EsKwiCce9gJZMYqRrsX2Zl5Htgc4aIZAq2mz6di1HdLBCygNTEYU8ZZ5giSUatO4UBnnr8z1kBDrIEn1zJktKlzq4yOPVxj8Quu7sMW1WtfMyOrw1nYpdaVr6VnGDOcKox+gAfJEbUxUheilowSu5AOYidIqgUIfhW+bG2jTVRuyZaQkV/Rd+iFpWmOTcCb/nJJFP1ieXidthTUuI2tz8FAMtY+p6ZmI= X-MS-TrafficTypeDiagnostic: AM4PR05MB3137: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3137; 20:3XwjG5tSGYdvEBUb+k+R0iU5CXM/lJ2C2xsigijEf2mMIQAzB0VpP7mgINpqRmJ3S0gMSpgYc6ak0zrJaaeVeyHM/E8TAkr6wYpp7r9DteIiiZc/PxebHDtjyXam6eDbe6/xMV6/NSumILCiAp8roeZVOeSIdCJ9PHVIydjJjwhFj36xwOrA5Ly+tU+9T2OfpS/gtASyv40ZCozljJLhqYqRzIOdIifzKrWXI7ViWbxRVdZDFQeGCSQ9GEMt1UAxU52jqasmJdkwEVvH8MLOoJaaBbNvCMsMxqjzi3ZdF8EEDG0Fs22+hEjCFrrLJQlx0TBDcB3wgRw+3WI/IOb6YAafEK+vWFynuauP9P1/Oze25Iz3Xv65hHQpX4zkMpf1mE0/b4XrB9My+X/ElrXm8YhdctvNyJ8iOpcKPsWdhiTs8VrMbmSFhaYphbI3XmQqDlILcI+0XqsmdHl0fwXSDdbBh6gy/5c/4Usoz/irdEpz0+rcqtpszI5HFvfcgUzb; 4:Mg/DGDZHcdXn0dhu5lwycDQIdpw/VXh0w8UixjJApRc7yGL0WHR7LUyUfTy8y8FNCDbICZk3dnIy0u6z9enMCSk2TQDFrMaidb2QP/xVDLrH9CX1yg5mhygPqMAIc7B6Fwj7bBwoy7mia6hE6/HaPsNHMjmETJ1ua9bnZHHB/P9LZJJLJcyqjdXl26jT0Ibmfj9uP5t2Kmhh20tmoeDQhpFAf3Gn5HxlwfkCrKvl3dPVMc1nTKDCMw/QWTEhP9hdva0Y05vnr/ePU9BtQGxapQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231023)(944501075)(6055026)(6041268)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM4PR05MB3137; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM4PR05MB3137; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(396003)(366004)(39380400002)(346002)(199004)(189003)(6666003)(478600001)(2950100002)(5660300001)(8936002)(50226002)(8676002)(81156014)(68736007)(86362001)(81166006)(575784001)(118296001)(305945005)(7736002)(55016002)(2906002)(21086003)(6116002)(3846002)(106356001)(105586002)(59450400001)(316002)(50466002)(69596002)(386003)(16586007)(36756003)(4326008)(52116002)(76176011)(51416003)(7696005)(97736004)(16526018)(47776003)(53936002)(25786009)(48376002)(33026002)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3137; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR05MB3137; 23:KmK41FMUpepPUS8mo/kdtFC/u/DCplBh+c9hqG/Ml?= =?us-ascii?Q?4Y5sfJmVWm8ug+o/awlKtv0dtIiuYKA1ZSPoBB6+BxMcrO2lkRX+KwD0e8Fh?= =?us-ascii?Q?aDstyoFLS7iQRaS/dwuDckh9LSVYZzVanQ+sGVk4H5lZdJryvYAkzyXm7ZK0?= =?us-ascii?Q?+l3XjU2kXcm6hrxulzHbIYXkG0KiTnVztydXsA8LENCO02jwr4M9m86hWszL?= =?us-ascii?Q?JevdDNBMIMYzU0ne+eKjod4E7nTbpqd5wF6mIkfvKr2A+qRkBZHTsCNYuQJX?= =?us-ascii?Q?gUvrZouHiGk3g28gxd9rPxAA9PcQ+rwfYTzgDN8s9rnJzFt56IsxObDuX60+?= =?us-ascii?Q?kHxtsMzpCkL0o6Fms+chenLX0bHngz2sDYWfQEZeZ4pMIZY7zE6dMkqaVBM3?= =?us-ascii?Q?avXP/KtMlWqDSTyHl7/uXpQ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q5C04OE0Y6+pIhHbqOA+c0mZbUcsgksAmh10Ml6XstrNqI7+GFt6wW880w+vmGO5Z9OC/IxO/3xC7A1VUh/NEqyIQ4NaRqudMB2qAmPq2u8LgU8BRYPtEicin/GHSEa5VjizpKpvY1JZESi077M5ViPFZOk1Tqju4GFhch5udBjoS0swpjsJeUNZhotT6Ks6RJhXsoDpGf2RQKrnDZeh/Lj/AdfUnBrhpYegqulNAqGqRbdpONAhmb7rs3hDcihc=; 5:uMmmlQQXYU1l2bL1XRYX0bVjaUnV07WNas8BqPvmzHocsBq30nFEcy6//vaR936xH5b1fFEQUjg0Ls9Fq7tf1QD6SZ62V7H4Hs3K6XhS5kwugHje/t0PuZDB2U8wHjlsWXebAzyHS1ooKpbXDCnpFlbtMgTR566N/fwgdp1q0to=; 24:3j3pXiDZhZAcwAAnkXMQJ5PtaoGW/RVutq/lU7quXEqrf+3qXPsEBtf0pOJNj+fIYiRU4hTkQVUp/HdWR0VIktlitcT29h/uvhRObX6xlfA=; 7:TsqibUo5GZBQAin7geclQ4IpTlC7BqSqDoPG8nGvPq9ZgLRrqUM4XxBotsr79kVsVBnBxNrUg4i2RRLT2v12UnSZcQe/IwbnprwA8Wq3oT1Rq2oJTsv/0ppTS7eqnXU2JTHt7KiID7spvr8eRIaxC5jssHXdSuJT8SAbEQkvI0X7o8c5b8lpyihgDk9QNQ5gcHnB+f+VzN5s5jfOZ1lHQiP9I2P30fHVuSY31CZm33xXLNUfyEmZds0Ji2GOlry7 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 09:10:01.7063 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: de05077c-14d8-41ae-1232-08d55809eea3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3137 Subject: [dpdk-dev] [PATCH v4 07/11] app/testpmd: add command line option for Tx offloads X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jan 2018 09:10:03 -0000 This patch adds command line option to set hex value for the ports Tx offloads flags. Signed-off-by: Shahaf Shuler --- app/test-pmd/parameters.c | 17 +++++++++++++++-- app/test-pmd/testpmd.c | 4 ++++ app/test-pmd/testpmd.h | 2 ++ doc/guides/testpmd_app_ug/run_app.rst | 5 +++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 263651cba..58889420f 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -99,7 +99,7 @@ usage(char* progname) "--rss-ip | --rss-udp | " "--rxpt= | --rxht= | --rxwt= | --rxfreet= | " "--txpt= | --txht= | --txwt= | --txfreet= | " - "--txrst= | --txqflags= ]\n", + "--txrst= | --txqflags= | --tx-offloads ]\n", progname); #ifdef RTE_LIBRTE_CMDLINE printf(" --interactive: run in interactive mode.\n"); @@ -216,6 +216,7 @@ usage(char* progname) "disable print of designated event or all of them.\n"); printf(" --flow-isolate-all: " "requests flow API isolated mode on all ports at initialization time.\n"); + printf(" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\n"); } #ifdef RTE_LIBRTE_CMDLINE @@ -566,8 +567,9 @@ launch_args_parse(int argc, char** argv) char **argvopt; int opt_idx; enum { TX, RX }; - /* Default Rx offloads for all ports. */ + /* Default offloads for all ports. */ uint64_t rx_offloads = rx_mode.offloads; + uint64_t tx_offloads = tx_mode.offloads; static struct option lgopts[] = { { "help", 0, 0, 0 }, @@ -645,6 +647,7 @@ launch_args_parse(int argc, char** argv) { "no-rmv-interrupt", 0, 0, 0 }, { "print-event", 1, 0, 0 }, { "mask-event", 1, 0, 0 }, + { "tx-offloads", 1, 0, 0 }, { 0, 0, 0, 0 }, }; @@ -1116,6 +1119,15 @@ launch_args_parse(int argc, char** argv) rmv_interrupt = 0; if (!strcmp(lgopts[opt_idx].name, "flow-isolate-all")) flow_isolate_all = 1; + if (!strcmp(lgopts[opt_idx].name, "tx-offloads")) { + char *end = NULL; + n = strtoull(optarg, &end, 16); + if (n >= 0) + tx_offloads = (uint64_t)n; + else + rte_exit(EXIT_FAILURE, + "tx-offloads must be >= 0\n"); + } if (!strcmp(lgopts[opt_idx].name, "print-event")) if (parse_event_printing_config(optarg, 1)) { rte_exit(EXIT_FAILURE, @@ -1142,4 +1154,5 @@ launch_args_parse(int argc, char** argv) /* Set offload configuration from command line parameters. */ rx_mode.offloads = rx_offloads; + tx_mode.offloads = tx_offloads; } diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 0087438bc..806548196 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -344,6 +344,8 @@ struct rte_eth_rxmode rx_mode = { .ignore_offload_bitfield = 1, }; +struct rte_eth_txmode tx_mode; + struct rte_fdir_conf fdir_conf = { .mode = RTE_FDIR_MODE_NONE, .pballoc = RTE_FDIR_PBALLOC_64K, @@ -604,6 +606,8 @@ init_config(void) RTE_ETH_FOREACH_DEV(pid) { port = &ports[pid]; + /* Apply default Tx configuration for all ports */ + port->dev_conf.txmode = tx_mode; rte_eth_dev_info_get(pid, &port->dev_info); if (numa_support) { diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index c6baa1066..3e63edfa1 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -395,6 +395,8 @@ extern portid_t fwd_ports_ids[RTE_MAX_ETHPORTS]; extern struct rte_port *ports; extern struct rte_eth_rxmode rx_mode; +extern struct rte_eth_txmode tx_mode; + extern uint64_t rss_hf; extern queueid_t nb_rxq; diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst index 4c0d2cede..fface6f58 100644 --- a/doc/guides/testpmd_app_ug/run_app.rst +++ b/doc/guides/testpmd_app_ug/run_app.rst @@ -509,3 +509,8 @@ The commandline options are: configured flow rules only (see flow command). Ports that do not support this mode are automatically discarded. + +* ``--tx-offloads=0xXXXXXXXX`` + + Set the hexadecimal bitmask of TX queue offloads. + The default value is 0. -- 2.12.0