Skip to content

pktgen: cleanups and introducing new samples/pktgen scripts

Jesper Dangaard Brouer netdev 3 versions – In review

Get series with b4
b4 am 20150521101501.15148.10609.stgit@ivy

Versions newest first · linked by author and title

  1. v3 Latest10 patches 1 replyIn review
  2. v22 of 10 patches 1 replySuperseded
  3. v110 patches 5 repliesSuperseded

Changes in v3 from the cover letter

- Aborted v2 send due it was not generating diff stat (this is a bug in stg-mail, if not in the root directory)

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10pktgen: remove obsolete "max_before_softirq" from pktgen docDocumentation/networking/pktgen.txt+8 -100 replies
2/10pktgen: adjust spacing in proc file interface outputnet/core/pktgen.c+1 -10 replies
3/10pktgen: doc were missing several config optionsDocumentation/networking/pktgen.txt+24 -10 replies
4/10pktgen: document ability to add same device to several threadsDocumentation/networking/pktgen.txt+50 -270 replies
5/10pktgen: make /proc/net/pktgen/pgctrl report fail on invalid inputnet/core/pktgen.c+2 -20 replies
6/10pktgen: new pktgen helper functions for samples scriptssamples/pktgen/README.rst samples/pktgen/functions.sh samples/pktgen/parameters.sh+261 -00 replies
7/10pktgen: add sample script pktgen_sample01_simple.shDocumentation/networking/pktgen.txt samples/pktgen/pktgen.conf-1-1 samples/pktgen/pktgen_sample01_simple.sh+94 -650 replies
8/10pktgen: add sample script pktgen_sample02_multiqueue.shDocumentation/networking/pktgen.txt samples/pktgen/pktgen.conf-2-1 samples/pktgen/pktgen.conf-2-2 +1 more+75 -1410 replies
9/10pktgen: add sample script pktgen_sample03_burst_single_flow.shsamples/pktgen/pktgen_sample03_burst_single_flow.sh+82 -00 replies
10/10pktgen: add benchmark script pktgen_bench_xmit_mode_netif_receive.shsamples/pktgen/pktgen_bench_xmit_mode_netif_receive.sh+86 -00 replies

Reviews trailers per patch

1 of 10 patches has a Reviewed-by or Acked-by.

PatchAlexei Starovoitov
1/10
2/10
3/10
4/10A-b
5/10
6/10
7/10
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [net-next PATCH v3 00/10] pktgen: cleanups and introducing new samples/pktgen scripts

v3:
- Aborted v2 send due it was not generating diff stat (this is a bug in stg-mail, if not in the root directory)

v2: address nitpicks from Cong Wang
- Remove useless cat's, but keep them for old pgset()
- Comment on: Due to pgctrl, cannot use exit code $? from grep
- Use arithmetic compare in pktgen_sample03_burst_single_flow.sh

This patchset is focused on making pktgen easier to use and better documented. It contains a number of documentation updates and minor changes to pktgen. The major contribution is introduction of common helper function for sample scripts.

Instead of the old pgset() function, three new shell functions for configuring the different components of pktgen are introduced:
pg_ctrl(), pg_thread() and pg_set().

The new functions correspond to pktgens different components.
* pg_ctrl() control "pgctrl" (/proc/net/pktgen/pgctrl)
* pg_thread() control the kernel threads and binding to devices
* pg_set() control setup of individual devices

Helpers also provide consistent parameter parsing across the sample scripts.

Usage example:
./pktgen_sample01_simple.sh -i eth41 -m 00:12:C0:02:AC:5A -d 192.168.41.2

Usage: ./pktgen_sample01_simple.sh [-vx] -i ethX

  -i : ($DEV)       output interface/device (required)
  -s : ($PKT_SIZE)  packet size
  -d : ($DEST_IP)   destination IP
  -m : ($DST_MAC)   destination MAC-addr
  -t : ($THREADS)   threads to start
  -c : ($SKB_CLONE) SKB clones send before alloc new SKB
  -b : ($BURST)     HW level bursting of SKBs
  -v : ($VERBOSE)   verbose
  -x : ($DEBUG)     debug

These scripts are borrowed from:
https://github.com/netoptimizer/network-testing/tree/master/pktgen

---

Jesper Dangaard Brouer (10):
pktgen: add benchmark script pktgen_bench_xmit_mode_netif_receive.sh
pktgen: add sample script pktgen_sample03_burst_single_flow.sh
pktgen: add sample script pktgen_sample02_multiqueue.sh
pktgen: add sample script pktgen_sample01_simple.sh
pktgen: new pktgen helper functions for samples scripts
pktgen: make /proc/net/pktgen/pgctrl report fail on invalid input
pktgen: document ability to add same device to several threads
pktgen: doc were missing several config options
pktgen: adjust spacing in proc file interface output
pktgen: remove obsolete "max_before_softirq" from pktgen doc

 Documentation/networking/pktgen.txt                |  141 ++++++++++++++------
 net/core/pktgen.c                                  |    6 -
 samples/pktgen/README.rst                          |   43 ++++++
 samples/pktgen/functions.sh                        |  121 +++++++++++++++++
 samples/pktgen/parameters.sh                       |   97 ++++++++++++++
 samples/pktgen/pktgen.conf-1-1                     |   59 --------
 samples/pktgen/pktgen.conf-2-1                     |   66 ---------
 samples/pktgen/pktgen.conf-2-2                     |   73 ----------
 .../pktgen/pktgen_bench_xmit_mode_netif_receive.sh |   86 ++++++++++++
 samples/pktgen/pktgen_sample01_simple.sh           |   71 ++++++++++
 samples/pktgen/pktgen_sample02_multiqueue.sh       |   75 +++++++++++
 .../pktgen/pktgen_sample03_burst_single_flow.sh    |   82 ++++++++++++
 12 files changed, 678 insertions(+), 242 deletions(-)
 create mode 100644 samples/pktgen/README.rst
 create mode 100644 samples/pktgen/functions.sh
 create mode 100644 samples/pktgen/parameters.sh
 delete mode 100755 samples/pktgen/pktgen.conf-1-1
 delete mode 100755 samples/pktgen/pktgen.conf-2-1
 delete mode 100755 samples/pktgen/pktgen.conf-2-2
 create mode 100755 samples/pktgen/pktgen_bench_xmit_mode_netif_receive.sh
 create mode 100755 samples/pktgen/pktgen_sample01_simple.sh
 create mode 100755 samples/pktgen/pktgen_sample02_multiqueue.sh
 create mode 100755 samples/pktgen/pktgen_sample03_burst_single_flow.sh