From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0040.outbound.protection.outlook.com [104.47.2.40]) by dpdk.org (Postfix) with ESMTP id BD3F21B1C4 for ; Wed, 10 Jan 2018 10:09:59 +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=o6B6qt5wTpDdI9fhvXngL3IpFpn4Z5JpmcswgBKtUuY=; b=yMMcFvNX+3SIzzOS4VlE/uMHxoptFEIwE9hmVOJBYnFbxuOklRCkGiemZHNXKuEpIANhyaboJkaq/ZCdfn87V+zeJKU0rjuUeJHpmj9eZh/aTouVBWJOkOwUs48j6vxg/+JsQdjDUTu9GKvGhEl/23knTLdzYCejdNKaUIjQwLQ= 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:09:57 +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:12 +0200 Message-Id: <58fe4a92faacd8398a87c781a30578ec730fd9b6.1515575134.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: 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: d73c06cf-d30e-45e7-3f2f-08d55809ec69 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:PYyOagGIyWl4E5dCj+UPPJCUE4OvlVww5+vh8UiDELvVBonWy9mDs/K2eaMgzNUkGYlgWaUzGMIKC4ZOxPIbORO+554MLx5Ud3ekI7Lq1i95JVlTVB3/FW/Kae03qCeQoicNUeXSyOFg1nqlxvfnMsNPS6j8r+okj42RmTOpuBOrKC0UaAegozps7glIG0n7kUncuBjEjILDgiNJp+nBveZaLgHSfXaSbWt8bKbzKHGnF3qjFEBPr2uT9V3ONly/; 25:D51qxRKHFLmQC6g27ENP+eOH57MXbw0gwU8kuU7LxnIpnfOKgEDfP30TRQZzDDRtDnuxheZ6c61yO+kPAdu3/FgSUhTWYU96jZjLIXG/Khy0h51Gb6nyPD90OToVPZz0HPJaMtjvwaiT13jt1QvrWmTJUDXESLSpVojc6B6rgs+30r1uxhHF/DMuIhsS3JCbbjWitbIDcypix3VgfwqQVwZCpOIltL54bJh27jY7v6gAFGBrhhWT6yRTDqI7HPF5zhdFKn7gpYT0zl4+NR0AKMisWsHTJCOBzgqiivsV7/HR+eZtYse4v0XZEsf2wgoAF9+MsmrRbSNujXQ9CWS6+A==; 31:rs0cJ4czHlRvByTO/1Z3jXa9gi56IBrPLOieVSu74v4GZ16SbG2JbQsfAhAS/qjBs4XZAPLgYI2VHATr0XrVFpQHLJN19Drmsz0SaARldYCh29GgzW/hoNgKcHU/3pkqxtwUbC3Cdt2q9XCxKjAqSPKwQUcXvMsMGQr/bPYvaKj5BiBmVwe5SWwLAl6IVgX/npOxdWjnznTd9TCjypbqpU1XHTIDADk7v5NEESTS4BA= X-MS-TrafficTypeDiagnostic: AM4PR05MB3137: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3137; 20:d+uHB+iV9BXLdHBrZrpQjXf3k63kheMor0McqKs/M+FQU9XfgxoW+NrguMAAKoKgmDhPI7obgfHD1UYME0FE5YrL2V6mlS1qvTfacgqgV9T16pkFXMPmIJ3FGRjuFfP5Oe4PExC6567gPQKZvxKQAd3uIjcusA8S70mGNSQPCRf38mxHvDg05u+MbEj30SI6BuGcXK+9KayWTnW1joAJS17t88/HbQVgTV7981MEqvGVZYTMAjpyV5vYRzhxhUCnP3adbMGXR3f8scIy0zgiRbOwVrBlM+GEiEAyomPNQvO23d5ttcH/Dz+dCSyWJC5M6wvZ32dIs/bNo0XqraxBIPcKBP/N7lyEfOaUph7yQvq6rU5PVqmxot3zaAl1WSa6j5+5JuuJ9EvQERBRVDkiOLu99KCvZ5ZDc+KT9c61xeG7XZ/bJYztckb3AgncFWJoz5OgNfqOoU/2lg8l/CqA8no01l04n/p9WbN7nd2MK5+Hu6rkg/n8ZCOEwXHYaGSA; 4:4Prpj/dvtLROstrgK5vFz/GZ2rw3/YUPK8/qrIPP11huGt9NoQuui2b92vI77z14oxg3rTYNI4aLaxMUwT06ePQefWND1Nd7QPTcbvmJXEwJf0WT+dssH21GvfOR05S8YaDT799QjHkcyiDTqOClvWOvWXTGILqLi1YgFaFYA2u1rMHY7C4gK1G8tiofclnlcamN5ywiTV+HTIMZ23ZS3bnuLMoKq2YaIcjgTgGzw7z4qot0/W6nM64NgOyAFEGWbt6OC0T/9lDuCzMw65dxtpJm+418M16iKATk99GHYQh62/9l7zwpDacpAjHyHlbr X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); 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)(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:YiZsLMJe9+dcsKHIhYsWkQ+iAXt4tFRTN0P1AfDW1?= =?us-ascii?Q?pTmunskSTMXqLPQgZRaukKOEZXmYnucqTmeKIXtOAhTZhyxO7URkAqu02lJE?= =?us-ascii?Q?Ny0Y9xbNaeRJcjAdKxZsRex5WHK6tpnvESVV7HGkikaHT5RaN48TIHec8pLo?= =?us-ascii?Q?r5CToRPohBdvy7x9o0UJ5Xasq5lVgPZBtL1c8AQHmSku5PYnRNwNKjcJYaS3?= =?us-ascii?Q?jumJ6yfLWd0edrwtqMDHRPMtUYsD56tGv+gkqPvje/iz+qojq1e/OIu+dHBh?= =?us-ascii?Q?YsMpUr6nUScnP+bumlFPWSSY5haXK8zf/92op5+PpK0W2CPgIaPw5dfeAsdM?= =?us-ascii?Q?wUVx7k0AGPlWIoMZ5453H4LTC++ZxZ4CixyorViuZZZdQAtCDlRcTaZG223P?= =?us-ascii?Q?6gwClh4p9lEnwrnZFhrva8EaaIV6ARGKsvP3o7EDAV0imAdVgFs8Ps42SeME?= =?us-ascii?Q?i1qGQDBs8m14jZ0EYFs7tlH2AesR0sThCEP9qAoBtEY+lHKFveeFpIv7aTfL?= =?us-ascii?Q?NSKqP0qmvojjsPK9QL/P0k/7hCIoJgr8Q4iw1vIWCzaobdulWfG5dzSRL4H9?= =?us-ascii?Q?5WBdpbp5Bj3r8R/oXdWgF9OTVoeHRXt5iZHTwQuFaUFAvurK38F9l2Qo11pW?= =?us-ascii?Q?ROVDMH9m0T68mmiIV7hd4WVlA+q5BUovGe+vo1n/PXVmcFzw1fo6dqyDawpe?= =?us-ascii?Q?Shuf/Ae8snTUkDPZrAYOe+duulIYo9bSpnMOKsAXQilVjZb/0fxM4H+4Lhov?= =?us-ascii?Q?GQU8XzPMSCS/GIOAW0S4dvZg7sq1MEO1UJWF0W/C/A6KIGTlGp+ZicmNL45g?= =?us-ascii?Q?jXkP08tv21Xulut8WCUyR5NMwbegk7XJMpF3OsGliHSf852mPbqLMAivvIYk?= =?us-ascii?Q?2XsiXy/PdLdMzUTyQo418HTSf0R5ZqWvrJHMvWuwc92SR7I1oRxN5AvVjtw6?= =?us-ascii?Q?CEW3TM14zQ9AUVV9u9H3KyIep/6Fc28vEjxMHaw8fGgpmjUPPZ0/QUkY4yRe?= =?us-ascii?Q?zZlgKOp2SVlgyRQeM7WlC9a6vypOzaYHyNIIzeXFQwUP5g9Hrk6SWrvhZb0h?= =?us-ascii?Q?75Zw3MsU3J2XtGgzcqfPTf0WMwQWWRu44OUzjn1jDOZdrYs6mGUU/lyq5tLn?= =?us-ascii?Q?guQEha2yoIJbYc/1iGpWXqbupNbDz3g?= X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3137; 6:c2VnN+V+gSJe9MtpuipmHvKitd0NKqMxABH/4L6qXFTIwjdjxjhwx+YmiwsnbT5Ve1eJ2owKWw7msXMdDVSwDo/JpzWj/49czYFpD7FTF5XQk63hqIH2adtkl7dG5h8N1pPRNQ0EI0kM+6U2QTFKCjkR5dcHLZfr4TvvxaGfUVAdB0dwfVTcG4vcHUuhemF3j00O/Hqe1NaiEndBnT0M4Ow6Oa6Ngm+Q0mFEV52ZhHtNfkcmec7rG7RxeGQyRXR0+n/T68SRubieF5sVth2nVGSxB0tJ3JfkLd6yUiR4CYU8F7OkGMJyzTr3tXsUQOzRwl4fhz6xdwxt+u/djsLtiH3fARTsmS+Pgv3AeCjW0Jg=; 5:l+NzX+/Nw/mDq/PtyC0fuqRiFVIrdjNTcf3u3ImhuRdzfo9/Z6JAwM26KsQlbH39khL+vA7WBPTVwY0c53thJZXBg+UqWhxT1n1JXl3g4OWSmj+aIhGoQMYd8dfcei4ggQJG2PBCQBmoDq/oTwuRlQJlX3amZ1fZhK/pGKw/Wkw=; 24:ku62sdx6yD6UnV2f0VsslmNYtkQSuhlqG20RsvIgVBHVMripteCNDAH7XmUZzcbP817aqXxtQs0m3bPJSainNe+9euUONpMuTlzfMCKvxVs=; 7:YXlD/WvzKVjBUbBhxCEfyPwXlnLGnL1Fn5jPZPJqo1kFyAOoPp+TIOfBQA1KNZLUO3CkoqAbBjTuo8euSFVfcT3B43vIpic3NHtMIaZMiBiDjIX1ppX5XbLDC2pCJNygiEgD8JMJJ/CU0QaONcfFdO5WShlDUtJynQRoRCquwIiHSRaFwFkmN5MtnSPa99vceZ/Qqi3lCz3Nq9G3vYcUz00zu1uHxfkKFRKezKCaP0eDG2bD3WczVyvvYklPqpqN SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 09:09:57.9719 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d73c06cf-d30e-45e7-3f2f-08d55809ec69 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 04/11] app/testpmd: convert to new Ethdev Tx 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: Wed, 10 Jan 2018 09:10:00 -0000 Ethdev Tx offloads API has changed since: commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") Convert the application to use the new API. This patch mandates the port to be stopped when configure the Tx offloads. This is because the PMD must be aware to the offloads changes on the device and queue configuration. Signed-off-by: Shahaf Shuler Acked-by: Wenzhuo Lu --- app/test-pmd/cmdline.c | 90 ++++++++++++++++++++++++++++++++++++++++++--- app/test-pmd/config.c | 55 ++++++++++++++++++--------- app/test-pmd/testpmd.c | 3 ++ 3 files changed, 124 insertions(+), 24 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index d8c73a9b1..58125839a 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -3439,7 +3439,14 @@ cmd_tx_vlan_set_parsed(void *parsed_result, { struct cmd_tx_vlan_set_result *res = parsed_result; + if (!port_is_stopped(res->port_id)) { + printf("Please stop port %d first\n", res->port_id); + return; + } + tx_vlan_set(res->port_id, res->vlan_id); + + cmd_reconfig_device_queue(res->port_id, 1, 1); } cmdline_parse_token_string_t cmd_tx_vlan_set_tx_vlan = @@ -3486,7 +3493,14 @@ cmd_tx_vlan_set_qinq_parsed(void *parsed_result, { struct cmd_tx_vlan_set_qinq_result *res = parsed_result; + if (!port_is_stopped(res->port_id)) { + printf("Please stop port %d first\n", res->port_id); + return; + } + tx_qinq_set(res->port_id, res->vlan_id, res->vlan_id_outer); + + cmd_reconfig_device_queue(res->port_id, 1, 1); } cmdline_parse_token_string_t cmd_tx_vlan_set_qinq_tx_vlan = @@ -3592,7 +3606,14 @@ cmd_tx_vlan_reset_parsed(void *parsed_result, { struct cmd_tx_vlan_reset_result *res = parsed_result; + if (!port_is_stopped(res->port_id)) { + printf("Please stop port %d first\n", res->port_id); + return; + } + tx_vlan_reset(res->port_id); + + cmd_reconfig_device_queue(res->port_id, 1, 1); } cmdline_parse_token_string_t cmd_tx_vlan_reset_tx_vlan = @@ -3685,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 (!port_is_stopped(res->port_id)) { + printf("Please stop port %d first\n", res->port_id); + return; + } if (!strcmp(res->mode, "set")) { @@ -3698,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(res->port_id, 1, 1); } cmdline_parse_token_string_t cmd_csum_csum = @@ -3837,15 +3875,24 @@ cmd_tso_set_parsed(void *parsed_result, if (port_id_is_invalid(res->port_id, ENABLED_WARN)) return; + if (!port_is_stopped(res->port_id)) { + printf("Please stop port %d first\n", res->port_id); + 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); @@ -3854,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(res->port_id, 1, 1); } cmdline_parse_token_string_t cmd_tso_set_tso = @@ -3939,13 +3988,27 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, if (port_id_is_invalid(res->port_id, ENABLED_WARN)) return; + if (!port_is_stopped(res->port_id)) { + printf("Please stop port %d first\n", res->port_id); + 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); @@ -3971,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(res->port_id, 1, 1); } cmdline_parse_token_string_t cmd_tunnel_tso_set_tso = @@ -13012,8 +13077,13 @@ cmd_set_macsec_offload_on_parsed( if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + if (!port_is_stopped(port_id)) { + printf("Please stop port %d first\n", port_id); + 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 @@ -13022,6 +13092,7 @@ cmd_set_macsec_offload_on_parsed( switch (ret) { case 0: + cmd_reconfig_device_queue(port_id, 1, 1); break; case -ENODEV: printf("invalid port_id %d\n", port_id); @@ -13096,14 +13167,21 @@ cmd_set_macsec_offload_off_parsed( if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + if (!port_is_stopped(port_id)) { + printf("Please stop port %d first\n", port_id); + 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(port_id, 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 3bc99be76..d0056fa69 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -616,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"); @@ -634,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"); @@ -643,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"); @@ -651,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"); @@ -659,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"); @@ -667,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"); @@ -675,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"); @@ -684,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"); @@ -692,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"); @@ -700,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"); @@ -708,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"); @@ -716,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"); @@ -724,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"); @@ -1704,8 +1714,10 @@ rxtx_config_display(void) tx_conf->tx_thresh.pthresh, tx_conf->tx_thresh.hthresh, tx_conf->tx_thresh.wthresh); - printf(" TX RS bit threshold=%d - TXQ flags=0x%"PRIx32"\n", - tx_conf->tx_rs_thresh, tx_conf->txq_flags); + printf(" TX RS bit threshold=%d - TXQ flags=0x%"PRIx32"" + " - TXQ offloads=0x%"PRIx64"\n", + tx_conf->tx_rs_thresh, tx_conf->txq_flags, + tx_conf->offloads); } } @@ -2783,6 +2795,7 @@ void tx_vlan_set(portid_t port_id, uint16_t vlan_id) { int vlan_offload; + if (port_id_is_invalid(port_id, ENABLED_WARN)) return; if (vlan_id_is_invalid(vlan_id)) @@ -2796,6 +2809,7 @@ 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; } @@ -2803,6 +2817,7 @@ void tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer) { int vlan_offload; + if (port_id_is_invalid(port_id, ENABLED_WARN)) return; if (vlan_id_is_invalid(vlan_id)) @@ -2818,6 +2833,7 @@ 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; } @@ -2829,6 +2845,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/testpmd.c b/app/test-pmd/testpmd.c index 77154ef3b..0087438bc 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1498,6 +1498,9 @@ start_port(portid_t pid) } if (port->need_reconfig_queues > 0) { port->need_reconfig_queues = 0; + 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) && -- 2.12.0