Skip to contentSkip to conversation

samples: pktgen: correct dev to DEV

PATCH Applied Wei Fang 4 participants 6 messages Nov 12, 2024 – Nov 14, 2024

Subsystems (3)
lore
Share & tools
lore

Wei Fang

author
#0 lore raw

PATCH 1/1 samples: pktgen: correct dev to DEV

In the pktgen_sample01_simple.sh script, the device variable is uppercase 'DEV' instead of lowercase 'dev'. Because of this typo, the script cannot enable UDP tx checksum.

Fixes 460a9aa23de6 ("samples: pktgen: add UDP tx checksum support")
---
 samples/pktgen/pktgen_sample01_simple.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
samples/pktgen/pktgen_sample01_simple.sh +1 -1
index cdb9f497f87d..66cb707479e6 100755
@@ -76,7 +76,7 @@ if [ -n "$DST_PORT" ]; then
     pg_set $DEV "udp_dst_max $UDP_DST_MAX"
 fi
 
-[ ! -z "$UDP_CSUM" ] && pg_set $dev "flag UDPCSUM"
+[ ! -z "$UDP_CSUM" ] && pg_set $DEV "flag UDPCSUM"
 
 # Setup random UDP port src range
 pg_set $DEV "flag UDPSRC_RND"
Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Wei Fang

In the pktgen_sample01_simple.sh script, the device variable is uppercase 'DEV' instead of lowercase 'dev'. Because of this typo, the script cannot enable UDP tx checksum.

Fixes 460a9aa23de6 ("samples: pktgen: add UDP tx checksum support")
#2 lore raw
In reply to Wei Fang

samples/pktgen/pktgen_sample01_simple.sh

Quoted 14 lines · Wei Fang

In the pktgen_sample01_simple.sh script, the device variable is uppercase 'DEV' instead of lowercase 'dev'. Because of this typo, the script cannot enable UDP tx checksum.

Fixes 460a9aa23de6 ("samples: pktgen: add UDP tx checksum support")
---
  samples/pktgen/pktgen_sample01_simple.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
samples/pktgen/pktgen_sample01_simple.sh +0 -0
index cdb9f497f87d..66cb707479e6 100755

Why are you only fixing one script?

The fixes commit 460a9aa23de6 changes many files, introducing this bug.

samples/pktgen/pktgen_sample01_simple.sh if [ -n "$DST_PORT" ]; then · line 80

Quoted 7 lines
samples/pktgen/pktgen_sample01_simple.sh +1 -1
@@ -76,7 +76,7 @@ if [ -n "$DST_PORT" ]; then
      pg_set $DEV "udp_dst_max $UDP_DST_MAX"
  fi
 
-[ ! -z "$UDP_CSUM" ] && pg_set $dev "flag UDPCSUM"
+[ ! -z "$UDP_CSUM" ] && pg_set $DEV "flag UDPCSUM"
 

This fix looks correct, but we also need to fix other scripts

samples/pktgen/pktgen_sample01_simple.sh if [ -n "$DST_PORT" ]; then · line 82

Quoted 2 lines
samples/pktgen/pktgen_sample01_simple.sh +0 -0
  # Setup random UDP port src range
  pg_set $DEV "flag UDPSRC_RND"
$ git whatchanged -1 460a9aa23de6 | grep 'M     samples'| awk -FM '{print $2}'
	samples/pktgen/parameters.sh
	samples/pktgen/pktgen_sample01_simple.sh
	samples/pktgen/pktgen_sample02_multiqueue.sh
	samples/pktgen/pktgen_sample03_burst_single_flow.sh
	samples/pktgen/pktgen_sample04_many_flows.sh
	samples/pktgen/pktgen_sample05_flow_per_thread.sh
	samples/pktgen/pktgen_sample06_numa_awared_queue_irq_affinity.sh

Thanks for spotting this, but please also fix the other scripts :-)

--Jesper

author
#3 lore raw
Quoted 11 lines · Wei Fang
Quoted 10 lines

