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 21*40f843eeSDaniel T. Lee -d : ($DEST_IP) destination IP. CIDR (e.g. 198.18.0.0/15) is also allowed 22b64b0d1eSJesper Dangaard Brouer -m : ($DST_MAC) destination MAC-addr 236e32a74aSDaniel T. Lee -p : ($DST_PORT) destination PORT range (e.g. 433-444) is also allowed 24b64b0d1eSJesper Dangaard Brouer -t : ($THREADS) threads to start 25e0e16672STariq Toukan -f : ($F_THREAD) index of first thread (zero indexed CPU number) 26b64b0d1eSJesper Dangaard Brouer -c : ($SKB_CLONE) SKB clones send before alloc new SKB 2769137ea6STariq Toukan -n : ($COUNT) num messages to send per thread, 0 means indefinitely 28b64b0d1eSJesper Dangaard Brouer -b : ($BURST) HW level bursting of SKBs 29b64b0d1eSJesper Dangaard Brouer -v : ($VERBOSE) verbose 30b64b0d1eSJesper Dangaard Brouer -x : ($DEBUG) debug 31b64b0d1eSJesper Dangaard Brouer 32b64b0d1eSJesper Dangaard BrouerThe global variable being set is also listed. E.g. the required 33b64b0d1eSJesper Dangaard Brouerinterface/device parameter "-i" sets variable $DEV. 34b64b0d1eSJesper Dangaard Brouer 35b64b0d1eSJesper Dangaard BrouerCommon functions 36b64b0d1eSJesper Dangaard Brouer---------------- 37b64b0d1eSJesper Dangaard BrouerThe functions.sh file provides; Three different shell functions for 38b64b0d1eSJesper Dangaard Brouerconfiguring the different components of pktgen: pg_ctrl(), pg_thread() 39b64b0d1eSJesper Dangaard Brouerand pg_set(). 40b64b0d1eSJesper Dangaard Brouer 41b64b0d1eSJesper Dangaard BrouerThese functions correspond to pktgens different components. 42b64b0d1eSJesper Dangaard Brouer * pg_ctrl() control "pgctrl" (/proc/net/pktgen/pgctrl) 43b64b0d1eSJesper Dangaard Brouer * pg_thread() control the kernel threads and binding to devices 44b64b0d1eSJesper Dangaard Brouer * pg_set() control setup of individual devices 45b64b0d1eSJesper Dangaard Brouer 46b64b0d1eSJesper Dangaard BrouerSee sample scripts for usage examples. 47