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 198B9432FA; Sat, 11 Nov 2023 05:28:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 08A1342E3B; Sat, 11 Nov 2023 05:28:19 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 7FCB942E39 for ; Sat, 11 Nov 2023 05:28:17 +0100 (CET) Received: from kwepemm000004.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SS2jq4s80zWh3Y; Sat, 11 Nov 2023 12:27:59 +0800 (CST) Received: from [10.67.121.59] (10.67.121.59) by kwepemm000004.china.huawei.com (7.193.23.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Sat, 11 Nov 2023 12:28:15 +0800 Message-ID: <98560bb8-605d-3ef9-3115-039776c35866@huawei.com> Date: Sat, 11 Nov 2023 12:28:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v1 3/3] app/testpmd: fix unnecessary change when set tunnel TSO To: Ferruh Yigit , , Aman Singh , Yuying Zhang , Shahaf Shuler , Wenzhuo Lu CC: , References: <20231110081925.14142-1-lihuisong@huawei.com> <20231110081925.14142-4-lihuisong@huawei.com> From: "lihuisong (C)" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.59] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm000004.china.huawei.com (7.193.23.18) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 在 2023/11/11 11:37, Ferruh Yigit 写道: > On 11/10/2023 8:19 AM, Huisong Li wrote: >> Currently, there are two conditions to set tunnel TSO, like "parse tunnel" >> and "outer IP checksum". If these conditions are not satisfied, testpmd >> should not change their configuration, like tx_offloads on port and per >> queue, and no need to request "reconfig device". >> >> Fixes: 597f9fafe13b ("app/testpmd: convert to new Tx offloads API") >> Cc: stable@dpdk.org >> >> Signed-off-by: Huisong Li >> --- >> app/test-pmd/cmdline.c | 36 ++++++++++++++++++++---------------- >> 1 file changed, 20 insertions(+), 16 deletions(-) >> >> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c >> index d3243d016b..33e66d1d93 100644 >> --- a/app/test-pmd/cmdline.c >> +++ b/app/test-pmd/cmdline.c >> @@ -5093,17 +5093,6 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, >> res->port_id); >> 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 &= ~all_tunnel_tso; >> - printf("TSO for tunneled packets is disabled\n"); >> - } else { >> - ports[res->port_id].dev_conf.txmode.offloads |= >> - (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); >> >> /* Below conditions are needed to make it work: >> * (1) tunnel TSO is supported by the NIC; >> @@ -5116,14 +5105,29 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, >> * is not necessary for IPv6 tunneled pkts because there's no >> * checksum in IP header anymore. >> */ >> - >> - if (!ports[res->port_id].parse_tunnel) >> + if (!ports[res->port_id].parse_tunnel) { >> fprintf(stderr, >> - "Warning: csum parse_tunnel must be set so that tunneled packets are recognized\n"); >> + "Error: csum parse_tunnel must be set so that tunneled packets are recognized\n"); >> + return; >> + } >> if (!(ports[res->port_id].dev_conf.txmode.offloads & >> - RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM)) >> + RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM)) { >> fprintf(stderr, >> - "Warning: csum set outer-ip must be set to hw if outer L3 is IPv4; not necessary for IPv6\n"); >> + "Error: csum set outer-ip must be set to hw if outer L3 is IPv4; not necessary for IPv6\n"); >> + 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 &= ~all_tunnel_tso; >> + printf("TSO for tunneled packets is disabled\n"); >> + } else { >> + ports[res->port_id].dev_conf.txmode.offloads |= >> + (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); >> > Similar comment with previous patch, why having separate if block for > same check, above block can be merged to it. Ack > > .