Skip to content
Snippets Groups Projects
  1. Aug 26, 2021
  2. Aug 25, 2021
    • Juhee Kang's avatar
      samples: pktgen: add trap SIGINT for printing execution result · 6c882bdc
      Juhee Kang authored
      
      All pktgen samples can send indefinitely num messages per thread by
      setting the count option to 0(-n 0). If running sample with setting
      count 0 and press Ctrl-C to stop this program, the program prints the
      result of the execution so far. Currently, the samples besides
      sample{3...5} don't work properly. Because Ctrl-C stops the script, not
      just pktgen.
      
      This is results of samples:
      
          # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample04_many_flows.sh -n 0
          Running... ctrl^C to stop
          ^CDevice: eth0@0
          Result: OK: 569657(c569538+d118) usec, 84650 (60byte,0frags)
          148597pps 71Mb/sec (71326560bps) errors: 0
      
          # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample01_simple.sh -n 0
          Running... ctrl^C to stop
          ^C
      
      In order to solve this, this commit adds trap SIGINT. Also, this commit
      changes control_c function to print_result to maintain consistency with
      other samples.
      
      Signed-off-by: default avatarJuhee Kang <claudiajkang@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c882bdc
    • Juhee Kang's avatar
      samples: pktgen: fix to print when terminated normally · c0e9422c
      Juhee Kang authored
      
      Currently, most pktgen samples print the execution result when the
      program is terminated normally. However, sample03 doesn't work
      appropriately.
      
      This is results of samples:
      
          # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample04_many_flows.sh -n 1
          Running... ctrl^C to stop
          Device: eth0@0
          Result: OK: 19(c5+d13) usec, 1 (60byte,0frags)
          51762pps 24Mb/sec (24845760bps) errors: 0
      
          # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample03_burst_single_flow.sh -n 1
          Running... ctrl^C to stop
      
      The reason why it doesn't print the execution result when the program is
      terminated usually is that sample03 doesn't call the function which
      prints the result, unlike other samples.
      
      So, this commit solves this issue by calling the function before
      termination. Also, this commit changes control_c function to
      print_result to maintain consistency with other samples.
      
      Signed-off-by: default avatarJuhee Kang <claudiajkang@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c0e9422c
  3. Aug 24, 2021
  4. Aug 17, 2021
  5. Aug 16, 2021
    • Juhee Kang's avatar
      samples: pktgen: add missing IPv6 option to pktgen scripts · 0f0c4f1b
      Juhee Kang authored
      
      Currently, "sample04" and "sample05" are not working properly when
      running with an IPv6 option("-6"). The commit 0f06a678 ("samples:
      Add an IPv6 "-6" option to the pktgen scripts") has omitted the addition
      of this option at "sample04" and "sample05".
      
      In order to support IPv6 option, this commit adds logic related to IPv6
      option.
      
      Fixes: 0f06a678 ("samples: Add an IPv6 "-6" option to the pktgen scripts")
      
      Signed-off-by: default avatarJuhee Kang <claudiajkang@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0f0c4f1b
    • Juhee Kang's avatar
      samples: pktgen: pass the environment variable of normal user to sudo · 7caeabd7
      Juhee Kang authored
      
      All pktgen samples can use the environment variable instead of option
      parameters(eg. $DEV is able to use instead of '-i' option).
      
      This is results of running sample as root and user:
      
          // running as root
          # DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample01_simple.sh -v -n 1
          Running... ctrl^C to stop
      
          // running as normal user
          $ DEV=eth0 DEST_IP=10.1.0.1 DST_MAC=00:11:22:33:44:55 ./pktgen_sample01_simple.sh -v -n 1
          [...]
          ERROR: Please specify output device
      
      This results show the sample doesn't work properly when the sample runs
      as normal user. Because the sample is restarted by the function
      (root_check_run_with_sudo) to run with sudo. In this process, the
      environment variable of normal user doesn't propagate to sudo.
      
      It can be solved by using "-E"(--preserve-env) option of "sudo", which
      preserve normal user's existing environment variables. So this commit
      adds "-E" option in the function (root_check_run_with_sudo).
      
      Signed-off-by: default avatarJuhee Kang <claudiajkang@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7caeabd7
  6. Aug 15, 2021
  7. Aug 11, 2021
  8. Aug 10, 2021
  9. Aug 06, 2021
  10. Aug 04, 2021
  11. Aug 01, 2021
  12. Jul 27, 2021
Loading