Jesper Dangaard Brouer | b64b0d1 | 2015-05-21 12:17:19 +0200 | [diff] [blame] | 1 | Sample and benchmark scripts for pktgen (packet generator) |
| 2 | ========================================================== |
| 3 | This directory contains some pktgen sample and benchmark scripts, that |
| 4 | can easily be copied and adjusted for your own use-case. |
| 5 | |
| 6 | General doc is located in kernel: Documentation/networking/pktgen.txt |
| 7 | |
| 8 | Helper include files |
| 9 | ==================== |
| 10 | This directory contains two helper shell files, that can be "included" |
| 11 | by shell source'ing. Namely "functions.sh" and "parameters.sh". |
| 12 | |
| 13 | Common parameters |
| 14 | ----------------- |
| 15 | The parameters.sh file support easy and consistant parameter parsing |
| 16 | across the sample scripts. Usage example is printed on errors:: |
| 17 | |
| 18 | Usage: ./pktgen_sample01_simple.sh [-vx] -i ethX |
| 19 | -i : ($DEV) output interface/device (required) |
| 20 | -s : ($PKT_SIZE) packet size |
| 21 | -d : ($DEST_IP) destination IP |
| 22 | -m : ($DST_MAC) destination MAC-addr |
| 23 | -t : ($THREADS) threads to start |
Tariq Toukan | e0e1667 | 2017-06-15 19:07:22 +0300 | [diff] [blame] | 24 | -f : ($F_THREAD) index of first thread (zero indexed CPU number) |
Jesper Dangaard Brouer | b64b0d1 | 2015-05-21 12:17:19 +0200 | [diff] [blame] | 25 | -c : ($SKB_CLONE) SKB clones send before alloc new SKB |
Tariq Toukan | 69137ea | 2017-06-15 19:07:21 +0300 | [diff] [blame] | 26 | -n : ($COUNT) num messages to send per thread, 0 means indefinitely |
Jesper Dangaard Brouer | b64b0d1 | 2015-05-21 12:17:19 +0200 | [diff] [blame] | 27 | -b : ($BURST) HW level bursting of SKBs |
| 28 | -v : ($VERBOSE) verbose |
| 29 | -x : ($DEBUG) debug |
| 30 | |
| 31 | The global variable being set is also listed. E.g. the required |
| 32 | interface/device parameter "-i" sets variable $DEV. |
| 33 | |
| 34 | Common functions |
| 35 | ---------------- |
| 36 | The functions.sh file provides; Three different shell functions for |
| 37 | configuring the different components of pktgen: pg_ctrl(), pg_thread() |
| 38 | and pg_set(). |
| 39 | |
| 40 | These functions correspond to pktgens different components. |
| 41 | * pg_ctrl() control "pgctrl" (/proc/net/pktgen/pgctrl) |
| 42 | * pg_thread() control the kernel threads and binding to devices |
| 43 | * pg_set() control setup of individual devices |
| 44 | |
| 45 | See sample scripts for usage examples. |