diff options
author | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2015-02-23 21:32:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-23 22:03:18 -0500 |
commit | 7c95a9d962f9ffdf02a3d82a6ae108c254a29122 (patch) | |
tree | 0efaf1c8ea66db3315ae45f02023ddd1af7be4ff /samples/pktgen/pktgen.conf-1-1-ip6-rdos | |
parent | ca5b542ccee76e58407c3529f39974d382124093 (diff) |
samples/pktgen: Add sample scripts for pktgen facility
These are Robert Olsson's samples which used to be available from
<ftp://robur.slu.se/pub/Linux/net-development/pktgen-testing/examples/>
but currently are not.
Change the documentation to refer to these consistently as 'sample
scripts', matching the directory name used here.
Cc: Robert Olsson <robert@herjulf.se>
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/pktgen/pktgen.conf-1-1-ip6-rdos')
-rwxr-xr-x | samples/pktgen/pktgen.conf-1-1-ip6-rdos | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/samples/pktgen/pktgen.conf-1-1-ip6-rdos b/samples/pktgen/pktgen.conf-1-1-ip6-rdos new file mode 100755 index 000000000000..fd364277e43f --- /dev/null +++ b/samples/pktgen/pktgen.conf-1-1-ip6-rdos | |||
@@ -0,0 +1,70 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | #modprobe pktgen | ||
4 | |||
5 | |||
6 | function pgset() { | ||
7 | local result | ||
8 | |||
9 | echo $1 > $PGDEV | ||
10 | |||
11 | result=`cat $PGDEV | fgrep "Result: OK:"` | ||
12 | if [ "$result" = "" ]; then | ||
13 | cat $PGDEV | fgrep Result: | ||
14 | fi | ||
15 | } | ||
16 | |||
17 | function pg() { | ||
18 | echo inject > $PGDEV | ||
19 | cat $PGDEV | ||
20 | } | ||
21 | |||
22 | # Config Start Here ----------------------------------------------------------- | ||
23 | |||
24 | |||
25 | # thread config | ||
26 | # Each CPU has own thread. Two CPU exammple. We add eth1, eth2 respectivly. | ||
27 | # IPv6. Note increase in minimal packet length | ||
28 | |||
29 | PGDEV=/proc/net/pktgen/kpktgend_0 | ||
30 | echo "Removing all devices" | ||
31 | pgset "rem_device_all" | ||
32 | echo "Adding eth1" | ||
33 | pgset "add_device eth1" | ||
34 | echo "Setting max_before_softirq 10000" | ||
35 | pgset "max_before_softirq 10000" | ||
36 | |||
37 | |||
38 | # device config | ||
39 | # delay 0 means maximum speed. | ||
40 | |||
41 | # We need to do alloc for every skb since we cannot clone here. | ||
42 | CLONE_SKB="clone_skb 0" | ||
43 | |||
44 | # NIC adds 4 bytes CRC | ||
45 | PKT_SIZE="pkt_size 66" | ||
46 | |||
47 | # COUNT 0 means forever | ||
48 | #COUNT="count 0" | ||
49 | COUNT="count 10000000" | ||
50 | DELAY="delay 0" | ||
51 | |||
52 | PGDEV=/proc/net/pktgen/eth1 | ||
53 | echo "Configuring $PGDEV" | ||
54 | pgset "$COUNT" | ||
55 | pgset "$CLONE_SKB" | ||
56 | pgset "$PKT_SIZE" | ||
57 | pgset "$DELAY" | ||
58 | pgset "dst6_min fec0::1" | ||
59 | pgset "dst6_max fec0::FFFF:FFFF" | ||
60 | |||
61 | pgset "dst_mac 00:04:23:08:91:dc" | ||
62 | |||
63 | # Time to run | ||
64 | PGDEV=/proc/net/pktgen/pgctrl | ||
65 | |||
66 | echo "Running... ctrl^C to stop" | ||
67 | pgset "start" | ||
68 | echo "Done" | ||
69 | |||
70 | # Result can be vieved in /proc/net/pktgen/eth1 | ||