Skip to content

Commit cf7ed01

Browse files
committed
xdp-trafficgen: Document the 'probe' command
The 'probe' command was missing from the top-level help output, and the man page. Let's add it to both. Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
1 parent cf980d8 commit cf7ed01

File tree

3 files changed

+76
-1
lines changed

3 files changed

+76
-1
lines changed

xdp-trafficgen/README.org

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Usage: xdp-trafficgen COMMAND [options]
2828
COMMAND can be one of:
2929
udp - run in UDP mode
3030
tcp - run in TCP mode
31+
probe - probe kernel support
3132
#+end_src
3233

3334
Each command, and its options are explained below. Or use =xdp-trafficgen COMMAND
@@ -151,6 +152,39 @@ Display version information and exit.
151152
** -h, --help
152153
Display a summary of the available options
153154

155+
* The PROBE command
156+
The PROBE command probes the kernel to discover whether it supports the features
157+
needed to run xdp-trafficgen. This can be used to discover whether the running
158+
kernel is compatible with xdp-trafficgen, as well as to discover whether a
159+
particular interface supports sending packets generated by xdp-trafficgen.
160+
161+
The syntax for the =probe= command is:
162+
163+
=xdp-trafficgen probe [options]=
164+
165+
After probing, xdp-trafficgen will print the results of the probing of the
166+
kernel, and (if an interface name is supplied), whether the interface supports
167+
sending packets generated by xdp-trafficgen. The exit code will be 0 if all
168+
probes succeed, and 1 otherwise.
169+
170+
Note that the probing relies on the kernel XDP feature reporting, which was
171+
added after the XDP support itself. This means that with some older kernel
172+
versions, the probing may fail even though xdp-trafficgen would in fact be able
173+
to transmit packets.
174+
175+
The supported options are:
176+
177+
** -i, --ifname <ifname>
178+
Probe the supplied interface name, in addition to doing the general kernel probing.
179+
180+
** -v, --verbose
181+
Enable verbose logging (-vv: more verbose).
182+
183+
** --version
184+
Display version information and exit.
185+
186+
** -h, --help
187+
Display a summary of the available options
154188

155189
* BUGS
156190

xdp-trafficgen/xdp-trafficgen.8

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "xdp-trafficgen" "8" "JANUARY 9, 2025" "V1.5.5" "An XDP-based traffic generator"
1+
.TH "xdp-trafficgen" "8" "MAY 28, 2025" "V1.5.5" "An XDP-based traffic generator"
22
.SH "NAME"
33
XDP-trafficgen \- an XDP-based traffic generator
44
.SH "SYNOPSIS"
@@ -23,6 +23,7 @@ The syntax for running xdp-trafficgen is:
2323
COMMAND can be one of:
2424
udp - run in UDP mode
2525
tcp - run in TCP mode
26+
probe - probe kernel support
2627
\fP
2728
.fi
2829
.RE
@@ -156,6 +157,45 @@ Display version information and exit.
156157
.SS "-h, --help"
157158
.PP
158159
Display a summary of the available options
160+
.SH "The PROBE command"
161+
.PP
162+
The PROBE command probes the kernel to discover whether it supports the features
163+
needed to run xdp-trafficgen. This can be used to discover whether the running
164+
kernel is compatible with xdp-trafficgen, as well as to discover whether a
165+
particular interface supports sending packets generated by xdp-trafficgen.
166+
167+
.PP
168+
The syntax for the \fIprobe\fP command is:
169+
170+
.PP
171+
\fIxdp\-trafficgen probe [options]\fP
172+
173+
.PP
174+
After probing, xdp-trafficgen will print the results of the probing of the
175+
kernel, and (if an interface name is supplied), whether the interface supports
176+
sending packets generated by xdp-trafficgen. The exit code will be 0 if all
177+
probes succeed, and 1 otherwise.
178+
179+
.PP
180+
Note that the probing relies on the kernel XDP feature reporting, which was
181+
added after the XDP support itself. This means that with some older kernel
182+
versions, the probing may fail even though xdp-trafficgen would in fact be able
183+
to transmit packets.
184+
185+
.PP
186+
The supported options are:
187+
.SS "-i, --ifname <ifname>"
188+
.PP
189+
Probe the supplied interface name, in addition to doing the general kernel probing.
190+
.SS "-v, --verbose"
191+
.PP
192+
Enable verbose logging (-vv: more verbose).
193+
.SS "--version"
194+
.PP
195+
Display version information and exit.
196+
.SS "-h, --help"
197+
.PP
198+
Display a summary of the available options
159199
.SH "BUGS"
160200
.PP
161201
Please report any bugs on Github: \fIhttps://github.com/xdp-project/xdp-tools/issues\fP

xdp-trafficgen/xdp-trafficgen.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,7 @@ int do_help(__unused const void *cfg, __unused const char *pin_root_path)
10561056
"COMMAND can be one of:\n"
10571057
" udp - run in UDP mode\n"
10581058
" tcp - run in TCP mode\n"
1059+
" probe - probe kernel support\n"
10591060
" help - show this help message\n"
10601061
"\n"
10611062
"Use 'xdp-trafficgen COMMAND --help' to see options for each command\n");

0 commit comments

Comments
 (0)