app/testpmd: fix set Tx offload command

Message ID 20231116172155.951084-1-ferruh.yigit@amd.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series app/testpmd: fix set Tx offload command |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Ferruh Yigit Nov. 16, 2023, 5:21 p.m. UTC
  In command to set Tx offload:
"port config <port_id> tx_offload <offload> on|off",

there is a defect in "on|off" comparison, so command does opposite of
what is intended. Fixed comparison.

Fixes: 6280fe565b44 ("app/testpmd: allow offload config for all ports")

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
Cc: huangdengdui@huawei.com
Cc: lihuisong@huawei.com
Cc: Song Jiale <songx.jiale@intel.com>
Cc: Zhimin Huang <zhiminx.huang@intel.com>
---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

fengchengwen Nov. 17, 2023, 1:05 a.m. UTC | #1
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>

On 2023/11/17 1:21, Ferruh Yigit wrote:
> In command to set Tx offload:
> "port config <port_id> tx_offload <offload> on|off",
> 
> there is a defect in "on|off" comparison, so command does opposite of
> what is intended. Fixed comparison.
> 
> Fixes: 6280fe565b44 ("app/testpmd: allow offload config for all ports")
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---
> Cc: huangdengdui@huawei.com
> Cc: lihuisong@huawei.com
> Cc: Song Jiale <songx.jiale@intel.com>
> Cc: Zhimin Huang <zhiminx.huang@intel.com>
> ---
>  app/test-pmd/cmdline.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index c040de7a7991..9369d3b4c526 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -11737,7 +11737,7 @@ cmd_config_per_port_tx_offload_parsed(void *parsed_result,
>  	struct cmd_config_per_port_tx_offload_result *res = parsed_result;
>  	bool on;
>  
> -	on = strcmp(res->on_off, "on");
> +	on = strcmp(res->on_off, "on") == 0;
>  	config_port_tx_offload(res->port_id, res->offload, on);
>  }
>  
>
  
lihuisong (C) Nov. 17, 2023, 1:31 a.m. UTC | #2
Acked-by: Huisong Li <lihuisong@huawei.com>

在 2023/11/17 9:05, fengchengwen 写道:
> Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
>
> On 2023/11/17 1:21, Ferruh Yigit wrote:
>> In command to set Tx offload:
>> "port config <port_id> tx_offload <offload> on|off",
>>
>> there is a defect in "on|off" comparison, so command does opposite of
>> what is intended. Fixed comparison.
>>
>> Fixes: 6280fe565b44 ("app/testpmd: allow offload config for all ports")
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
>> ---
>> Cc: huangdengdui@huawei.com
>> Cc: lihuisong@huawei.com
>> Cc: Song Jiale <songx.jiale@intel.com>
>> Cc: Zhimin Huang <zhiminx.huang@intel.com>
>> ---
>>   app/test-pmd/cmdline.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
>> index c040de7a7991..9369d3b4c526 100644
>> --- a/app/test-pmd/cmdline.c
>> +++ b/app/test-pmd/cmdline.c
>> @@ -11737,7 +11737,7 @@ cmd_config_per_port_tx_offload_parsed(void *parsed_result,
>>   	struct cmd_config_per_port_tx_offload_result *res = parsed_result;
>>   	bool on;
>>   
>> -	on = strcmp(res->on_off, "on");
>> +	on = strcmp(res->on_off, "on") == 0;
>>   	config_port_tx_offload(res->port_id, res->offload, on);
>>   }
>>   
>>
> .
  
Ferruh Yigit Nov. 17, 2023, 10:19 a.m. UTC | #3
On 11/17/2023 1:31 AM, lihuisong (C) wrote:

>> On 2023/11/17 1:21, Ferruh Yigit wrote:
>>> In command to set Tx offload:
>>> "port config <port_id> tx_offload <offload> on|off",
>>>
>>> there is a defect in "on|off" comparison, so command does opposite of
>>> what is intended. Fixed comparison.
>>>
>>> Fixes: 6280fe565b44 ("app/testpmd: allow offload config for all ports")
>>>
>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
>> 
>> Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
>> 
>
> Acked-by: Huisong Li <lihuisong@huawei.com>
>

  Bugzilla ID: 1326

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index c040de7a7991..9369d3b4c526 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -11737,7 +11737,7 @@  cmd_config_per_port_tx_offload_parsed(void *parsed_result,
 	struct cmd_config_per_port_tx_offload_result *res = parsed_result;
 	bool on;
 
-	on = strcmp(res->on_off, "on");
+	on = strcmp(res->on_off, "on") == 0;
 	config_port_tx_offload(res->port_id, res->offload, on);
 }