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 179AC7D52 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=zCIBf2qMQufYICu68Z5aO8o7cqJN+3bqvVezqRwWZkw=; b=HkG/TvO3zGYLD+2Eq89cUrKSjNiM8wyTzsVmtT3iqU3r0sV/krqiwDAVYSRXBdjzotsR2ZhpWwF7FM8skMAf3FOMp4eoYP23WtzqF7jHbZ+aj2UuAS7DCBOJWDIOIf8DXed0FEyKPM/WdrBSF+qnW83cmER99Bd3NCaoZfCqIQw= 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:36 +0000 From: Shahaf Shuler To: ferruh.yigit@intel.com, jingjing.wu@intel.com Cc: dev@dpdk.org Date: Tue, 12 Dec 2017 14:52:48 +0200 Message-Id: <9dec91975cdd1a59e3cac99d0fd4bd8672544a4f.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: 724bbc54-d96c-45b6-04a2-08d5415f5cab 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:v43XuaILwnPQrE32xJl7/Bw3Yz+7dBSnwr3tzx4qJGUEfyWHUx8b+ZUxel2hxozt0J9kJ8n++gvZiEM9MygIpEsAQYlUyMT/K97V7+9Z78fS+j7j3wfhuH7/Nw/Ugh0aqssNHfqGP5vCJp3YsZiklEsOJkKHGCzCEvpL0yIY2bsI0hVIan5QhJ4ZOk0kvT8SXP17R6c9s7NgNwQE0zjUXt5F/JHcrf6s1XWsLH7ebor2PqhIwmW94wRlk1NmmEBX; 25:hzdcKhzp0swe06apMtLAZLt8MDHkVRF8ZnmHJu86YpGZemYyDBF/SBdR6hpkWyIBLV6RRHw61ptYZz8HDXIlthjvt0X3dTpDgYypO7e7M5K+w+F+RrAS8B/39Q6E9yQRM87+ziQ17wwLObVAj6JYc0NqHB3razbfyzY+i9hC3VHk++qm5A344A7LRiYfDDf6Ra4359UTDDWnrc6B92eG6tiQz0zPiekORb8uwWBE5tc/Ba1mUdOEqB+LKF5wYiSAkcSQDN05wFkyzf7IiHbYlc8ySIDRMUw7ZkfR4u5t7+WKLMf/U8oEpnAJ8ZHezZ5z6RzenmeTga9ItNRb6eCCTw==; 31:asbtfCSic8/0pwAqsuImfJDv9tbu8LL4QXWR7ohOFhAts1A4YiDf7JLuOkiUFfv/gcthmPVlaRKMcmHRfVaVGANvGzb7ciMRPNhfZCrls/WRd2UqcdzBcmwT+ISOqx587LFfL7Ze9tZzTFKLJq5M6VF/D9qUY3Xfdu5FEJJpOUOauaQylzPrk0JxCxpkcYv4iLsKp26ed+YSE0ZVbe1toL0ryNYWvFBLuEcgRb+N6cg= X-MS-TrafficTypeDiagnostic: VI1PR05MB3150: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 20:a6JygOGZACwe/g0odR89R/zWZS6vV9Y+j6po4vMsuGH+9uWcWP7JiMo6uI/4wEmY0cINclgcAtD0aLicMaRlBUs5iNXrKsH1P+kV7fkPpgMZMDTaHMZX5ITSOjXv6ogB2VMETBGl1EFIe21L1Bhm+6AXem5JKqnVHIu2UxGpxjfkt0ykhmm5E9oDqLRRcqXL8b4spxMrswrQL4YxsmnFMCPdTvGdAEgagDNTUOiCpCIubeK1M0elf5fqGJ0YzdzK15ePlFKGxJEBzAkdlbmT7jlKEc8PL1EN0QE4qZmuEzke6u4llMA7ikXQQmY5P/AaqJj9/1atd/XXSfDY7UOzuAdgrQxfjHUVJm44HWoEFtGoyb7nZa75Cm/hKH0xV1VNe74Ye38GPNJD0KVJGzMmXhE69M+z2kQL1Yo7hCLj7BM4E/VIKwr/jUbj+cpqhoUHbv/Zxcx1OrxMWCgPGH/06hVQjCtcWEPxfaossJvJAA4nOIheZef+sEWKOoZ4+y4A; 4:h8Cj+PALXfcWxwbdd5EsTVysL+IvI7MucWEF+FmPHZXuN4Wx5CJ0xy5HU3CvRGPlN9cj5JBrHzTmWlrqFK0SyCYFgse0USh4Kc+eUm2l/iOqkKZeP/iOFY51poAAeFZUnhs+tbTMO8XdpYA9Okxf3jMaHgTcfaRkI2EUo/sykV2c5uZDAeTCwKRIhes2bK6rXDvAYtoXauEDsWnKSfaDw2VyM2EHL6qcqTnnWdaLAbWTAQaHGPn/pnW4ky1SvbvuyLNyHWq3U3zkW5JcOMRJPg== 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)(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:ZkOmNpoeWtGys9ni2EUnuIqDbpT/BdvLk+QVuo9I3?= =?us-ascii?Q?clQFEje7I3xvfl1168Ruml/JcAljix9+Kt7bLuytHLA6Xx1oSV7+IjXDCUdq?= =?us-ascii?Q?84oAPL6bhxiEExYKGGmflSlMNYWTFQfRiNSkOncpgWeZCkSGC2tTbCGgaKXH?= =?us-ascii?Q?jMLbehf30zzN1Az8clFVMkpQ9H9r95hGoqu7S0ff+ucNa0FncMtdwxu9meTX?= =?us-ascii?Q?qIYcfRtwBoyudvnDsP9Wa+YRI05oNoGNPweP33QBeGGGR7YQDsxq3AqSQGfi?= =?us-ascii?Q?e3njHNiiELgeb+49YFJo8IJpEMAI9f/dRuDa1y7PhCcwJsh6rkHEVHrm1MRE?= =?us-ascii?Q?Wr0zlRg9tSVBcp6hXJPk0ZCqkK+eBEEZ9OIhzqG8VToNCyz7U+mvOoCsPCQW?= =?us-ascii?Q?OwAWy6xPzwmRdmFnZVugfvg2hFQymRqngWhVwWaTltGiMqsN1LEaJphozEVN?= =?us-ascii?Q?qIlJqGO4w2ler5dA+F9gstBaF3wdWY0FPnVNMO+UafxnHvUMeCcgywhvrAB7?= =?us-ascii?Q?O/P1J/eqQEnVbT7DM50LN/+cPYDIeWEUJT8234CvJjabhregfxPWxMRatj1G?= =?us-ascii?Q?imma3K5/rqBIFJl1abpEoEeAE9qjikvkQg7o0+NVCAAA4f30+1/7Y/ol20p/?= =?us-ascii?Q?ZJIDgiztTcy7YdAAjgNYVjlYQDRH1EBCiZLHPlSRDxmwANOggW7brJgXC1qp?= =?us-ascii?Q?nCB0v3aGmxDA3diIL5d44P/N8SIuR94VHqAIE6XkG0Dxq7a6Xzk95iy6PeKi?= =?us-ascii?Q?C/BJT/DlbwNV6mfLNP6q3u0IWtAQciOt6E4pfI3QeBivdYIQoyPVGQumfz/C?= =?us-ascii?Q?J+oNhzWDxBtS3tl8QD9W6ImeTzDgcZF26mlyjPfveb3so/N5gkRZxGZ3Xrzx?= =?us-ascii?Q?SFzlOGiPqHcRLnmEQjb8tiUzmjxxJRqrR2kDXI+OhcbHUslWfd/EXBcuJRB3?= =?us-ascii?Q?PYtoLel7wqu6xog258fv8ctL+8XXKl0gEucTlt58IRPUMjrJzpHamX9yOi7F?= =?us-ascii?Q?gSfeuZgcy+UNFXQnt/Bc9fu4KBQSGdAWf/fwIj04uX9gMnwLszXyDxVZMze8?= =?us-ascii?Q?nQFRxqun5hwbV0Ou7k5uMjcxBBmDmgQ4a3vZhBu6OWXirfxLg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 6:abK25B1YdGdFI0R0hrzS4t5qvvEFBf2VrioojCoPCIRTRBJAMlVKnIzd+vXwvXBCOTFLtwaMDPvKzBb2NciiC8rsbo4v/V7iJ9+zifV5demI+FqmjEvDaGt7Ji3uIwH3pJ5bhPkWzzrihR8u4G1f/+0Y9eYZTfCa21c90IeuYcYYoXsoak8IdhwH03u26ct9ZefKEt3q/7wU7ET1is/6BVri8YgTIrFQoa6OgMYlbHIiJjSWh0HkhOkQMJZ+56R58LG295h1tLChzChVNzZ9/Dvz5c/0/81Z1xQ466ywtV5RX8HPCEV1UM5XLYpm8jMUm+MhwdD9P8zWKXaPtIxx5N6k08Q4XRL/onsuFi/1HSs=; 5:9OJtalhSppfHq9ezOZ31mT3coYBMByqGoYD/vO4rS3hzEL7x8y0jdoZt/k3g60kP20LCIB1YZMAZnmsjsO9n2KFpRK1ztihLxzYcdWHT3h+0PVetr8JQC5olVJNtTjxxKX8UgdeV69YdmtpVeIgU7Tpbn4q+/DOldiLuhQEPZLE=; 24:/qVuxk5k1ThaA2ACN+8mlknFrqSHLPAmerLWm7ToXDs92Q98j7vH8rV4MXriZIvfDZsiSIZVbgVRt0Raecd8gfJmSoO1HyFMQkpvLiSxDMw=; 7:sWyD3oQdqjqI/gEpz7AeNBh1tJE+T0mtk4p1AV3UczEP3mXSq2ReLP/n9nKpjBH/TIUU+5l6rE2c/w+1kVr5nW0WLu1bLQeGRUvA+OwRcpLncjhMnRj3MvKnsgcduNPZWNRdE/04FczOL7rHD2aSZwcpmLY8IBKdbk+PVZKbNBfJPfYtMnoPPb8hkfM0TuW2IYvC7Vczwf0KsmHY8ckYMCQV2s5qmdt2X8AiGqlOQQaBHE5uO+qkIfcKZbUJixKc SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:53:36.8797 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 724bbc54-d96c-45b6-04a2-08d5415f5cab 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 04/10] 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: Tue, 12 Dec 2017 12:53:41 -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 --- 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 d8c73a9..5812583 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -3439,7 +3439,14 @@ struct cmd_tx_vlan_set_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 @@ struct cmd_tx_vlan_set_qinq_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 @@ struct cmd_tx_vlan_reset_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 @@ struct cmd_csum_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 @@ struct cmd_csum_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 @@ struct cmd_tso_set_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 @@ struct cmd_tso_set_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 @@ struct cmd_tunnel_tso_set_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 @@ struct cmd_tunnel_tso_set_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 @@ struct cmd_macsec_offload_on_result { 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 @@ struct cmd_macsec_offload_on_result { 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 @@ struct cmd_macsec_offload_off_result { 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 2fdc051..ee7d083 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -616,8 +616,8 @@ struct rss_type_info { 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 @@ struct rss_type_info { 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 @@ struct rss_type_info { 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 @@ struct rss_type_info { 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 @@ struct rss_type_info { 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 @@ struct rss_type_info { 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 @@ struct rss_type_info { 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 @@ struct rss_type_info { 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 @@ struct rss_type_info { 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 @@ struct rss_type_info { 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 @@ struct rss_type_info { 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 @@ struct rss_type_info { 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 @@ struct rss_type_info { 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"); @@ -1703,8 +1713,10 @@ struct igb_ring_desc_16_bytes { 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); } } @@ -2782,6 +2794,7 @@ struct igb_ring_desc_16_bytes { 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)) @@ -2795,6 +2808,7 @@ struct igb_ring_desc_16_bytes { 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; } @@ -2802,6 +2816,7 @@ struct igb_ring_desc_16_bytes { 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)) @@ -2817,6 +2832,7 @@ struct igb_ring_desc_16_bytes { 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; } @@ -2828,6 +2844,9 @@ struct igb_ring_desc_16_bytes { 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 77154ef..0087438 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1498,6 +1498,9 @@ static int eth_event_callback(portid_t port_id, } 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) && -- 1.8.3.1