From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0060.outbound.protection.outlook.com [104.47.2.60]) by dpdk.org (Postfix) with ESMTP id 356162A5D for ; Thu, 23 Nov 2017 13:08:25 +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=TR4kltH2Y9mLMRcV8qs2VpdOY/Z5MQDhEN1DyORVvoU=; b=JukyLVdMwA/sFn8bSWGUEwG0KFNU7iZFfFIuCnisRCp9gYKVQ4Ak8DnkDP7YeRHNxsYlOkVkzoOqOFvysRCAmA5gsTc8r9sqaacFtdysJeJZN1q9Us3tY/v3B217amiE/Lh1lgiuL+ifqHvxAhKnu8WOzeDvuJFwfenj1BC9ptw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by DB6PR05MB3144.eurprd05.prod.outlook.com (2603:10a6:6:1a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Thu, 23 Nov 2017 12:08:23 +0000 From: Shahaf Shuler To: jingjing.wu@intel.com Cc: dev@dpdk.org Date: Thu, 23 Nov 2017 14:08:00 +0200 Message-Id: <20171123120804.143897-2-shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171123120804.143897-1-shahafs@mellanox.com> References: <20171123120804.143897-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: AM5PR0601CA0033.eurprd06.prod.outlook.com (2603:10a6:203:68::19) To DB6PR05MB3144.eurprd05.prod.outlook.com (2603:10a6:6:1a::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d9b34cae-b469-4b52-8b68-08d5326ae546 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(5600025)(4604075)(2017052603258); SRVR:DB6PR05MB3144; X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3144; 3:heZRPienIV9gIr6BQuwnD9qP9mx8aqeYu8tFrArANBEVTX//3Kzm2bU3FPcf+HxOgL0uS+7WlrPG8OsAkAsQG/G5LVhYM3Bx5vV/q31qQrJoDR/PxK85fEjIonioGKHHOx0bmT2Et1sK9uUTno3osqj3cJRii1pBNnGikpoyAh0bXIO+prvGnh9COo5YBSAU14JcHjnxergzAfRUoJgMVOZipu1OoVzdE+aKenw3VTuNkkVGWP6XRZ2str2Bp5ML; 25:ezJ7DPBZaTDol5M2GA2s9cwTNxKXLxKHuf2/jJj4gle4zD+QPcw3NLDidXIhSf9Fk6ExGAtbS4RZpXOSGuiWJFPDSpE2aBaenNFGJbcI0ELqyYYCCB0ci5SD3h7YAIr/GPwHvs25wMbUv74buyfpCMY7nRGJ/oxEc7JcrISgi74Hrffke6VNlTk7qzn+ENxFw0SV1IlelrU/PWd4YX2tkxO3iEwE7x9f2s/Fk7CGpAQxaeIpFuGI9rpRFJ9hhoWF2EcDVOCZ9YqDzCoirjUyPRo8hPIiVtwrf41MY1z6+IscORsY3Yp7JDbKiLUC3PlduTRH2+aJDZJqi0wAvdyYw5SuqcmLJfLXdByW98KZkoI=; 31:Xc/zXRZAOuasmRVjwYQkXU3vHAEVhwL3sMxCuW+mzW5Mzfch7vZbPUXfkMOItcEpS7NJOD7HWzhV0Z2jHDQfdzmlXrkaT073T6yXYImM62tdBuX7hHb21AIGdYQBNtBb9jk2iuhOTZke1GZMJwo4CLi6dceFLnTI4fvYMl6mh32CbjLTeP57eGowa9iGzyz+uOxKi7/vP3EZVs+9wI3tWcPUghLATaVLYz4UzELwB7Q= X-MS-TrafficTypeDiagnostic: DB6PR05MB3144: X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3144; 20:4Katx4zAkhM5OFs1RtFMW0Amz3CBwhQkyDKXn/SZGWHzHQOTT79dT/50t0yy8/3v4YDG6LmrkWuIIih7oh5Ct7wgklYYZo0+4wfHEvWHwdSXJYGjJ3FpPL6p7OKypzmcRJaOdX2POO2/+1USEDDgiUvZ8+R/lSS6l8+7rGHVkVAMdznESO8SAi52GuU3euOxBwm4YoHBYSTmpUCv2YwUn9Vbhu6+oSfDf/eQ1vU6BTkaoEaiYRakwsrrFGt5is+CJqJDtr67h5ng6V8fhTAvc9j0tyWNrk5iZwYJFr5xnPifzVA1mGoOuiS8s/NNxrZRfqI3Al0/fia0breXrvjbMiWcCbfAWQnEgOnKlPeVkmGFPlEUCDwPttQ7f51ZLxUr1dEKDWHRI3ryzJcg62fSxFe7bzfMs+hLw9ObC19Qz4i/bS3IDA8ORNIXFu/tYwkuCrU4fN6lTg2JYpDWtotKOlk1RXzU0VYPDjXZRGEZWhipSqnTKVxQNW8V+0jAiIS6; 4:CHPomxkKoMDPzSngXTId0k8boqvxB9AN30fSoSOxv4aHdVOKQzoxbVwC6bgVL/dCa0/4cghOAMtJP5FKc5TxzC/KGl3cigd6YKtGjwA2eOUBhToS7ObEdHQWKCeNY9WduUT/SN7nCRdc3tFY22I8UIUD5o6rXMtbh5a9j43xABzPeOt6bC88ipQBns3c78KFSqBODk4IvOl1U2bm7aUYo+MopgJU6Vgq6tNsaLOWYDQorcAPog+1mqz4fowcCLBa0a4pXreoDVG99dg7sJZroA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3231022)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR05MB3144; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR05MB3144; X-Forefront-PRVS: 05009853EF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(366004)(376002)(199003)(189002)(6666003)(478600001)(8936002)(2361001)(50226002)(4326008)(106356001)(50986999)(76176999)(2351001)(33646002)(68736007)(5660300001)(189998001)(101416001)(36756003)(48376002)(6916009)(2950100002)(21086003)(50466002)(105586002)(16586007)(33026002)(25786009)(86362001)(575784001)(66066001)(97736004)(2906002)(316002)(53936002)(47776003)(5003940100001)(16526018)(69596002)(55016002)(1076002)(6116002)(7736002)(3846002)(52116002)(305945005)(81156014)(81166006)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR05MB3144; 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; DB6PR05MB3144; 23:D4xQaljALxCevn2MNxx4Kg3GkxEBIKIlZBtnvAYvT?= =?us-ascii?Q?FriwEypry4naaRvlDn8hMSYxJjHYXvz5ZxHmV++dyTVxwLgm3mqJiNHKzrtF?= =?us-ascii?Q?HDsCz7Qnmjqc/HWPMyu9wOKCnd0Je9YZ4KaMfRB7P3CTopYBMNmS4waE8v7m?= =?us-ascii?Q?83wI0SMZ6f4dGQ434aVsb+/zNBmWtJO8pqtSs1TfaS2u20w6firiE7t8y0e9?= =?us-ascii?Q?S+UiZINScZCtrEGBEoZSuRGQIyH1+aAUbWstWZtzYVnyYuwy2ZiXpn6RcXAb?= =?us-ascii?Q?Q0sDHtpU+G66qywOGGfJOHNeSQu0FhKQa+1grHCm6XIVsxFp9KPUh+etyvYy?= =?us-ascii?Q?apcvkIXIlZMPfwTb1rVJFB91R8c4stnU38MlRbvUSwbVeZ3bd89jVFCLKwaD?= =?us-ascii?Q?tjNaUk5nRPoQQlSiBTGVsi0j8lby/N5RSVVveiwcSI4HjX2u/KYfVFw8zuNB?= =?us-ascii?Q?yL5MKkvBngSSc0OKXgHi6sN1XKtZ37yVRrlw6hpxTAGnm0kFyGHZSk5/G2/3?= =?us-ascii?Q?9LmfT3YZkYiKrkb68/YU8xzZyquFEYEcQ4Q4M5Yk1aKSTWL0UKlNtJU/u96j?= =?us-ascii?Q?WWyjG6fgcbM2dL21PaH8rs9Yb5qCXyFNfxHOgqMPTTPOQZaUknD9aXNbuiTQ?= =?us-ascii?Q?UpNgHj8IgStrpeaYmZw/bb4mljlVQCU6lz0T/f/Hq8BV3FA1d/irbLTjiRxm?= =?us-ascii?Q?yNv/XJaqGgbgrpkb1cyB9IF0mN8w4iUSqG195b3hTSvQisheSlAudohdhMGe?= =?us-ascii?Q?Jaxpqfa03Q32BsxAaEt0OtTxgIYsXttfZXWbR5wPaM8c/MbXqkdPxLQW8fmy?= =?us-ascii?Q?pJ5vyiFVC4oZjsWU5kRmdpG67xFFqr91KpTJjrSvRsH8IXZtCbHlDIhkUE3o?= =?us-ascii?Q?pndadbjXGioqhu7jrHnV17Nmr13JVTydSEFBngp24DAurbEPeVMnQcg6YUyE?= =?us-ascii?Q?FzMlGp5V5wtLsf3ALvuFuv1b06Tysk5Es92wLl4E0jrHkbXNW4gIdq1ymzyO?= =?us-ascii?Q?lpqZOJCbgiLDz3Bh28eoyQEXHcK7MV5KnCgTnrofpEuQCFtPtlKJylZblG+B?= =?us-ascii?Q?6ZEy6pd9M3ziEGhD5Vmx150mw6mCQL+0M2xWWssZbDXKzy9LxRC/f0vga/vm?= =?us-ascii?Q?lWnh77kTejS3WPEU4mdoa6UeIciU/wGLZNgDyIoqJfSNbKIAGXNs7Nojdy1o?= =?us-ascii?Q?z53jjy/6ozSQFh2qKhkfrNNj3vzIbAJwxyQQcq4vqzvw70TK0kAELGpIw=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3144; 6:ZoNVhp8g9CyR1zsKmDOAJUlcdUpVyB6MPAZZNK30fVHLigWJLla7OimsF3Q7Kx9HSsM4AStZpsin9ihnVzHdsuWgun9mBNcNd+QekqfuyVFhoVbk8TA+c9Ro4Z6WVKzvqhzNem5mwwlo8k6ctuY9RWI6XALKtUXE/Y4m4QAVQ/VC/JgD1TYGrFePWduQcBTln/rcHUIBGFn88YVJmd9B+IohUaKM3CstH9V57lptEAE+9GL1RTF6iT8DuwW/Q4qZbbeX+ueUQJLw0Z5K3Pz4U09E/qJmhcveYkFpXZhtbGWdI8kj2BoMogAlQ89OmsxTq5h92UBwv3BKAYnyiDPLYd7oRXrS6uYZBW0ndrB4s0k=; 5:yA+NnOYhDYipDJyjYeKJ2oxnl7cYBsEGgUxg7yZTKdZTnsIDa4bbXMPJQHciQojaq1Vd2Aam3e/CFsWtWkKId4yRezi0RTmWWE6cM80eXnloxncsIM4hyTipw82S9Jzo92gVGunXgpyj3njZ+XmwY8gS/FEwXHDxVZ9SF7l/akI=; 24:nU+WHpAQmQ2QMkfCDptQakLQATIq9TcvOCu35jk+k+SiCiVprShzJuTWbJEFYh1c24P7h9zGpaKEv7F491XbwSOsdZTen+CS8h9l00U/XEI=; 7:T6PjLGStQJ98cBFuMvK6hNUqOgP2O6DsG7tF7b0+FIS725HNLUAAJ1ZUR84Se8jbi0MkBzH1Rt1QAGRIpFX64Yz7u80/9tkE8sm81hRqLvl191zHu6PY+TeT+xqZJJaZxvqAs2mLNWUOvW0ZKwwnhG5HQM35rjKp6qFlv2U16YvQ3ft0di3txI5WtLw+TVB4y4+Xk8PvnPaTodhFuRjJ14yNcYv9DQ2lQq3t+W4nJ+We/BkTBDdYvGd9ceB6R7RP SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2017 12:08:23.2633 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d9b34cae-b469-4b52-8b68-08d5326ae546 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR05MB3144 Subject: [dpdk-dev] [PATCH 1/5] app/testpmd: convert to new Ethdev offloads API 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: Thu, 23 Nov 2017 12:08:25 -0000 Ethdev Rx/Tx offloads API has changed since: commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") Convert the application to use the new API. Signed-off-by: Shahaf Shuler --- app/test-pmd/cmdline.c | 148 +++++++++++++++++++++++++++++++++-------- app/test-pmd/config.c | 97 +++++++++++++++++++-------- app/test-pmd/parameters.c | 35 +++++----- app/test-pmd/testpmd.c | 24 +++---- 4 files changed, 219 insertions(+), 85 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index f71d96301..b0f2325c8 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1577,6 +1577,7 @@ cmd_config_max_pkt_len_parsed(void *parsed_result, __attribute__((unused)) void *data) { struct cmd_config_max_pkt_len_result *res = parsed_result; + uint64_t rx_offloads = rx_mode.offloads; if (!all_ports_stopped()) { printf("Please stop all ports first\n"); @@ -1594,14 +1595,16 @@ cmd_config_max_pkt_len_parsed(void *parsed_result, rx_mode.max_rx_pkt_len = res->value; if (res->value > ETHER_MAX_LEN) - rx_mode.jumbo_frame = 1; + rx_offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; else - rx_mode.jumbo_frame = 0; + rx_offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME; } else { printf("Unknown parameter\n"); return; } + rx_mode.offloads = rx_offloads; + init_port_config(); cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1); @@ -1703,6 +1706,7 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result, __attribute__((unused)) void *data) { struct cmd_config_rx_mode_flag *res = parsed_result; + uint64_t rx_offloads = rx_mode.offloads; if (!all_ports_stopped()) { printf("Please stop all ports first\n"); @@ -1711,48 +1715,48 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result, if (!strcmp(res->name, "crc-strip")) { if (!strcmp(res->value, "on")) - rx_mode.hw_strip_crc = 1; + rx_offloads |= DEV_RX_OFFLOAD_CRC_STRIP; else if (!strcmp(res->value, "off")) - rx_mode.hw_strip_crc = 0; + rx_offloads &= ~DEV_RX_OFFLOAD_CRC_STRIP; else { printf("Unknown parameter\n"); return; } } else if (!strcmp(res->name, "scatter")) { - if (!strcmp(res->value, "on")) - rx_mode.enable_scatter = 1; - else if (!strcmp(res->value, "off")) - rx_mode.enable_scatter = 0; - else { + if (!strcmp(res->value, "on")) { + rx_offloads |= DEV_RX_OFFLOAD_SCATTER; + } else if (!strcmp(res->value, "off")) { + rx_offloads &= ~DEV_RX_OFFLOAD_SCATTER; + } else { printf("Unknown parameter\n"); return; } } else if (!strcmp(res->name, "rx-cksum")) { if (!strcmp(res->value, "on")) - rx_mode.hw_ip_checksum = 1; + rx_offloads |= DEV_RX_OFFLOAD_CHECKSUM; else if (!strcmp(res->value, "off")) - rx_mode.hw_ip_checksum = 0; + rx_offloads &= ~DEV_RX_OFFLOAD_CHECKSUM; else { printf("Unknown parameter\n"); return; } } else if (!strcmp(res->name, "rx-timestamp")) { if (!strcmp(res->value, "on")) - rx_mode.hw_timestamp = 1; + rx_offloads |= DEV_RX_OFFLOAD_TIMESTAMP; else if (!strcmp(res->value, "off")) - rx_mode.hw_timestamp = 0; + rx_offloads &= ~DEV_RX_OFFLOAD_TIMESTAMP; else { printf("Unknown parameter\n"); return; } } else if (!strcmp(res->name, "hw-vlan")) { if (!strcmp(res->value, "on")) { - rx_mode.hw_vlan_filter = 1; - rx_mode.hw_vlan_strip = 1; + rx_offloads |= (DEV_RX_OFFLOAD_VLAN_FILTER | + DEV_RX_OFFLOAD_VLAN_STRIP); } else if (!strcmp(res->value, "off")) { - rx_mode.hw_vlan_filter = 0; - rx_mode.hw_vlan_strip = 0; + rx_offloads &= ~(DEV_RX_OFFLOAD_VLAN_FILTER | + DEV_RX_OFFLOAD_VLAN_STRIP); } else { printf("Unknown parameter\n"); @@ -1760,27 +1764,27 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result, } } else if (!strcmp(res->name, "hw-vlan-filter")) { if (!strcmp(res->value, "on")) - rx_mode.hw_vlan_filter = 1; + rx_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; else if (!strcmp(res->value, "off")) - rx_mode.hw_vlan_filter = 0; + rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER; else { printf("Unknown parameter\n"); return; } } else if (!strcmp(res->name, "hw-vlan-strip")) { if (!strcmp(res->value, "on")) - rx_mode.hw_vlan_strip = 1; + rx_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; else if (!strcmp(res->value, "off")) - rx_mode.hw_vlan_strip = 0; + rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP; else { printf("Unknown parameter\n"); return; } } else if (!strcmp(res->name, "hw-vlan-extend")) { if (!strcmp(res->value, "on")) - rx_mode.hw_vlan_extend = 1; + rx_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND; else if (!strcmp(res->value, "off")) - rx_mode.hw_vlan_extend = 0; + rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND; else { printf("Unknown parameter\n"); return; @@ -1798,6 +1802,7 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result, printf("Unknown parameter\n"); return; } + rx_mode.offloads = rx_offloads; init_port_config(); @@ -3434,7 +3439,14 @@ cmd_tx_vlan_set_parsed(void *parsed_result, { struct cmd_tx_vlan_set_result *res = parsed_result; + if (!all_ports_stopped()) { + printf("Please stop all ports first\n"); + return; + } + tx_vlan_set(res->port_id, res->vlan_id); + + cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1); } cmdline_parse_token_string_t cmd_tx_vlan_set_tx_vlan = @@ -3481,7 +3493,14 @@ cmd_tx_vlan_set_qinq_parsed(void *parsed_result, { struct cmd_tx_vlan_set_qinq_result *res = parsed_result; + if (!all_ports_stopped()) { + printf("Please stop all ports first\n"); + return; + } + tx_qinq_set(res->port_id, res->vlan_id, res->vlan_id_outer); + + cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1); } cmdline_parse_token_string_t cmd_tx_vlan_set_qinq_tx_vlan = @@ -3587,7 +3606,14 @@ cmd_tx_vlan_reset_parsed(void *parsed_result, { struct cmd_tx_vlan_reset_result *res = parsed_result; + if (!all_ports_stopped()) { + printf("Please stop all ports first\n"); + return; + } + tx_vlan_reset(res->port_id); + + cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1); } cmdline_parse_token_string_t cmd_tx_vlan_reset_tx_vlan = @@ -3680,11 +3706,16 @@ cmd_csum_parsed(void *parsed_result, struct cmd_csum_result *res = parsed_result; int hw = 0; uint16_t mask = 0; + uint64_t csum_offloads = 0; if (port_id_is_invalid(res->port_id, ENABLED_WARN)) { printf("invalid port %d\n", res->port_id); return; } + if (!all_ports_stopped()) { + printf("Please stop all ports first\n"); + return; + } if (!strcmp(res->mode, "set")) { @@ -3693,22 +3724,34 @@ cmd_csum_parsed(void *parsed_result, if (!strcmp(res->proto, "ip")) { mask = TESTPMD_TX_OFFLOAD_IP_CKSUM; + csum_offloads |= DEV_TX_OFFLOAD_IPV4_CKSUM; } else if (!strcmp(res->proto, "udp")) { mask = TESTPMD_TX_OFFLOAD_UDP_CKSUM; + csum_offloads |= DEV_TX_OFFLOAD_UDP_CKSUM; } else if (!strcmp(res->proto, "tcp")) { mask = TESTPMD_TX_OFFLOAD_TCP_CKSUM; + csum_offloads |= DEV_TX_OFFLOAD_TCP_CKSUM; } else if (!strcmp(res->proto, "sctp")) { mask = TESTPMD_TX_OFFLOAD_SCTP_CKSUM; + csum_offloads |= DEV_TX_OFFLOAD_SCTP_CKSUM; } else if (!strcmp(res->proto, "outer-ip")) { mask = TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM; + csum_offloads |= DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM; } - if (hw) + if (hw) { ports[res->port_id].tx_ol_flags |= mask; - else + ports[res->port_id].dev_conf.txmode.offloads |= + csum_offloads; + } else { ports[res->port_id].tx_ol_flags &= (~mask); + ports[res->port_id].dev_conf.txmode.offloads &= + (~csum_offloads); + } } csum_show(res->port_id); + + cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1); } cmdline_parse_token_string_t cmd_csum_csum = @@ -3832,15 +3875,24 @@ cmd_tso_set_parsed(void *parsed_result, if (port_id_is_invalid(res->port_id, ENABLED_WARN)) return; + if (!all_ports_stopped()) { + printf("Please stop all ports first\n"); + return; + } if (!strcmp(res->mode, "set")) ports[res->port_id].tso_segsz = res->tso_segsz; - if (ports[res->port_id].tso_segsz == 0) + if (ports[res->port_id].tso_segsz == 0) { + ports[res->port_id].dev_conf.txmode.offloads &= + ~DEV_TX_OFFLOAD_TCP_TSO; printf("TSO for non-tunneled packets is disabled\n"); - else + } else { + ports[res->port_id].dev_conf.txmode.offloads |= + DEV_TX_OFFLOAD_TCP_TSO; printf("TSO segment size for non-tunneled packets is %d\n", ports[res->port_id].tso_segsz); + } /* display warnings if configuration is not supported by the NIC */ rte_eth_dev_info_get(res->port_id, &dev_info); @@ -3849,6 +3901,8 @@ cmd_tso_set_parsed(void *parsed_result, printf("Warning: TSO enabled but not " "supported by port %d\n", res->port_id); } + + cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1); } cmdline_parse_token_string_t cmd_tso_set_tso = @@ -3934,13 +3988,27 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, if (port_id_is_invalid(res->port_id, ENABLED_WARN)) return; + if (!all_ports_stopped()) { + printf("Please stop all ports first\n"); + return; + } if (!strcmp(res->mode, "set")) ports[res->port_id].tunnel_tso_segsz = res->tso_segsz; - if (ports[res->port_id].tunnel_tso_segsz == 0) + if (ports[res->port_id].tunnel_tso_segsz == 0) { + ports[res->port_id].dev_conf.txmode.offloads &= + ~(DEV_TX_OFFLOAD_VXLAN_TNL_TSO | + DEV_TX_OFFLOAD_GRE_TNL_TSO | + DEV_TX_OFFLOAD_IPIP_TNL_TSO | + DEV_TX_OFFLOAD_GENEVE_TNL_TSO); printf("TSO for tunneled packets is disabled\n"); - else { + } else { + ports[res->port_id].dev_conf.txmode.offloads |= + (DEV_TX_OFFLOAD_VXLAN_TNL_TSO | + DEV_TX_OFFLOAD_GRE_TNL_TSO | + DEV_TX_OFFLOAD_IPIP_TNL_TSO | + DEV_TX_OFFLOAD_GENEVE_TNL_TSO); printf("TSO segment size for tunneled packets is %d\n", ports[res->port_id].tunnel_tso_segsz); @@ -3966,6 +4034,8 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, printf("Warning: csum set outer-ip must be set to hw " "if outer L3 is IPv4; not necessary for IPv6\n"); } + + cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1); } cmdline_parse_token_string_t cmd_tunnel_tso_set_tso = @@ -13004,11 +13074,17 @@ cmd_set_macsec_offload_on_parsed( portid_t port_id = res->port_id; int en = (strcmp(res->en_on_off, "on") == 0) ? 1 : 0; int rp = (strcmp(res->rp_on_off, "on") == 0) ? 1 : 0; + struct rte_eth_dev_info dev_info; if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + if (!all_ports_stopped()) { + printf("Please stop all ports first\n"); + return; + } ports[port_id].tx_ol_flags |= TESTPMD_TX_OFFLOAD_MACSEC; + ports[port_id].dev_conf.txmode.offloads |= DEV_TX_OFFLOAD_MACSEC_INSERT; #ifdef RTE_LIBRTE_IXGBE_PMD ret = rte_pmd_ixgbe_macsec_enable(port_id, en, rp); #endif @@ -13017,6 +13093,13 @@ cmd_set_macsec_offload_on_parsed( switch (ret) { case 0: + rte_eth_dev_info_get(port_id, &dev_info); + if ((dev_info.tx_offload_capa & + DEV_TX_OFFLOAD_MACSEC_INSERT) == 0) { + printf("Warning: macsec insert enabled but not " + "supported by port %d\n", port_id); + } + cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1); break; case -ENODEV: printf("invalid port_id %d\n", port_id); @@ -13091,14 +13174,21 @@ cmd_set_macsec_offload_off_parsed( if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + if (!all_ports_stopped()) { + printf("Please stop all ports first\n"); + return; + } ports[port_id].tx_ol_flags &= ~TESTPMD_TX_OFFLOAD_MACSEC; + ports[port_id].dev_conf.txmode.offloads &= + ~DEV_TX_OFFLOAD_MACSEC_INSERT; #ifdef RTE_LIBRTE_IXGBE_PMD ret = rte_pmd_ixgbe_macsec_disable(port_id); #endif switch (ret) { case 0: + cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1); break; case -ENODEV: printf("invalid port_id %d\n", port_id); diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index cd2ac1164..9b6ffeca9 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -540,14 +540,12 @@ port_infos_display(portid_t port_id) void port_offload_cap_display(portid_t port_id) { - struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; static const char *info_border = "************"; if (port_id_is_invalid(port_id, ENABLED_WARN)) return; - dev = &rte_eth_devices[port_id]; rte_eth_dev_info_get(port_id, &dev_info); printf("\n%s Port %d supported offload features: %s\n", @@ -555,7 +553,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_VLAN_STRIP) { printf("VLAN stripped: "); - if (dev->data->dev_conf.rxmode.hw_vlan_strip) + if (ports[port_id].dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_VLAN_STRIP) printf("on\n"); else printf("off\n"); @@ -563,7 +562,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_QINQ_STRIP) { printf("Double VLANs stripped: "); - if (dev->data->dev_conf.rxmode.hw_vlan_extend) + if (ports[port_id].dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_VLAN_EXTEND) printf("on\n"); else printf("off\n"); @@ -571,7 +571,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_IPV4_CKSUM) { printf("RX IPv4 checksum: "); - if (dev->data->dev_conf.rxmode.hw_ip_checksum) + if (ports[port_id].dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_IPV4_CKSUM) printf("on\n"); else printf("off\n"); @@ -579,7 +580,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_UDP_CKSUM) { printf("RX UDP checksum: "); - if (dev->data->dev_conf.rxmode.hw_ip_checksum) + if (ports[port_id].dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_UDP_CKSUM) printf("on\n"); else printf("off\n"); @@ -587,18 +589,26 @@ port_offload_cap_display(portid_t port_id) if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_CKSUM) { printf("RX TCP checksum: "); - if (dev->data->dev_conf.rxmode.hw_ip_checksum) + if (ports[port_id].dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_TCP_CKSUM) printf("on\n"); else printf("off\n"); } - if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM) - printf("RX Outer IPv4 checksum: on"); + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM) { + printf("RX Outer IPv4 checksum: "); + if (ports[port_id].dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM) + printf("on\n"); + else + printf("off\n"); + } if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) { printf("Large receive offload: "); - if (dev->data->dev_conf.rxmode.enable_lro) + if (ports[port_id].dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_TCP_LRO) printf("on\n"); else printf("off\n"); @@ -606,8 +616,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VLAN_INSERT) { printf("VLAN insert: "); - if (ports[port_id].tx_ol_flags & - TESTPMD_TX_OFFLOAD_INSERT_VLAN) + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_VLAN_INSERT) printf("on\n"); else printf("off\n"); @@ -615,7 +625,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TIMESTAMP) { printf("HW timestamp: "); - if (dev->data->dev_conf.rxmode.hw_timestamp) + if (ports[port_id].dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_TIMESTAMP) printf("on\n"); else printf("off\n"); @@ -623,8 +634,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_QINQ_INSERT) { printf("Double VLANs insert: "); - if (ports[port_id].tx_ol_flags & - TESTPMD_TX_OFFLOAD_INSERT_QINQ) + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_QINQ_INSERT) printf("on\n"); else printf("off\n"); @@ -632,7 +643,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPV4_CKSUM) { printf("TX IPv4 checksum: "); - if (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_IP_CKSUM) + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_IPV4_CKSUM) printf("on\n"); else printf("off\n"); @@ -640,7 +652,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_UDP_CKSUM) { printf("TX UDP checksum: "); - if (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_UDP_CKSUM) + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_UDP_CKSUM) printf("on\n"); else printf("off\n"); @@ -648,7 +661,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_CKSUM) { printf("TX TCP checksum: "); - if (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_TCP_CKSUM) + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_TCP_CKSUM) printf("on\n"); else printf("off\n"); @@ -656,7 +670,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_SCTP_CKSUM) { printf("TX SCTP checksum: "); - if (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_SCTP_CKSUM) + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_SCTP_CKSUM) printf("on\n"); else printf("off\n"); @@ -664,8 +679,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) { printf("TX Outer IPv4 checksum: "); - if (ports[port_id].tx_ol_flags & - TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) printf("on\n"); else printf("off\n"); @@ -673,7 +688,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) { printf("TX TCP segmentation: "); - if (ports[port_id].tso_segsz != 0) + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_TCP_TSO) printf("on\n"); else printf("off\n"); @@ -681,7 +697,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_UDP_TSO) { printf("TX UDP segmentation: "); - if (ports[port_id].tso_segsz != 0) + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_UDP_TSO) printf("on\n"); else printf("off\n"); @@ -689,7 +706,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VXLAN_TNL_TSO) { printf("TSO for VXLAN tunnel packet: "); - if (ports[port_id].tunnel_tso_segsz) + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_VXLAN_TNL_TSO) printf("on\n"); else printf("off\n"); @@ -697,7 +715,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_GRE_TNL_TSO) { printf("TSO for GRE tunnel packet: "); - if (ports[port_id].tunnel_tso_segsz) + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_GRE_TNL_TSO) printf("on\n"); else printf("off\n"); @@ -705,7 +724,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPIP_TNL_TSO) { printf("TSO for IPIP tunnel packet: "); - if (ports[port_id].tunnel_tso_segsz) + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_IPIP_TNL_TSO) printf("on\n"); else printf("off\n"); @@ -713,7 +733,8 @@ port_offload_cap_display(portid_t port_id) if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_GENEVE_TNL_TSO) { printf("TSO for GENEVE tunnel packet: "); - if (ports[port_id].tunnel_tso_segsz) + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_GENEVE_TNL_TSO) printf("on\n"); else printf("off\n"); @@ -1658,7 +1679,8 @@ rxtx_config_display(void) printf(" %s packet forwarding%s - CRC stripping %s - " "packets/burst=%d\n", cur_fwd_eng->fwd_mode_name, retry_enabled == 0 ? "" : " with retry", - rx_mode.hw_strip_crc ? "enabled" : "disabled", + (ports[0].dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_CRC_STRIP) ? + "enabled" : "disabled", nb_pkt_per_burst); if (cur_fwd_eng == &tx_only_engine || cur_fwd_eng == &flow_gen_engine) @@ -2758,6 +2780,8 @@ void tx_vlan_set(portid_t port_id, uint16_t vlan_id) { int vlan_offload; + struct rte_eth_dev_info dev_info; + if (port_id_is_invalid(port_id, ENABLED_WARN)) return; if (vlan_id_is_invalid(vlan_id)) @@ -2771,13 +2795,21 @@ tx_vlan_set(portid_t port_id, uint16_t vlan_id) tx_vlan_reset(port_id); ports[port_id].tx_ol_flags |= TESTPMD_TX_OFFLOAD_INSERT_VLAN; + ports[port_id].dev_conf.txmode.offloads |= DEV_TX_OFFLOAD_VLAN_INSERT; ports[port_id].tx_vlan_id = vlan_id; + rte_eth_dev_info_get(port_id, &dev_info); + if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VLAN_INSERT) == 0) { + printf("Warning: vlan insert enabled but not " + "supported by port %d\n", port_id); + } } void tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer) { int vlan_offload; + struct rte_eth_dev_info dev_info; + if (port_id_is_invalid(port_id, ENABLED_WARN)) return; if (vlan_id_is_invalid(vlan_id)) @@ -2793,8 +2825,14 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer) tx_vlan_reset(port_id); ports[port_id].tx_ol_flags |= TESTPMD_TX_OFFLOAD_INSERT_QINQ; + ports[port_id].dev_conf.txmode.offloads |= DEV_TX_OFFLOAD_QINQ_INSERT; ports[port_id].tx_vlan_id = vlan_id; ports[port_id].tx_vlan_id_outer = vlan_id_outer; + rte_eth_dev_info_get(port_id, &dev_info); + if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_QINQ_INSERT) == 0) { + printf("Warning: qinq insert enabled but not " + "supported by port %d\n", port_id); + } } void @@ -2804,6 +2842,9 @@ tx_vlan_reset(portid_t port_id) return; ports[port_id].tx_ol_flags &= ~(TESTPMD_TX_OFFLOAD_INSERT_VLAN | TESTPMD_TX_OFFLOAD_INSERT_QINQ); + ports[port_id].dev_conf.txmode.offloads &= + ~(DEV_TX_OFFLOAD_VLAN_INSERT | + DEV_TX_OFFLOAD_QINQ_INSERT); ports[port_id].tx_vlan_id = 0; ports[port_id].tx_vlan_id_outer = 0; } diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 84e7a63ef..0ba73cad5 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -566,6 +566,8 @@ launch_args_parse(int argc, char** argv) char **argvopt; int opt_idx; enum { TX, RX }; + /* Default Rx offloads for all ports. */ + uint64_t rx_offloads = rx_mode.offloads; static struct option lgopts[] = { { "help", 0, 0, 0 }, @@ -804,7 +806,8 @@ launch_args_parse(int argc, char** argv) if (n >= ETHER_MIN_LEN) { rx_mode.max_rx_pkt_len = (uint32_t) n; if (n > ETHER_MAX_LEN) - rx_mode.jumbo_frame = 1; + rx_offloads |= + DEV_RX_OFFLOAD_JUMBO_FRAME; } else rte_exit(EXIT_FAILURE, "Invalid max-pkt-len=%d - should be > %d\n", @@ -897,34 +900,31 @@ launch_args_parse(int argc, char** argv) } #endif if (!strcmp(lgopts[opt_idx].name, "disable-crc-strip")) - rx_mode.hw_strip_crc = 0; + rx_offloads &= ~DEV_RX_OFFLOAD_CRC_STRIP; if (!strcmp(lgopts[opt_idx].name, "enable-lro")) - rx_mode.enable_lro = 1; - if (!strcmp(lgopts[opt_idx].name, "enable-scatter")) - rx_mode.enable_scatter = 1; + rx_offloads |= DEV_RX_OFFLOAD_TCP_LRO; + if (!strcmp(lgopts[opt_idx].name, "enable-scatter")) { + rx_offloads |= DEV_RX_OFFLOAD_SCATTER; + } if (!strcmp(lgopts[opt_idx].name, "enable-rx-cksum")) - rx_mode.hw_ip_checksum = 1; + rx_offloads |= DEV_RX_OFFLOAD_CHECKSUM; if (!strcmp(lgopts[opt_idx].name, "enable-rx-timestamp")) - rx_mode.hw_timestamp = 1; - - if (!strcmp(lgopts[opt_idx].name, "disable-hw-vlan")) { - rx_mode.hw_vlan_filter = 0; - rx_mode.hw_vlan_strip = 0; - rx_mode.hw_vlan_extend = 0; - } + rx_offloads |= DEV_RX_OFFLOAD_TIMESTAMP; + if (!strcmp(lgopts[opt_idx].name, "disable-hw-vlan")) + rx_offloads &= ~DEV_RX_OFFLOAD_VLAN; if (!strcmp(lgopts[opt_idx].name, "disable-hw-vlan-filter")) - rx_mode.hw_vlan_filter = 0; + rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER; if (!strcmp(lgopts[opt_idx].name, "disable-hw-vlan-strip")) - rx_mode.hw_vlan_strip = 0; + rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP; if (!strcmp(lgopts[opt_idx].name, "disable-hw-vlan-extend")) - rx_mode.hw_vlan_extend = 0; + rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND; if (!strcmp(lgopts[opt_idx].name, "enable-drop-en")) rx_drop_en = 1; @@ -1140,4 +1140,7 @@ launch_args_parse(int argc, char** argv) break; } } + + /* Set offload configuration from command line parameters. */ + rx_mode.offloads = rx_offloads; } diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index c3ab44849..e3a7c26b8 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -338,15 +338,10 @@ lcoreid_t latencystats_lcore_id = -1; */ struct rte_eth_rxmode rx_mode = { .max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame length. */ - .split_hdr_size = 0, - .header_split = 0, /**< Header Split disabled. */ - .hw_ip_checksum = 0, /**< IP checksum offload disabled. */ - .hw_vlan_filter = 1, /**< VLAN filtering enabled. */ - .hw_vlan_strip = 1, /**< VLAN strip enabled. */ - .hw_vlan_extend = 0, /**< Extended VLAN disabled. */ - .jumbo_frame = 0, /**< Jumbo Frame Support disabled. */ - .hw_strip_crc = 1, /**< CRC stripping by hardware enabled. */ - .hw_timestamp = 0, /**< HW timestamp enabled. */ + .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER | + DEV_RX_OFFLOAD_VLAN_STRIP | + DEV_RX_OFFLOAD_CRC_STRIP), + .ignore_offload_bitfield = 1, /**< Use rte_eth_rxq_conf offloads API */ }; struct rte_fdir_conf fdir_conf = { @@ -1495,6 +1490,10 @@ start_port(portid_t pid) } if (port->need_reconfig_queues > 0) { port->need_reconfig_queues = 0; + /* Use rte_eth_txq_conf offloads API */ + port->tx_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + /* Apply Tx offloads configuration */ + port->tx_conf.offloads = port->dev_conf.txmode.offloads; /* setup tx queues */ for (qi = 0; qi < nb_txq; qi++) { if ((numa_support) && @@ -1521,6 +1520,8 @@ start_port(portid_t pid) port->need_reconfig_queues = 1; return -1; } + /* Apply Rx offloads configuration */ + port->rx_conf.offloads = port->dev_conf.rxmode.offloads; /* setup rx queues */ for (qi = 0; qi < nb_rxq; qi++) { if ((numa_support) && @@ -1534,7 +1535,6 @@ start_port(portid_t pid) rxring_numa[pi]); return -1; } - diag = rte_eth_rx_queue_setup(pi, qi, nb_rxd,rxring_numa[pi], &(port->rx_conf),mp); @@ -2252,7 +2252,7 @@ init_port_dcb_config(portid_t pid, retval = get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs, pfc_en); if (retval < 0) return retval; - port_conf.rxmode.hw_vlan_filter = 1; + port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; /** * Write the configuration into the device. @@ -2301,7 +2301,7 @@ init_port_dcb_config(portid_t pid, rxtx_port_config(rte_port); /* VLAN filter */ - rte_port->dev_conf.rxmode.hw_vlan_filter = 1; + rte_port->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; for (i = 0; i < RTE_DIM(vlan_tags); i++) rx_vft_set(pid, vlan_tags[i], 1); -- 2.12.0