From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0059.outbound.protection.outlook.com [104.47.1.59]) by dpdk.org (Postfix) with ESMTP id 3A5E61B402 for ; Tue, 26 Dec 2017 10:44: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=2LrK4xgD5QqeDDw82HaixeE8IvkNLl7Q9jkdjiLX8pA=; b=fyqBeHI5m3WZ8tYkx7ZJ21DkaKEKorB3iwgW3i4UYjOi5CmI+XuqF6JYuSOxiQaTny/zXujsihs/4ISgfPNoi53LxlBLwmK7hhi/DiGWw8SRmIw6bb2BneJAeScP5tNnhnW+QwR+jpf0hSUKt/PlGaBDSea9O+5kIBqsQXnbY8o= 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.345.14; Tue, 26 Dec 2017 09:44:57 +0000 From: Shahaf Shuler To: jingjing.wu@intel.com, ferruh.yigit@intel.com Cc: dev@dpdk.org Date: Tue, 26 Dec 2017 11:44:18 +0200 Message-Id: X-Mailer: git-send-email 2.12.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: DB6PR07CA0012.eurprd07.prod.outlook.com (2603:10a6:6:2d::22) To VI1PR05MB3150.eurprd05.prod.outlook.com (2603:10a6:802:1b::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 12167051-b46b-4679-eaae-08d54c4553d0 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(48565401081)(2017052603307)(7153060); SRVR:VI1PR05MB3150; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 3:2Ys9jEtjAv2GP7miueFvUwYAjTJ/F2FFrUZMPP7WHWT5bVEJCNkqKTJtQ581LLpciqtKyWHSC8IqMIV8FQKh30WNBXjXGxxDEUJHYOVYCIkSOfBFpuuhaHp/0Qn7Z7yKRmcM5UKTUAkiKV6nOb+CMj3s5xAzrfWYFzIG12vBaP7O6OsFVXZVyKR0kX74Y20N1AWaPl2FBAcchE40Vq7s+WkFrb12Gz9oFAB0Xc/SaXoo8Uzi78sKZQ6AUFmZVm4Z; 25:kCuX7v0DfyKGWI0vtpGDp3u+KehSHSS5GsO6R0exx7V7J1hAPxIngbyWI7fsze8y+ZCfUB+9c/ugBy3eMhZ5vT2YyestgnKO30VaSZOyIWtH5181N7BCVg8loZf1L3zQ8zZwTY6QNsOPnFUuTp1jgmV8D4fXJ0E4CnPr+Es8dZnNhaeC9OiX62L4f3VJDiomzD+O0rAj4K9eS2TlpfbSXc8L/j5yWEfmPLk9FriDIan8ctkgOQys1uSjqv6lQTsgvgIyWQDZrF4ZSkIN/NWWMI2r560s7bzJ6kgSUeCkLSOPpnPeA9/FKiBwfCg4vCSOCP+fgr9ds5++WhIaaneMLw==; 31:GMvjfCaoCVldbINtCAW6hzhaYHIt6EnxKNMyE0rth61ZUc2lfb5y1p7UFDXGsjGm4fBt74lRMWKwHEJiNuvIiOTyDtuOrTTTSRRuocRZX5KyCuepCfO79o2xh1Za0MCtIIJSKG7WUnf8DYphmxTkT0xXC6S1GKpRnl2RDIO9ow7V0mi2KxutzCoPFYJf6sbIuEW0FFj/R3/XPaaN3r3jAwIOBJzEzHRSNsscMDXfrq8= X-MS-TrafficTypeDiagnostic: VI1PR05MB3150: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 20:25V4tLAzl9VF+Btazs/8fBfkAYlAPgM+XuMQs9O1RZxSOzgQMsb7GnLpdEyEq/Y+DlerloNSMmGFDk24OQ0+HEY0GC4GjbQ8N0mhbsP0weK2g2G05Udw4qACfMJFBY8W4lvAKtwqifNVSsnWuG7KNuzuKiRQZDSwHqkS2cc3WbD/HbkCABIPZ3kbmpbTH0dAUJmwwt8SP5uwuJtNnjmAd4+WbkHB7HbFCwD7XGtCAX0mklrG3W6jp9ejcqOABS8mpbOxGjMSYWb47+8YQ61YgEuoLE8WxKEO+Z+MjlbAv5Zu+LsgE9WRvkA/IHjRp/zHJgqMVpWFrriNh3e1oDYbTmkcsFOrduDScQEFktD3dmTYmd6LjzYg+/dDWakUDs3oYO/Hqw/d7ohjXB0nfOiUTd1QFPAE81P0Ik0R+CJ0i0yhlXApY2iTNaDk1Eg77T2BO6Y6j9ryoVygpyOvLd9x4GO8A9LOaR6QahtK10C4YNH4NBF1EvxvG1jfO43kQyby; 4:z+n6dlrf9pJ+WwJZyIP4e7z9mzmX9yklpwVDJC7qaMjeXgdTDlr0G9q12D+tEN+O70ssnXUCnnJgBO42IFOrQd4r1OlK/vQNpXG2qq4ymBnRS++aT4syTP01XUKl0JfdCvs/w/SsrN99fhRRKI6a3m0TWMPtiKZVa+Ems/8AtZZuHz2vUgRRvpSR2empTUgMRoYh1GZboHLNDEuiBtZRV2Oh2XNl2Sa+EZQeIO1WZao1LUqn0OERqxMPN/qKPQ152Ciz67HLSrbfd30ORt/K8Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3231023)(944501075)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041268)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:VI1PR05MB3150; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3150; X-Forefront-PRVS: 053315510E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(366004)(346002)(39380400002)(376002)(199004)(189003)(33026002)(50226002)(52116002)(59450400001)(51416003)(55016002)(8936002)(76176011)(7696005)(81166006)(36756003)(86362001)(68736007)(3846002)(81156014)(6116002)(386003)(16586007)(316002)(8676002)(50466002)(69596002)(48376002)(53936002)(2906002)(25786009)(2950100002)(6666003)(5660300001)(118296001)(16526018)(21086003)(4326008)(478600001)(97736004)(106356001)(47776003)(305945005)(7736002)(66066001)(105586002); 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:1JYPB7HO1YtfaXekxV7d6k7Dj/j4GlTXZ8UV5/wt6?= =?us-ascii?Q?sfD7P0c0OY14/sieBFG20/IjVcDb6kX7bkEJY1QyQuJveRpgU8MXgjgVJrmC?= =?us-ascii?Q?8yGjbibxjeBb2HK5AXFeICBwso+9XeXSQaZEsJuHFJuGskseOgTMl4EQhN+t?= =?us-ascii?Q?xuHBE4mkAmXg54IA93KmcFOYqN95N5CGWl2GrWeJrbBEkUrrQamaSiPw4+PT?= =?us-ascii?Q?828BA/Pfqb7B0X2reMBwWb6SiY0BaaSVpwak0UtIfqQpF93/FlXKw5Hh0eeB?= =?us-ascii?Q?kpkSMha1MD/LmOjqvykVpqvpVmEaL+seX60DD7L5YI7ezOTIW8ARl07GUdv5?= =?us-ascii?Q?tWUB23rDTpT44FDTpCFd/dqnaYBTMHyz6/91W2WUynjX9OE4KA5gyPNuFclz?= =?us-ascii?Q?g9CmNmFL/MhmWQHaU9vLhTM1RXp+q3Xq7svZI87Pxt7mF0zzXb+4NdQd7MEE?= =?us-ascii?Q?CM+yRApvbO7Jl8X1WsdXuVKt/aqBa6UGBULmvgylIEqXZSRiVsHH2HFTpXPu?= =?us-ascii?Q?dVRxSOEAlMSg2ogLlg1V+D2dJH2pSuOxdnapfyENm8ClmlDBdbDbd0iRQ4w1?= =?us-ascii?Q?WsrmUx5EVv5rPpyHTMshjqz43uyd8KNv69b0CXGd9ZC4qACZsGzCodwZe4F9?= =?us-ascii?Q?3DjNytZ61Vz5zclxtg4y9CTIF0Q+J9l5WN0GROcWi7pQJe2ALkzqZ3WgEiJO?= =?us-ascii?Q?iWh+oDiPZWK6j4+qUeUqhuTfaLVYQmDav/9Gbrv7VFN0PmB1MUYjNPUgEl9i?= =?us-ascii?Q?u7ixKRTG/p5edJcLX/lmCpO79Ot27FAEExK7GY418/JQtqOkzT4Ljla46tYC?= =?us-ascii?Q?Jpp4IJEX4L1JuhFxTnVZL0e7HSoF/CuXBR5W1rZSDZ8qJqETNUmuwtuY3XNI?= =?us-ascii?Q?81OcL+iEleYFcZQO3stnqCAWAN4dVrsEmFqNYut5/RdWguMEGcQ/em1YtEJk?= =?us-ascii?Q?G6Ye42T5KUnlF566++wSJw3DAP7olrMXLxe6ycLa32GVofFGbwoYVbMwhAvd?= =?us-ascii?Q?+2A14W/oVm+C13/YzmtE5CuAXuR/xwNYzW1oKKXDje5UvcPmPVES8yXsVqkI?= =?us-ascii?Q?RYllFWIjfen4ba9XdjzimDD6zSf5fMW35Nct92OBtj7bL1BMzvxgX/GHpdd4?= =?us-ascii?Q?Xbl5k2eQC2cKaKKqmUytqvBn71bSw1W?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3150; 6:3tsVq84wqphHUrAQzZPCtMCYUcmZPb1GtN+7E4fq+2kcv55NTsJxb1iic4S0t/kCTl8VMPw3AMMYp8W/c8MTJCJGt0x814TMA1knQ+c+5z7lf6b2/znncEBsLKVKX1UodrZzz+uT//l8fxhRcLGBoxr6G0ybXQzGinas7IHq46cwYDp7FCgDD0Bc8iM6qpp6hSP7K5S4AFMa9O5g6xJ1GPwFcEhxADgdgUK/ICcZqjkqjIJoatgcBEwdZjTPM3lMAEl2uMACTVSSxo/rfo+p1MXt85FVDPNTSGNeoV6VAqHaeZXl7K64RmnCSX8vDmxuUkbzq1Bxus1iCrzi+DSUIK8/qliOMlWdEsXBj4Dv5r4=; 5:7G1qVkdpBNTpVtfQGPnB13zVmQAwhjFfiLVzG/8g0SRxGyOp7RL4vcCE8wyBsYg9MdyUY5V+WjNqbckRr1Ak6VdXP70xRJ53YTVAvkb1Kw28QQsjFiNU7u2qyuEo7Muoi0e0tGnnu8aAW39zTraXSZbD64flsOnjXmlaY+Qf5pg=; 24:464IWdU5DZLxgrqbHfZErrl6BOAyNkv4VttX1dLFhnL9xrQeNhPXPE3+8oMIxQXLAI0fM7wjCRiqQ6oHMp/Klep7uoJ579pf0/9hE3iEBxY=; 7:6EaeaqSoLbSx7FfgR8r7o4OaLqICcD8puNQU6QXrvg717/k8e79s+R9f1ou2EuXggpawBF9md/yjrQ4ezhJ1hpPdjwZyv9m008r2p9GapK6oLJWaYCF3vcs4W6mNs402XyJYYE5QBc+ryYKdTTRElIKDvsBqKci5ZHMObYBXxZjnEoUARAg4j3Big8M3AKL3xxxpSEss6giA9e/OmxdrYNPY9l+QduOC8ZwFsqojTmGWo8Z40hvPeAHK/8dFItsX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:44:57.9354 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12167051-b46b-4679-eaae-08d54c4553d0 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 v3 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, 26 Dec 2017 09:45: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 --- 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