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 5996443337 for ; Wed, 15 Nov 2023 12:45:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5268F40294; Wed, 15 Nov 2023 12:45:47 +0100 (CET) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mails.dpdk.org (Postfix) with ESMTP id 864A240285 for ; Wed, 15 Nov 2023 12:45:44 +0100 (CET) Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-32fb1d757f7so4281022f8f.0 for ; Wed, 15 Nov 2023 03:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700048744; x=1700653544; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sIjsOqyqPW7YF8nIy+LTePyQWspAB6QQK5mlhRxgGHw=; b=O8EEYtQ+yTSe8qSZJATyh2z7DsucoLgbMssukqwape//DgrfO/7j8Dt00yLkV65cs0 F2yqDpk94K/OsfApQZ49W3ceKvicaMmSPlNyisQJaJTfHj/bOYmjjOXO4Tu0lUdZZZ6E 6SEpeDPDCeTjR7bOPkkcppQ4PsejNeR6GvdtzxCcySqNWswEbf3bJSvRnvh6iWlemOzT 6MXSlWzP5ZS7wl1BQ/WXgpLeA8Zfz9hvrw7T77dzkEpKqjDpw8NYXl97RcEYp8HeYUXn TBniaRwXPfJ9x2DK0d+AzrS5UvUUD20gEuTh8f//FdDkmq8Z3leFqMfvgTByCARXK0b6 PnEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700048744; x=1700653544; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sIjsOqyqPW7YF8nIy+LTePyQWspAB6QQK5mlhRxgGHw=; b=q+f7jQDuc+L589UATelOWX1cvsuOi46ypfbFOpeN/pq4x84DQnKzSY7tn6P2zNxLT5 GnAtFlCoY7KI5mbBVITfvXHqXFU5sDIPIXjzspY5xZB9mEP6TqIT3uBiumdWfydeHsv4 JoLC5BEnVRZtGOPOhVMbSZfYwzj3BHgCq0+PFDMR80ZIFIkMdzj5H2qJU6AAf48dQbPF AutgougXgU1e9yh0fQZ0MBJ2j9exLaTDi2lYs6Yb64dRBowFHaTTXFZ92mwD5/7yUHIK bt1BQFEUKkeQw9g/x5LOHoAgWMQwGdAmxrF4N2vqbubCOsfPoulzb2YILHLbW6gINdQf 2uCQ== X-Gm-Message-State: AOJu0YwbGcjof4dk4qVB4CFB4SSNb2wR8EU6wdTy2Bupz/3YF0uINlu5 lRmB47TX+Z8TPC0N82rANEi/gVOfBiJlhQ== X-Google-Smtp-Source: AGHT+IEDoMLfQZS4XluQ2pWaIuET8kKhF5vyPs22JmrO3aUmPYPiq78O3ZcmAexYXZBpbBwEwndAxw== X-Received: by 2002:a5d:6586:0:b0:317:e542:80a8 with SMTP id q6-20020a5d6586000000b00317e54280a8mr8676959wru.15.1700048744189; Wed, 15 Nov 2023 03:45:44 -0800 (PST) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id e1-20020a056000120100b003296b488961sm10145045wrx.31.2023.11.15.03.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 03:45:43 -0800 (PST) From: luca.boccassi@gmail.com To: Huisong Li Cc: Ferruh Yigit , dpdk stable Subject: patch 'app/testpmd: add explicit check for tunnel TSO' has been queued to stable release 20.11.10 Date: Wed, 15 Nov 2023 11:45:09 +0000 Message-Id: <20231115114515.2355140-10-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231115114515.2355140-1-luca.boccassi@gmail.com> References: <20231108192535.922238-37-luca.boccassi@gmail.com> <20231115114515.2355140-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 20.11.10 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/17/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/d6dd9c8ce5595b3deeffbf452f3ff292336793fc Thanks. Luca Boccassi --- >From d6dd9c8ce5595b3deeffbf452f3ff292336793fc 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 | 61 +++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index e8b680defe..e9d8d375f5 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -4942,23 +4942,23 @@ static void check_tunnel_tso_nic_support(portid_t port_id, uint64_t tx_offload_capa) { if (!(tx_offload_capa & DEV_TX_OFFLOAD_VXLAN_TNL_TSO)) - printf("Warning: VXLAN TUNNEL TSO not supported therefore " - "not enabled for port %d\n", port_id); + printf("Warning: VXLAN TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); if (!(tx_offload_capa & DEV_TX_OFFLOAD_GRE_TNL_TSO)) - printf("Warning: GRE TUNNEL TSO not supported therefore " - "not enabled for port %d\n", port_id); + printf("Warning: GRE TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); if (!(tx_offload_capa & DEV_TX_OFFLOAD_IPIP_TNL_TSO)) - printf("Warning: IPIP TUNNEL TSO not supported therefore " - "not enabled for port %d\n", port_id); + printf("Warning: IPIP TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); if (!(tx_offload_capa & DEV_TX_OFFLOAD_GENEVE_TNL_TSO)) - printf("Warning: GENEVE TUNNEL TSO not supported therefore " - "not enabled for port %d\n", port_id); + printf("Warning: GENEVE TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); if (!(tx_offload_capa & DEV_TX_OFFLOAD_IP_TNL_TSO)) - printf("Warning: IP TUNNEL TSO not supported therefore " - "not enabled for port %d\n", port_id); + printf("Warning: IP TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); if (!(tx_offload_capa & DEV_TX_OFFLOAD_UDP_TNL_TSO)) - printf("Warning: UDP TUNNEL TSO not supported therefore " - "not enabled for port %d\n", port_id); + printf("Warning: UDP TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); } static void @@ -4968,6 +4968,12 @@ 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 = DEV_TX_OFFLOAD_VXLAN_TNL_TSO | + DEV_TX_OFFLOAD_GRE_TNL_TSO | + DEV_TX_OFFLOAD_IPIP_TNL_TSO | + DEV_TX_OFFLOAD_GENEVE_TNL_TSO | + DEV_TX_OFFLOAD_IP_TNL_TSO | + DEV_TX_OFFLOAD_UDP_TNL_TSO; int ret; if (port_id_is_invalid(res->port_id, ENABLED_WARN)) @@ -4980,30 +4986,23 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, if (!strcmp(res->mode, "set")) 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 &= - ~(DEV_TX_OFFLOAD_VXLAN_TNL_TSO | - DEV_TX_OFFLOAD_GRE_TNL_TSO | - DEV_TX_OFFLOAD_IPIP_TNL_TSO | - DEV_TX_OFFLOAD_GENEVE_TNL_TSO | - DEV_TX_OFFLOAD_IP_TNL_TSO | - DEV_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 = (DEV_TX_OFFLOAD_VXLAN_TNL_TSO | - DEV_TX_OFFLOAD_GRE_TNL_TSO | - DEV_TX_OFFLOAD_IPIP_TNL_TSO | - DEV_TX_OFFLOAD_GENEVE_TNL_TSO | - DEV_TX_OFFLOAD_IP_TNL_TSO | - DEV_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.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-11-15 11:44:14.026435564 +0000 +++ 0010-app-testpmd-add-explicit-check-for-tunnel-TSO.patch 2023-11-15 11:44:13.586387858 +0000 @@ -1 +1 @@ -From 33156a6bc61560e74a126ade38a7af9c1fa02671 Mon Sep 17 00:00:00 2001 +From d6dd9c8ce5595b3deeffbf452f3ff292336793fc Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 33156a6bc61560e74a126ade38a7af9c1fa02671 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -18,2 +19,2 @@ - app/test-pmd/cmdline.c | 55 ++++++++++++++++++------------------------ - 1 file changed, 24 insertions(+), 31 deletions(-) + app/test-pmd/cmdline.c | 61 +++++++++++++++++++++--------------------- + 1 file changed, 30 insertions(+), 31 deletions(-) @@ -22 +23 @@ -index 1fffb07db1..2e3365557a 100644 +index e8b680defe..e9d8d375f5 100644 @@ -25 +26 @@ -@@ -5039,28 +5039,22 @@ static void +@@ -4942,23 +4942,23 @@ static void @@ -28,3 +29,3 @@ - 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", + if (!(tx_offload_capa & DEV_TX_OFFLOAD_VXLAN_TNL_TSO)) +- printf("Warning: VXLAN TUNNEL TSO not supported therefore " +- "not enabled for port %d\n", port_id); @@ -32,4 +33,4 @@ - 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", ++ port_id); + if (!(tx_offload_capa & DEV_TX_OFFLOAD_GRE_TNL_TSO)) +- printf("Warning: GRE TUNNEL TSO not supported therefore " +- "not enabled for port %d\n", port_id); @@ -37,4 +38,4 @@ - 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", ++ port_id); + if (!(tx_offload_capa & DEV_TX_OFFLOAD_IPIP_TNL_TSO)) +- printf("Warning: IPIP TUNNEL TSO not supported therefore " +- "not enabled for port %d\n", port_id); @@ -42,4 +43,4 @@ - 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", ++ port_id); + if (!(tx_offload_capa & DEV_TX_OFFLOAD_GENEVE_TNL_TSO)) +- printf("Warning: GENEVE TUNNEL TSO not supported therefore " +- "not enabled for port %d\n", port_id); @@ -47,4 +48,4 @@ - 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", ++ port_id); + if (!(tx_offload_capa & DEV_TX_OFFLOAD_IP_TNL_TSO)) +- printf("Warning: IP TUNNEL TSO not supported therefore " +- "not enabled for port %d\n", port_id); @@ -52,4 +53,4 @@ - 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", ++ port_id); + if (!(tx_offload_capa & DEV_TX_OFFLOAD_UDP_TNL_TSO)) +- printf("Warning: UDP TUNNEL TSO not supported therefore " +- "not enabled for port %d\n", port_id); @@ -57 +58 @@ - port_id); ++ port_id); @@ -60 +61,2 @@ -@@ -5071,6 +5065,12 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, + static void +@@ -4968,6 +4968,12 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, @@ -64,6 +66,6 @@ -+ 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; ++ uint64_t all_tunnel_tso = DEV_TX_OFFLOAD_VXLAN_TNL_TSO | ++ DEV_TX_OFFLOAD_GRE_TNL_TSO | ++ DEV_TX_OFFLOAD_IPIP_TNL_TSO | ++ DEV_TX_OFFLOAD_GENEVE_TNL_TSO | ++ DEV_TX_OFFLOAD_IP_TNL_TSO | ++ DEV_TX_OFFLOAD_UDP_TNL_TSO; @@ -73 +75 @@ -@@ -5083,30 +5083,23 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, +@@ -4980,30 +4986,23 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, @@ -84,6 +86,6 @@ -- ~(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); +- ~(DEV_TX_OFFLOAD_VXLAN_TNL_TSO | +- DEV_TX_OFFLOAD_GRE_TNL_TSO | +- DEV_TX_OFFLOAD_IPIP_TNL_TSO | +- DEV_TX_OFFLOAD_GENEVE_TNL_TSO | +- DEV_TX_OFFLOAD_IP_TNL_TSO | +- DEV_TX_OFFLOAD_UDP_TNL_TSO); @@ -93,6 +95,6 @@ -- 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); +- uint64_t tso_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 | +- DEV_TX_OFFLOAD_IP_TNL_TSO | +- DEV_TX_OFFLOAD_UDP_TNL_TSO);