From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0059.outbound.protection.outlook.com [104.47.0.59]) by dpdk.org (Postfix) with ESMTP id CE12C1ADD3 for ; Tue, 12 Dec 2017 13:53:41 +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=hgvS0OFJIfyC/QB6DUZ4WFQaMj2C0R3ETk60g20v+Xw=; b=s1p+W2R1q/WePTGKY2ZKjsdozjgYK6fyfwZQVll/ykKb2FS6kFxMwyaz/UJJjOD51HBxQ9ku+srojxrv+guwuEmg/Dq9f2yodn+i2HziOxmVvmfgJw8uh447Xpi/TgxlrAMPTuriyWDa7lnVhxoytvTgSOr/I2BZq1oe8eON2ds= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by VI1PR05MB3150.eurprd05.prod.outlook.com (2603:10a6:802:1b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 12:53:40 +0000 From: Shahaf Shuler To: ferruh.yigit@intel.com, jingjing.wu@intel.com Cc: dev@dpdk.org Date: Tue, 12 Dec 2017 14:52:51 +0200 Message-Id: <28e350d218544efe580249b1ad3b0cc337912b6f.1513082773.git.shahafs@mellanox.com> 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: DB6PR1001CA0037.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::23) To VI1PR05MB3150.eurprd05.prod.outlook.com (2603:10a6:802:1b::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9a78eeb9-f770-4501-1535-08d5415f5ec1 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307); SRVR:VI1PR05MB3150; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 3:gYRtKUXeKxPG7Gg8DXoPVoGdwxnA5isuZ1U/4JkX2u69TCBtKaLmafIl0AgvNrklBuE097aiaDzN26+XRVpZlmDlESUykVT38WpIP5YyQhiPn+A744uQvAQdlPQYxMKW6H9rAzuHK8DkR5h8Ind7gIGcmk0R3zYkkFdgwWcgE1v59v0vIii+BlfaiCT8LkdaZHetIb2P1my9KMd3Ovfk/5n1EQFyMs17QTaM0oEfWAD4kF3YC2rTfgYiGWMSalg+; 25:mukfz3pnwp2p0V4yB/7MeG0YwUhBpFkZoE7ey3s5KJdT4oHENSEM9CWaxQ7t8skXQAvALcQFOG5zcL2/ZcNChiwT78uVz1zfsJMVQvXRs5qpVSIlIK+T1jM5RPAkY5hdbKTkhZz+4qjsgB8aF/PBzBiXv6xveyH8nNoMqfTlqheszHm1HW4kFXc+d1jfW7ZgnfeBM3ofEmDzwWnZ9nsrKwL58gVku8zD78KxXAUBh38rwbonR3hUnWHA8ONDJS6Uty2fdVQi1l4EPh26aalLhiFbEqk0atD96baU6x+7uk78qpafENpDeknnoQ3G6/Jg3j9GqHpzbiZN9iK+bAVfzKu1oPON4flM2PwZOT5aAOo=; 31:grnGL8NegN7BvhZhy3Wqn2nQpjNMPNWfd3rtaXc7JlhgYqz6y16mcjncz5nTqF0tynURNFOPcjIBL+Fly3kbkHhsmREAI5EqKwFlDFzdvAHnUrHpMvWwWRCbCCFODJHIbj2KB9rWhS9hB508CLaljTNo2KJfI4aIz29XqKsbQaN1xSa5QoqBN4MybtJJAI0o/FYu+pmCAuUX7fAPnYoH80Gx5XsIkA/+BppilhRHzcw= X-MS-TrafficTypeDiagnostic: VI1PR05MB3150: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 20:w+VwxFaGFpUmWOmMgi6fBsAauuEYnT8BYfnRKq48NCQZWnRhCPcq6qvIKbAukCLG4+Glhkto79dh7gWqXKarAeXZDMEjZc5DFYApLzKk5GDIdzV1ij5s3eqPQkb+XlGZ8x6pH5FocCYImksxoXjOdFXqS9k5b4gpd8zPeJOaibpdZ7bszBvkPfONWtVzcN3Y2DFKxqr9EkogCft3Px0L6i6qtpNX09k7JXnlYyK2D12UKqhdoZy99mQdakuYxKmhui6fXGQCbO7kFFNLycqZHgc3iJYhj6fISGHJ8EwhgtD29WKMWjQdINwdAm584Mt+BK1rdZpj7jldLbrDypoUqTvYV1qB1HEHr7ajU2rViwpTdfLLmjC+auZuxn0hXnGURwnQzY+R5+5jhNhGK2sXPLR6X5Y1rYdc7vZBIywf5C636bp1wwMShIEEjGkeZPiUKy3zbY5JkYgI6H1XNHEKUXK8JgUQvdXlpLh0TNQZcVA8uS6ls4qku2dJ+9c7Gmq0; 4:9KQ9VfWFXKZlNDrssaVGd874X9CPoJ2QXRowmwehgsJgyRUr6bd8HqloLz6U9RKgI8aEEjr4jO8WO6Vyl+V+zGfgP2aluB16/6iB4yvMfYuG1angJFGeCRbpdeX93dBQGaloG45mk1b5qCG6SzoGRrTX6Xd4JAVDSIcP1KwcTig6AoI8TohFjR8cwU/jFu456WvX7lNlxEL8njmKY11CMgYujwRUmuXq1r/MKVhKjNNgMEritjH9l3cK7SJZBqSfHTyC2HMZNopd4wUiDKR0KQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231023)(6055026)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:VI1PR05MB3150; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3150; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(346002)(376002)(199004)(189003)(55016002)(81166006)(106356001)(7736002)(81156014)(47776003)(8676002)(305945005)(105586002)(66066001)(36756003)(4326008)(118296001)(53936002)(16586007)(50466002)(48376002)(7696005)(33026002)(69596002)(52116002)(51416003)(478600001)(5660300001)(16526018)(97736004)(21086003)(316002)(6116002)(76176011)(3846002)(50226002)(6666003)(2906002)(2950100002)(575784001)(8936002)(86362001)(59450400001)(68736007)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3150; 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; VI1PR05MB3150; 23:cL6pVJcx8dQDouJHpN6Xn9vUZV90bQYhU4eJ6u9ck?= =?us-ascii?Q?7lHtuIj3Zx49Jr7KwKWaG0tIV9Xp7ACPyHQa08hmQvleRJpziiq5hh0U6+L5?= =?us-ascii?Q?K45OwVlc+ghzwcqY/XiWstRGaYoZrcuk24HoMH4DEwl0hmYieq1tUg6eHH1R?= =?us-ascii?Q?AD7q+qfJ14om0dFWlvls+44ZW1c0wc5vgiaGUHdrJumwvK2Qz5sgl0sHJMwf?= =?us-ascii?Q?XB3gISp3SgBaLM+lJFAWp0itUGCmjT653S/5Rz3IMcpMXevp6oVS+JxogFux?= =?us-ascii?Q?Xk55uye3x8RKbkn6drStef/73MlxHp+YAx4iv0PtaXGj5WURnYy8n/HFuSUj?= =?us-ascii?Q?Kmv5LW8Qj9qEiEHXVyYu2pnFrt3zhhJkVbewZyW5Uf1sWSMm3ZoD7htiKiBn?= =?us-ascii?Q?aZ8xatuq67uDg4Jl/GNHy7yrtjeENyzz64XMY2zZGD1/A8pvxLb5wVIx9NRv?= =?us-asc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688VZEYU37prLH+6mbUSMd1VUbo2/ZVSNBeCgnmfB5pfy1eZYWetYX/2XhYXcNk0G5Wu+KMdoP2ZbKpcC4V7a20PsRtaDC4d+m05DRD27OWFiO+9+AiibaM9r0h1WUgRgRtr75KOs8GxO/gQ+AuZlMkdE92VNd9/IG/drU=; 5:0Zz1VYEkbKG/32qZ/oLWfyVttfB+7OJdkaP/RH9qr13ElFJNtnsUmn65rLjYgVNQ8DCOxBQQvye3U47cbf7f4OlWQ7c/rxFW8PmhsTypl+02Au0q+TMOYCUqXyi12qvuj2SruIBNB8bGU59EepWeDGmzp+38B2fj6097/GSoNl4=; 24:7u57F5RX8oIoPvF8YLuVafCe84NBAeznDClNGs1HjsYx5er1CtD7hF/uOAPSYeTVkMk0vIzblV96nyMPaR3dVb8leBZSqFwV+EjKpraRrNE=; 7:qz3J1Luc+4GFVyoAjT2CYFpUEie6mHrOZRvNMd1tubwCyOkkArwLd26g9qm9Nt76cPwdraBkC8I+qe8xQ6xZ2vPsw4Sy8aBzJe/zwZxfw1Zu9ociBI0uVZomz/dHv7inRkolYxBNFcDz8DMpqGktlWsKY7RmXP0FvFppQ8fb7BzcMFXhQu27vhHRjuxaCCK8cHnzZIjU5ZPHDC2jAdr4UquQYyY8gaJGQnitRrlvqnW4vN/Wzqz2QMgWu8m8DLzJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:53:40.3953 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9a78eeb9-f770-4501-1535-08d5415f5ec1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3150 Subject: [dpdk-dev] [PATCH v2 07/10] 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: Tue, 12 Dec 2017 12:53:42 -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 263651c..5888942 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -99,7 +99,7 @@ "--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 @@ "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 @@ 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 @@ { "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 @@ 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 @@ /* 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 0087438..8065481 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 @@ static int eth_event_callback(portid_t port_id, 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 c6baa10..3e63edf 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -395,6 +395,8 @@ struct queue_stats_mappings { 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 4c0d2ce..fface6f 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. -- 1.8.3.1