DPDK patches and discussions
 help / color / mirror / Atom feed
From: "lihuisong (C)" <lihuisong@huawei.com>
To: Ferruh Yigit <ferruh.yigit@amd.com>, <dev@dpdk.org>,
	Aman Singh <aman.deep.singh@intel.com>,
	Yuying Zhang <yuying.zhang@intel.com>,
	Shahaf Shuler <shahafs@nvidia.com>,
	Wenzhuo Lu <wenzhuo.lu@intel.com>
Cc: <andrew.rybchenko@oktetlabs.ru>, <liuyonglong@huawei.com>
Subject: Re: [PATCH v1 3/3] app/testpmd: fix unnecessary change when set tunnel TSO
Date: Sat, 11 Nov 2023 12:28:15 +0800	[thread overview]
Message-ID: <98560bb8-605d-3ef9-3115-039776c35866@huawei.com> (raw)
In-Reply-To: <fcc7104e-9b16-4c88-a836-92bad98017e6@amd.com>


在 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 <lihuisong@huawei.com>
>> ---
>>   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
>
> .

  reply	other threads:[~2023-11-11  4:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-10  8:19 [PATCH v1 0/3] app/testpmd: fix the command to " Huisong Li
2023-11-10  8:19 ` [PATCH v1 1/3] app/testpmd: fix random value " Huisong Li
2023-11-10 11:42   ` Ivan Malov
2023-11-11  1:17     ` lihuisong (C)
2023-11-11  3:22       ` Ferruh Yigit
2023-11-10  8:19 ` [PATCH v1 2/3] app/testpmd: add the explicit check for tunnel TSO offload Huisong Li
2023-11-11  3:30   ` Ferruh Yigit
2023-11-11  4:27     ` lihuisong (C)
2023-11-10  8:19 ` [PATCH v1 3/3] app/testpmd: fix unnecessary change when set tunnel TSO Huisong Li
2023-11-11  3:37   ` Ferruh Yigit
2023-11-11  4:28     ` lihuisong (C) [this message]
2023-11-11  4:59 ` [PATCH v2 0/3] app/testpmd: fix the command to " Huisong Li
2023-11-11  4:59   ` [PATCH v2 1/3] app/testpmd: fix random value " Huisong Li
2023-11-11  4:59   ` [PATCH v2 2/3] app/testpmd: add the explicit check for tunnel TSO offload Huisong Li
2023-11-11  4:59   ` [PATCH v2 3/3] app/testpmd: fix unnecessary change when set tunnel TSO Huisong Li
2023-11-11  5:59   ` [PATCH v2 0/3] app/testpmd: fix the command to " Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98560bb8-605d-3ef9-3115-039776c35866@huawei.com \
    --to=lihuisong@huawei.com \
    --cc=aman.deep.singh@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=liuyonglong@huawei.com \
    --cc=shahafs@nvidia.com \
    --cc=wenzhuo.lu@intel.com \
    --cc=yuying.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).