Skip to content

Commit d2ee797

Browse files
0x7f454c46davem330
authored andcommitted
Documentation/pktgen: Clearify how-to use pktgen samples
o Change process name in ps output: looks like, these days the process is named kpktgend_<cpu>, rather than pktgen/<cpu>. o Use pg_ctrl for start/stop as it can work well with pgset without changes to $(PGDEV) variable. o Clarify a bit needed $(PGDEV) definition for sample scripts and that one needs to `source functions.sh`. o Document how-to unset a behaviour flag, note about history expansion. o Fix pgset spi parameter value. Cc: Jonathan Corbet <[email protected]> Cc: [email protected] Signed-off-by: Dmitry Safonov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 969ade4 commit d2ee797

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

Documentation/networking/pktgen.txt

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ suitable sample script and configure that.
1212
On a dual CPU:
1313

1414
ps aux | grep pkt
15-
root 129 0.3 0.0 0 0 ? SW 2003 523:20 [pktgen/0]
16-
root 130 0.3 0.0 0 0 ? SW 2003 509:50 [pktgen/1]
15+
root 129 0.3 0.0 0 0 ? SW 2003 523:20 [kpktgend_0]
16+
root 130 0.3 0.0 0 0 ? SW 2003 509:50 [kpktgend_1]
1717

1818

1919
For monitoring and control pktgen creates:
@@ -113,9 +113,16 @@ Configuring devices
113113
===================
114114
This is done via the /proc interface, and most easily done via pgset
115115
as defined in the sample scripts.
116+
You need to specify PGDEV environment variable to use functions from sample
117+
scripts, i.e.:
118+
export PGDEV=/proc/net/pktgen/eth4@0
119+
source samples/pktgen/functions.sh
116120

117121
Examples:
118122

123+
pg_ctrl start starts injection.
124+
pg_ctrl stop aborts injection. Also, ^C aborts generator.
125+
119126
pgset "clone_skb 1" sets the number of copies of the same packet
120127
pgset "clone_skb 0" use single SKB for all transmits
121128
pgset "burst 8" uses xmit_more API to queue 8 copies of the same
@@ -165,8 +172,12 @@ Examples:
165172
IPSEC # IPsec encapsulation (needs CONFIG_XFRM)
166173
NODE_ALLOC # node specific memory allocation
167174
NO_TIMESTAMP # disable timestamping
175+
pgset 'flag ![name]' Clear a flag to determine behaviour.
176+
Note that you might need to use single quote in
177+
interactive mode, so that your shell wouldn't expand
178+
the specified flag as a history command.
168179

169-
pgset spi SPI_VALUE Set specific SA used to transform packet.
180+
pgset "spi [SPI_VALUE]" Set specific SA used to transform packet.
170181

171182
pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then
172183
cycle through the port range.
@@ -207,8 +218,6 @@ Examples:
207218
pgset "tos XX" set former IPv4 TOS field (e.g. "tos 28" for AF11 no ECN, default 00)
208219
pgset "traffic_class XX" set former IPv6 TRAFFIC CLASS (e.g. "traffic_class B8" for EF no ECN, default 00)
209220

210-
pgset stop aborts injection. Also, ^C aborts generator.
211-
212221
pgset "rate 300M" set rate to 300 Mb/s
213222
pgset "ratep 1000000" set rate to 1Mpps
214223

0 commit comments

Comments
 (0)