01 May, 2020
1 commit
-
- add SPDX header;
- adjust title markup;
- use bold markups on a few places;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.Signed-off-by: Mauro Carvalho Chehab
Signed-off-by: David S. Miller
07 Oct, 2019
4 commits
-
Currently, kernel pktgen has the feature to specify destination
address range for sending packet. (e.g. pgset "dst_min/dst_max")But on samples, each pktgen script doesn't have any option to achieve this.
This commit adds the feature to specify the destination address range with CIDR.
-d : ($DEST_IP) destination IP. CIDR (e.g. 198.18.0.0/15) is also allowed
# ./pktgen_sample01_simple.sh -6 -d fe80::20/126 -p 3000 -n 4
# tcpdump ip6 and udp
05:14:18.082285 IP6 fe80::99.71 > fe80::23.3000: UDP, length 16
05:14:18.082564 IP6 fe80::99.43 > fe80::23.3000: UDP, length 16
05:14:18.083366 IP6 fe80::99.107 > fe80::22.3000: UDP, length 16
05:14:18.083585 IP6 fe80::99.97 > fe80::21.3000: UDP, length 16Signed-off-by: Daniel T. Lee
Acked-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller -
This commit adds CIDR parsing and IP validate helper function to parse
single IP or range of IP with CIDR. (e.g. 198.18.0.0/15)Validating the address should be preceded prior to the parsing.
Helpers will be used in prior to set target address in samples/pktgen.Signed-off-by: Daniel T. Lee
Acked-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller -
Currently, proc_cmd is used to dispatch command to 'pg_ctrl', 'pg_thread',
'pg_set'. proc_cmd is designed to check command result with grep the
"Result:", but this might fail since this string is only shown in
'pg_thread' and 'pg_set'.This commit fixes this logic by grep-ing the "Result:" string only when
the command is not for 'pg_ctrl'.For clarity of an execution flow, 'errexit' flag has been set.
To cleanup pktgen on exit, trap has been added for EXIT signal.
Signed-off-by: Daniel T. Lee
Acked-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller -
This commit changes variable names that can cause confusion.
For example, variable DST_MIN is quite confusing since the
keyword 'udp_dst_min' and keyword 'dst_min' is used with pg_ctrl.On the following commit, 'dst_min' will be used to set destination IP,
and the existing variable name DST_MIN should be changed.Variable names are matched to the exact keyword used with pg_ctrl.
Signed-off-by: Daniel T. Lee
Acked-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller
02 Jul, 2019
2 commits
-
Currently, kernel pktgen has the feature to specify udp destination port
for sending packet. (e.g. pgset "udp_dst_min 9")But on samples, each of the scripts doesn't have any option to achieve this.
This commit adds the DST_PORT option to specify the target port(s) in the script.
-p : ($DST_PORT) destination PORT range (e.g. 433-444) is also allowed
Signed-off-by: Daniel T. Lee
Acked-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller -
This commit adds port parsing and port validate helper function to parse
single or range of port(s) from a given string. (e.g. 1234, 443-444)Helpers will be used in prior to set target port(s) in samples/pktgen.
Signed-off-by: Daniel T. Lee
Acked-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller
04 Nov, 2017
1 commit
-
Files removed in 'net-next' had their license header updated
in 'net'. We take the remove from 'net-next'.Signed-off-by: David S. Miller
02 Nov, 2017
5 commits
-
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.By default all files without license information are under the default
license of the kernel, which is GPL version 2.Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman -
Since commit 0f06a6787e05 ("samples: Add an IPv6 '-6' option to the
pktgen scripts") the newer pktgen_sampleXX script does show howto use
IPv6 with pktgen.Thus, there is no longer a reason to keep the older sample scripts around.
Signed-off-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller -
Like sample05, don't use pktgen clone_skb feature when using 'burst' feature,
it is not really needed. This brings the burst users in sync.Signed-off-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller -
This script simply does:
* Detect $DEV's NUMA node belonging.
* Bind each thread (processor of NUMA locality) with each $DEV queue's
irq affinity, 1:1 mapping.* How many '-t' threads input determines how many queues will be utilized.
If '-f' designates first cpu id, then offset in the NUMA node's cpu list.
(Changes by Jesper: allow changing count from cmdline via '-n')
Signed-off-by: Robert Hoo
Signed-off-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller -
1. given a device, get its NUMA belongings
2. given a device, get its queues' irq numbers.
3. given a NUMA node, get its cpu id list.Signed-off-by: Robert Hoo
Signed-off-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller
17 Jun, 2017
2 commits
-
Use "-f ", to specify the index of the first
sender thread.
In default first thread is #0.Signed-off-by: Tariq Toukan
Cc: Jesper Dangaard Brouer
Acked-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller -
Use -n , to specify the number of packets every
thread sends.
Zero means indefinitely.Signed-off-by: Tariq Toukan
Cc: Jesper Dangaard Brouer
Acked-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller
21 Jul, 2016
1 commit
-
Add a '-6' option to the sample pktgen scripts for sending out
IPv6 packets.[root@kerneldev010.prn1 ~/pktgen]# ./pktgen_sample03_burst_single_flow.sh -i eth0 -s 64 -d fe80::f652:14ff:fec2:a14c -m f4:52:14:c2:a1:4c -b 32 -6
[root@kerneldev011.prn1 ~]# tcpdump -i eth0 -nn -c3 port 9
tcpdump: WARNING: eth0: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
14:38:51.815297 IP6 fe80::f652:14ff:fec2:2ad2.9 > fe80::f652:14ff:fec2:a14c.9: UDP, length 16
14:38:51.815311 IP6 fe80::f652:14ff:fec2:2ad2.9 > fe80::f652:14ff:fec2:a14c.9: UDP, length 16
14:38:51.815313 IP6 fe80::f652:14ff:fec2:2ad2.9 > fe80::f652:14ff:fec2:a14c.9: UDP, length 16Signed-off-by: Martin KaFai Lau
Acked-by: Alexei Starovoitov
Signed-off-by: David S. Miller
15 Jul, 2016
3 commits
-
Removing the pktgen sample script pktgen.conf-1-1-rdos, because
it does not contain anything that is not covered by the other and
newer style sample scripts.Signed-off-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller -
This pktgen sample script is useful for scalability testing a
receiver. The script will simply generate one flow per
thread (option -t N) using the thread number as part of the
source IP-address.The single flow sample (pktgen_sample03_burst_single_flow.sh)
have become quite popular, but it is important that developers
also make sure to benchmark scalability of multiple receive
queues.Signed-off-by: Jesper Dangaard Brouer
Acked-by: Alexei Starovoitov
Signed-off-by: David S. Miller -
Adding a pktgen sample script that demonstrates how to use pktgen
for simulating flows. Script will generate a certain number of
concurrent flows ($FLOWS) and each flow will contain $FLOWLEN
packets, which will be send back-to-back, before switching to a
new flow, due to flag FLOW_SEQ.This script obsoletes the old sample script 'pktgen.conf-1-1-flows',
which is removed.Signed-off-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller
05 Jul, 2016
1 commit
-
This adds samples for pktgen to use with new mode to inject pkts into
the qdisc layer. This also doubles as nice test cases to test any
patches against qdisc layer.Signed-off-by: John Fastabend
Signed-off-by: David S. Miller
23 May, 2015
5 commits
-
This script pktgen_bench_xmit_mode_netif_receive.sh is a benchmark
script, which can be used for benchmarking part of the network stack.
This can be used for performance improving or catching regression in
that area.The script is developed for benchmarking ingress qdisc path, original
idea by Alexei Starovoitov. This script don't really need any
hardware. This is achieved via the recently introduced stack inject
feature "xmit_mode netif_receive". See commit 62f64aed622b6 ("pktgen:
introduce xmit_mode ''").Signed-off-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller -
Add the pktgen samples script pktgen_sample03_burst_single_flow.sh
that demonstrates how to acheive maximum performance.If correctly tuned[1] single CPU 10Gbit/s wirespeed small pkts is
possible[2] which is 14.88Mpps. The trick is to take advantage of the
"burst" feature introduced in commit 38b2cf2982dc73 ("net: pktgen:
packet bursting via skb->xmit_more").[1] http://netoptimizer.blogspot.dk/2014/06/pktgen-for-network-overload-testing.html
[2] http://netoptimizer.blogspot.dk/2014/10/unlocked-10gbps-tx-wirespeed-smallest.htmlSigned-off-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller -
Add the pktgen samples script pktgen_sample02_multiqueue.sh that
demonstrates generating packets on multiqueue NICs.Specifically notice the options "-t" that specifies how many
kernel threads to activate. Also notice the flag QUEUE_MAP_CPU,
which cause the SKB TX queue to be mapped to the CPU running the
kernel thread. For best scalability people are also encourage to
map NIC IRQ /proc/irq/*/smp_affinity to CPU number.Usage example with "-t" 4 threads and help:
./pktgen_sample02_multiqueue.sh -i eth4 -m 00:1B:21:3C:9D:F8 -t 4Usage: ./pktgen_sample02_multiqueue.sh [-vx] -i ethX
-i : ($DEV) output interface/device (required)
-s : ($PKT_SIZE) packet size
-d : ($DEST_IP) destination IP
-m : ($DST_MAC) destination MAC-addr
-t : ($THREADS) threads to start
-c : ($SKB_CLONE) SKB clones send before alloc new SKB
-b : ($BURST) HW level bursting of SKBs
-v : ($VERBOSE) verbose
-x : ($DEBUG) debugRemoving pktgen.conf-2-1 and pktgen.conf-2-2 as these examples
should be covered now.Signed-off-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller -
Add the first basic pktgen samples script pktgen_sample01_simple.sh,
which demonstrates the a simple use of the helper functions.
Removing pktgen.conf-1-1 as that example should be covered now.The naming scheme pktgen_sampleNN, where NN is a number, should encourage
reading the samples in a specific order.Script cause pktgen sending with a single thread and single interface,
and introduce flow variation via random UDP source port.Usage example and help:
./pktgen_sample01_simple.sh -i eth4 -m 00:1B:21:3C:9D:F8 -d 192.168.8.2Usage: ./pktgen_sample01_simple.sh [-vx] -i ethX
-i : ($DEV) output interface/device (required)
-s : ($PKT_SIZE) packet size
-d : ($DEST_IP) destination IP
-m : ($DST_MAC) destination MAC-addr
-c : ($SKB_CLONE) SKB clones send before alloc new SKB
-v : ($VERBOSE) verbose
-x : ($DEBUG) debugSigned-off-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller -
Preparing for removing existing samples/pktgen/ scripts, and
replacing these with easier to use samples.This commit provides two helper shell files, that can
be "included" by shell source'ing. Namely "functions.sh"
and "parameters.sh".The parameters.sh file support easy and consistant parameter
parsing across the sample scripts. Usage example is printed on
errors.The functions.sh file provides, three new shell functions for
configuring the different components of pktgen: pg_ctrl(),
pg_thread() and pg_set(). A slightly improved version of the old
pgset() function is also provided for backwards compat.The new functions correspond to pktgens different components.
* pg_ctrl() control "pgctrl" (/proc/net/pktgen/pgctrl)
* pg_thread() control the kernel threads and binding to devices
* pg_set() control setup of individual devicesThese changes are borrowed from:
https://github.com/netoptimizer/network-testing/tree/master/pktgenSigned-off-by: Jesper Dangaard Brouer
Signed-off-by: David S. Miller
24 Feb, 2015
7 commits
-
Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller -
Otherwise ^C stops the script, not just pktgen.
Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller -
These scripts use the non-POSIX 'function' and 'local' keywords so
they won't work with every /bin/sh. We could drop 'function' as it is
a no-op, but 'local' makes for cleaner scripts. Require use of bash.Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller -
Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller -
They all claimed to be two CPU examples using eth1, eth2 but
that is only true in one case!Rob Jones pointed out spelling and grammar errors here, which I've
also corrected.Cc: Rob Jones
Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller -
This function is not used and wouldn't do anything useful as
pktgen does not have an 'inject' command.Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller -
These are Robert Olsson's samples which used to be available from
but currently are not.
Change the documentation to refer to these consistently as 'sample
scripts', matching the directory name used here.Cc: Robert Olsson
Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller