Skip to contentSkip to conversation

app/testpmd: fix set Tx offload command

PATCH In review Ferruh Yigit 3 participants 4 messages Nov 16, 2023 – Nov 17, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: fix set Tx offload command

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")

---
Cc: [email protected]
Cc: [email protected]
Cc: Song Jiale <[email protected]>
Cc: Zhimin Huang <[email protected]>

---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline.c +1 -1
index c040de7a7991..9369d3b4c526 100644
@@ -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);
 }
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 32 lines · Ferruh Yigit

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")

---
Cc: [email protected]
Cc: [email protected]
Cc: Song Jiale <[email protected]>
Cc: Zhimin Huang <[email protected]>

---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline.c +1 -1
index c040de7a7991..9369d3b4c526 100644
@@ -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);
 }
 
Acked-by
#2 lore raw
Quoted 36 lines · fengchengwen
Quoted 24 lines · Ferruh Yigit

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")

---
Cc: [email protected]
Cc: [email protected]
Cc: Song Jiale <[email protected]>
Cc: Zhimin Huang <[email protected]>

---
  app/test-pmd/cmdline.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline.c +0 -0
index c040de7a7991..9369d3b4c526 100644

app/test-pmd/cmdline.c cmd_config_per_port_tx_offload_parsed(void *parsed_result, · line 11743

Quoted 8 lines
app/test-pmd/cmdline.c +1 -1
@@ -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);
  }
 

.

author Applied
#3 lore raw
Quoted 7 lines · lihuisong (C)
Quoted 7 lines · Ferruh Yigit
Quoted 6 lines

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.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Fixes 6280fe565b44 ("app/testpmd: allow offload config for all ports")

Bugzilla ID: 1326

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