Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Dmitry Safonov and committed by
David S. Miller
d2ee7973 969ade40

+14 -5
+14 -5
Documentation/networking/pktgen.txt
··· 12 12 On a dual CPU: 13 13 14 14 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] 17 17 18 18 19 19 For monitoring and control pktgen creates: ··· 113 113 =================== 114 114 This is done via the /proc interface, and most easily done via pgset 115 115 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 116 120 117 121 Examples: 122 + 123 + pg_ctrl start starts injection. 124 + pg_ctrl stop aborts injection. Also, ^C aborts generator. 118 125 119 126 pgset "clone_skb 1" sets the number of copies of the same packet 120 127 pgset "clone_skb 0" use single SKB for all transmits ··· 172 165 IPSEC # IPsec encapsulation (needs CONFIG_XFRM) 173 166 NODE_ALLOC # node specific memory allocation 174 167 NO_TIMESTAMP # disable timestamping 168 + pgset 'flag ![name]' Clear a flag to determine behaviour. 169 + Note that you might need to use single quote in 170 + interactive mode, so that your shell wouldn't expand 171 + the specified flag as a history command. 175 172 176 - pgset spi SPI_VALUE Set specific SA used to transform packet. 173 + pgset "spi [SPI_VALUE]" Set specific SA used to transform packet. 177 174 178 175 pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then 179 176 cycle through the port range. ··· 217 206 218 207 pgset "tos XX" set former IPv4 TOS field (e.g. "tos 28" for AF11 no ECN, default 00) 219 208 pgset "traffic_class XX" set former IPv6 TRAFFIC CLASS (e.g. "traffic_class B8" for EF no ECN, default 00) 220 - 221 - pgset stop aborts injection. Also, ^C aborts generator. 222 209 223 210 pgset "rate 300M" set rate to 300 Mb/s 224 211 pgset "ratep 1000000" set rate to 1Mpps