In the pktgen_sample01_simple.sh script, the device variable is uppercase 'DEV' instead of lowercase 'dev'. Because of this typo, the script cannot enable UDP tx checksum.

Fixes 460a9aa23de6 ("samples: pktgen: add UDP tx checksum support")
---
  samples/pktgen/pktgen_sample01_simple.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 8 lines

samples/pktgen/pktgen_sample01_simple.sh

Quoted 5 lines
samples/pktgen/pktgen_sample01_simple.sh +0 -0
index cdb9f497f87d..66cb707479e6 100755

Why are you only fixing one script?

Other scripts are correct, because they are all multi-threaded, "dev" is defined for each thread like below.

dev=${DEV}@${thread}

Quoted 29 lines

The fixes commit 460a9aa23de6 changes many files, introducing this bug.

samples/pktgen/pktgen_sample01_simple.sh if [ -n "$DST_PORT" ]; then · line 80

Quoted 7 lines
samples/pktgen/pktgen_sample01_simple.sh +1 -1
@@ -76,7 +76,7 @@ if [ -n "$DST_PORT" ]; then
      pg_set $DEV "udp_dst_max $UDP_DST_MAX"
  fi
 
-[ ! -z "$UDP_CSUM" ] && pg_set $dev "flag UDPCSUM"
+[ ! -z "$UDP_CSUM" ] && pg_set $DEV "flag UDPCSUM"
 

This fix looks correct, but we also need to fix other scripts

samples/pktgen/pktgen_sample01_simple.sh if [ -n "$DST_PORT" ]; then · line 82

Quoted 2 lines
samples/pktgen/pktgen_sample01_simple.sh +0 -0
  # Setup random UDP port src range
  pg_set $DEV "flag UDPSRC_RND"
$ git whatchanged -1 460a9aa23de6 | grep 'M     samples'| awk -FM
'{print $2}'
	samples/pktgen/parameters.sh
	samples/pktgen/pktgen_sample01_simple.sh
	samples/pktgen/pktgen_sample02_multiqueue.sh
	samples/pktgen/pktgen_sample03_burst_single_flow.sh
	samples/pktgen/pktgen_sample04_many_flows.sh
	samples/pktgen/pktgen_sample05_flow_per_thread.sh
	samples/pktgen/pktgen_sample06_numa_awared_queue_irq_affinity.sh

Thanks for spotting this, but please also fix the other scripts :-)

--Jesper

#4 lore raw
Quoted 20 lines · Wei Fang
Quoted 11 lines · Wei Fang
Quoted 10 lines

In the pktgen_sample01_simple.sh script, the device variable is uppercase 'DEV' instead of lowercase 'dev'. Because of this typo, the script cannot enable UDP tx checksum.

Fixes 460a9aa23de6 ("samples: pktgen: add UDP tx checksum support")
---
   samples/pktgen/pktgen_sample01_simple.sh | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 8 lines

samples/pktgen/pktgen_sample01_simple.sh

Quoted 5 lines
samples/pktgen/pktgen_sample01_simple.sh +0 -0
index cdb9f497f87d..66cb707479e6 100755

Why are you only fixing one script?

Quoted 5 lines

Other scripts are correct, because they are all multi-threaded, "dev" is defined for each thread like below.

dev=${DEV}@${thread}

Good point! - then this patch is enough :-)

Thanks for fixing this,
--Jesper

#5 lore raw
In reply to Wei Fang
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 12 Nov 2024 11:03:47 +0800 you wrote:

In the pktgen_sample01_simple.sh script, the device variable is uppercase 'DEV' instead of lowercase 'dev'. Because of this typo, the script cannot enable UDP tx checksum.

Fixes 460a9aa23de6 ("samples: pktgen: add UDP tx checksum support")

[...]

Here is the summary with links:
- [net] samples: pktgen: correct dev to DEV

    https://git.kernel.org/netdev/net/c/3342dc8b4623

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html