From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 28D7D43345 for ; Thu, 16 Nov 2023 14:25:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22CC741060; Thu, 16 Nov 2023 14:25:21 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 39C8840DF5 for ; Thu, 16 Nov 2023 14:25:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700141118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Dzq/2RVn+Mz1uxHC1xBQZCV3gI2VIr0QexjeWlngPcc=; b=HaX6OSTqoK3t+suZk30kYd5YBWuBLNW33UhII5Le8ctXFuF+b+ovm+E/n0UDkqqjff8B7G lYJdcjqHusb6xGDHOo0l8e4p+0pD0lGDmzsGnr9GpzbC7XvtMk0rN1eM3HhWO5R+1do/ey P0rX/a+HjEqaeC7YwBarJj+dHHS+4gQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-627-bTNiR3oKM52j77uxoPCUlg-1; Thu, 16 Nov 2023 08:25:13 -0500 X-MC-Unique: bTNiR3oKM52j77uxoPCUlg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 55203101A550; Thu, 16 Nov 2023 13:25:13 +0000 (UTC) Received: from rh.Home (unknown [10.39.194.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id 90E172166B27; Thu, 16 Nov 2023 13:25:12 +0000 (UTC) From: Kevin Traynor To: Huisong Li Cc: Ferruh Yigit , dpdk stable Subject: patch 'app/testpmd: add explicit check for tunnel TSO' has been queued to stable release 21.11.6 Date: Thu, 16 Nov 2023 13:23:39 +0000 Message-ID: <20231116132348.557257-57-ktraynor@redhat.com> In-Reply-To: <20231116132348.557257-1-ktraynor@redhat.com> References: <20231116132348.557257-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/21/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/ac5c77407216ea99446ea7b776d665f8605921e7 Thanks. Kevin --- >From ac5c77407216ea99446ea7b776d665f8605921e7 Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Sat, 11 Nov 2023 12:59:42 +0800 Subject: [PATCH] app/testpmd: add explicit check for tunnel TSO [ upstream commit 33156a6bc61560e74a126ade38a7af9c1fa02671 ] If port don't support TSO of tunnel packets, tell user in advance and no need to change other configuration of this port in case of fault spread. In addition, if some tunnel offloads don't support, which is not an error case, the log about this shouldn't be to stderr. Fixes: 3926dd2b6668 ("app/testpmd: enforce offload capabilities check") Signed-off-by: Huisong Li Reviewed-by: Ferruh Yigit --- app/test-pmd/cmdline.c | 55 ++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index f7b4e319fb..ac6531ba52 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -5063,26 +5063,20 @@ check_tunnel_tso_nic_support(portid_t port_id, uint64_t tx_offload_capa) { if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO)) - fprintf(stderr, - "Warning: VXLAN TUNNEL TSO not supported therefore not enabled for port %d\n", + printf("Warning: VXLAN TUNNEL TSO not supported therefore not enabled for port %d\n", port_id); if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO)) - fprintf(stderr, - "Warning: GRE TUNNEL TSO not supported therefore not enabled for port %d\n", + printf("Warning: GRE TUNNEL TSO not supported therefore not enabled for port %d\n", port_id); if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO)) - fprintf(stderr, - "Warning: IPIP TUNNEL TSO not supported therefore not enabled for port %d\n", + printf("Warning: IPIP TUNNEL TSO not supported therefore not enabled for port %d\n", port_id); if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO)) - fprintf(stderr, - "Warning: GENEVE TUNNEL TSO not supported therefore not enabled for port %d\n", + printf("Warning: GENEVE TUNNEL TSO not supported therefore not enabled for port %d\n", port_id); if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_IP_TNL_TSO)) - fprintf(stderr, - "Warning: IP TUNNEL TSO not supported therefore not enabled for port %d\n", + printf("Warning: IP TUNNEL TSO not supported therefore not enabled for port %d\n", port_id); if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO)) - fprintf(stderr, - "Warning: UDP TUNNEL TSO not supported therefore not enabled for port %d\n", + printf("Warning: UDP TUNNEL TSO not supported therefore not enabled for port %d\n", port_id); } @@ -5095,4 +5089,10 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, struct cmd_tunnel_tso_set_result *res = parsed_result; struct rte_eth_dev_info dev_info; + uint64_t all_tunnel_tso = RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO | + RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO | + RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO | + RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO | + RTE_ETH_TX_OFFLOAD_IP_TNL_TSO | + RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO; int ret; @@ -5107,28 +5107,21 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, ports[res->port_id].tunnel_tso_segsz = res->tso_segsz; - ret = eth_dev_info_get_print_err(res->port_id, &dev_info); - if (ret != 0) - return; - - check_tunnel_tso_nic_support(res->port_id, dev_info.tx_offload_capa); if (ports[res->port_id].tunnel_tso_segsz == 0) { - ports[res->port_id].dev_conf.txmode.offloads &= - ~(RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO | - RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO | - RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO | - RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO | - RTE_ETH_TX_OFFLOAD_IP_TNL_TSO | - RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO); + ports[res->port_id].dev_conf.txmode.offloads &= ~all_tunnel_tso; printf("TSO for tunneled packets is disabled\n"); } else { - uint64_t tso_offloads = (RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO | - RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO | - RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO | - RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO | - RTE_ETH_TX_OFFLOAD_IP_TNL_TSO | - RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO); + ret = eth_dev_info_get_print_err(res->port_id, &dev_info); + if (ret != 0) + return; + + if ((all_tunnel_tso & dev_info.tx_offload_capa) == 0) { + fprintf(stderr, "Error: port=%u don't support tunnel TSO offloads.\n", + res->port_id); + return; + } + check_tunnel_tso_nic_support(res->port_id, dev_info.tx_offload_capa); ports[res->port_id].dev_conf.txmode.offloads |= - (tso_offloads & dev_info.tx_offload_capa); + (all_tunnel_tso & dev_info.tx_offload_capa); printf("TSO segment size for tunneled packets is %d\n", ports[res->port_id].tunnel_tso_segsz); -- 2.41.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-11-16 13:21:53.902342041 +0000 +++ 0057-app-testpmd-add-explicit-check-for-tunnel-TSO.patch 2023-11-16 13:21:52.557946687 +0000 @@ -1 +1 @@ -From 33156a6bc61560e74a126ade38a7af9c1fa02671 Mon Sep 17 00:00:00 2001 +From ac5c77407216ea99446ea7b776d665f8605921e7 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 33156a6bc61560e74a126ade38a7af9c1fa02671 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index 1fffb07db1..2e3365557a 100644 +index f7b4e319fb..ac6531ba52 100644 @@ -25 +26 @@ -@@ -5040,26 +5040,20 @@ check_tunnel_tso_nic_support(portid_t port_id, uint64_t tx_offload_capa) +@@ -5063,26 +5063,20 @@ check_tunnel_tso_nic_support(portid_t port_id, uint64_t tx_offload_capa) @@ -58 +59 @@ -@@ -5072,4 +5066,10 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, +@@ -5095,4 +5089,10 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, @@ -69 +70 @@ -@@ -5084,28 +5084,21 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, +@@ -5107,28 +5107,21 @@ cmd_tunnel_tso_set_parsed(void *parsed_result,