xref: /linux/samples/pktgen/README.rst (revision 69137ea60c9dad58773a1918de6c1b00b088520c)
1b64b0d1eSJesper Dangaard BrouerSample and benchmark scripts for pktgen (packet generator)
2b64b0d1eSJesper Dangaard Brouer==========================================================
3b64b0d1eSJesper Dangaard BrouerThis directory contains some pktgen sample and benchmark scripts, that
4b64b0d1eSJesper Dangaard Brouercan easily be copied and adjusted for your own use-case.
5b64b0d1eSJesper Dangaard Brouer
6b64b0d1eSJesper Dangaard BrouerGeneral doc is located in kernel: Documentation/networking/pktgen.txt
7b64b0d1eSJesper Dangaard Brouer
8b64b0d1eSJesper Dangaard BrouerHelper include files
9b64b0d1eSJesper Dangaard Brouer====================
10b64b0d1eSJesper Dangaard BrouerThis directory contains two helper shell files, that can be "included"
11b64b0d1eSJesper Dangaard Brouerby shell source'ing.  Namely "functions.sh" and "parameters.sh".
12b64b0d1eSJesper Dangaard Brouer
13b64b0d1eSJesper Dangaard BrouerCommon parameters
14b64b0d1eSJesper Dangaard Brouer-----------------
15b64b0d1eSJesper Dangaard BrouerThe parameters.sh file support easy and consistant parameter parsing
16b64b0d1eSJesper Dangaard Broueracross the sample scripts.  Usage example is printed on errors::
17b64b0d1eSJesper Dangaard Brouer
18b64b0d1eSJesper Dangaard Brouer Usage: ./pktgen_sample01_simple.sh [-vx] -i ethX
19b64b0d1eSJesper Dangaard Brouer  -i : ($DEV)       output interface/device (required)
20b64b0d1eSJesper Dangaard Brouer  -s : ($PKT_SIZE)  packet size
21b64b0d1eSJesper Dangaard Brouer  -d : ($DEST_IP)   destination IP
22b64b0d1eSJesper Dangaard Brouer  -m : ($DST_MAC)   destination MAC-addr
23b64b0d1eSJesper Dangaard Brouer  -t : ($THREADS)   threads to start
24b64b0d1eSJesper Dangaard Brouer  -c : ($SKB_CLONE) SKB clones send before alloc new SKB
25*69137ea6STariq Toukan  -n : ($COUNT)     num messages to send per thread, 0 means indefinitely
26b64b0d1eSJesper Dangaard Brouer  -b : ($BURST)     HW level bursting of SKBs
27b64b0d1eSJesper Dangaard Brouer  -v : ($VERBOSE)   verbose
28b64b0d1eSJesper Dangaard Brouer  -x : ($DEBUG)     debug
29b64b0d1eSJesper Dangaard Brouer
30b64b0d1eSJesper Dangaard BrouerThe global variable being set is also listed.  E.g. the required
31b64b0d1eSJesper Dangaard Brouerinterface/device parameter "-i" sets variable $DEV.
32b64b0d1eSJesper Dangaard Brouer
33b64b0d1eSJesper Dangaard BrouerCommon functions
34b64b0d1eSJesper Dangaard Brouer----------------
35b64b0d1eSJesper Dangaard BrouerThe functions.sh file provides; Three different shell functions for
36b64b0d1eSJesper Dangaard Brouerconfiguring the different components of pktgen: pg_ctrl(), pg_thread()
37b64b0d1eSJesper Dangaard Brouerand pg_set().
38b64b0d1eSJesper Dangaard Brouer
39b64b0d1eSJesper Dangaard BrouerThese functions correspond to pktgens different components.
40b64b0d1eSJesper Dangaard Brouer * pg_ctrl()   control "pgctrl" (/proc/net/pktgen/pgctrl)
41b64b0d1eSJesper Dangaard Brouer * pg_thread() control the kernel threads and binding to devices
42b64b0d1eSJesper Dangaard Brouer * pg_set()    control setup of individual devices
43b64b0d1eSJesper Dangaard Brouer
44b64b0d1eSJesper Dangaard BrouerSee sample scripts for usage examples.
45