samples/pktgen: Correct comments about the thread config
[cascardo/linux.git] / samples / pktgen / pktgen.conf-2-1
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 # Config Start Here -----------------------------------------------------------
18
19
20 # thread config
21 # Each CPU has its own thread. Two CPU example. We add eth1 to the first
22 # and leave the second idle.
23
24 PGDEV=/proc/net/pktgen/kpktgend_0
25   echo "Removing all devices"
26  pgset "rem_device_all"
27   echo "Adding eth1"
28  pgset "add_device eth1"
29   echo "Setting max_before_softirq 10000"
30  pgset "max_before_softirq 10000"
31
32 # We need to remove old config since we dont use this thread. We can only
33 # one NIC on one CPU due to affinity reasons.
34
35 PGDEV=/proc/net/pktgen/kpktgend_1
36   echo "Removing all devices"
37  pgset "rem_device_all"
38
39 # device config
40 # delay 0 means maximum speed.
41
42 CLONE_SKB="clone_skb 1000000"
43 # NIC adds 4 bytes CRC
44 PKT_SIZE="pkt_size 60"
45
46 # COUNT 0 means forever
47 #COUNT="count 0"
48 COUNT="count 10000000"
49 DELAY="delay 0"
50
51 PGDEV=/proc/net/pktgen/eth1
52   echo "Configuring $PGDEV"
53  pgset "$COUNT"
54  pgset "$CLONE_SKB"
55  pgset "$PKT_SIZE"
56  pgset "$DELAY"
57  pgset "dst 10.10.11.2"
58  pgset "dst_mac  00:04:23:08:91:dc"
59
60
61 # Time to run
62 PGDEV=/proc/net/pktgen/pgctrl
63
64  echo "Running... ctrl^C to stop"
65  pgset "start"
66  echo "Done"
67
68 # Result can be vieved in /proc/net/pktgen/eth1