]> git.ipfire.org Git - people/arne_f/kernel.git/blame - samples/pktgen/pktgen.conf-1-1-ip6-rdos
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[people/arne_f/kernel.git] / samples / pktgen / pktgen.conf-1-1-ip6-rdos
CommitLineData
db72aba3 1#!/bin/bash
b2441318 2# SPDX-License-Identifier: GPL-2.0
7c95a9d9
BH
3
4#modprobe pktgen
5
6
7function pgset() {
8 local result
9
10 echo $1 > $PGDEV
11
12 result=`cat $PGDEV | fgrep "Result: OK:"`
13 if [ "$result" = "" ]; then
14 cat $PGDEV | fgrep Result:
15 fi
16}
17
7c95a9d9
BH
18# Config Start Here -----------------------------------------------------------
19
20
21# thread config
2ad1cdf2 22# Each CPU has its own thread. One CPU example. We add eth1.
7c95a9d9
BH
23# IPv6. Note increase in minimal packet length
24
25PGDEV=/proc/net/pktgen/kpktgend_0
26 echo "Removing all devices"
27 pgset "rem_device_all"
28 echo "Adding eth1"
29 pgset "add_device eth1"
7c95a9d9
BH
30
31
32# device config
33# delay 0 means maximum speed.
34
35# We need to do alloc for every skb since we cannot clone here.
36CLONE_SKB="clone_skb 0"
37
38# NIC adds 4 bytes CRC
39PKT_SIZE="pkt_size 66"
40
41# COUNT 0 means forever
42#COUNT="count 0"
43COUNT="count 10000000"
44DELAY="delay 0"
45
46PGDEV=/proc/net/pktgen/eth1
47 echo "Configuring $PGDEV"
48 pgset "$COUNT"
49 pgset "$CLONE_SKB"
50 pgset "$PKT_SIZE"
51 pgset "$DELAY"
52 pgset "dst6_min fec0::1"
53 pgset "dst6_max fec0::FFFF:FFFF"
54
55 pgset "dst_mac 00:04:23:08:91:dc"
56
57# Time to run
58PGDEV=/proc/net/pktgen/pgctrl
59
60 echo "Running... ctrl^C to stop"
16b5d0c4 61 trap true INT
7c95a9d9
BH
62 pgset "start"
63 echo "Done"
4062bd25 64 cat /proc/net/pktgen/eth1