1xdp-monitor(8) A simple XDP monitoring tool xdp-monitor(8)
2
3
4
6 XDP-monitor - a simple BPF-powered XDP monitoring tool
7
9 XDP-monitor is a tool that monitors various XDP related statistics and
10 events using BPF tracepoints infrastructure, trying to be as low over‐
11 head as possible.
12
13
14 Note that by default, statistics for successful XDP redirect events is
15 disabled, as that leads to a per-packet BPF tracing overhead, which
16 while being low overhead, can lead to packet processing degradation.
17
18
19 This tool relies on the BPF raw tracepoints infrastructure in the ker‐
20 nel.
21
22
23 There is more information on the meaning of the output in both default
24 (terse) and verbose output mode, in the Output Format Description sec‐
25 tion.
26
27
28 Running xdp-monitor
29 The syntax for running xdp-monitor is:
30
31 xdp-monitor [options]
32
33
34 The supported options are:
35
36
37 -i, --interval <SECONDS>
38 Set the polling interval for collecting all statistics and displaying
39 them to the output. The unit of interval is in seconds.
40
41
42 -s, --stats
43 Enable statistics for successful redirection. This option comes with a
44 per packet tracing overhead, for recording all successful redirections.
45
46
47 -e, --extended
48 Start xdp-bench in "extended" output mode. If not set, xdp-bench will
49 start in "terse" mode. The output mode can be switched by hitting
50 C-$ while the program is running. See also the Output Format Descrip‐
51 tion section below.
52
53
54 -v, --verbose
55 Enable verbose logging. Supply twice to enable verbose logging from the
56 underlying libxdp and libbpf libraries.
57
58
59 --version
60 Show the application version and exit.
61
62
63 -h, --help
64 Display a summary of the available options
65
66
68 By default, redirect success statistics are disabled, use --stats to
69 enable. The terse output mode is default, extended output mode can be
70 activated using the --extended command line option.
71
72
73 SIGQUIT (Ctrl + \) can be used to switch the mode dynamically at run‐
74 time.
75
76
77 Terse mode displays at most the following fields:
78 rx/s Number of packets received per second
79 redir/s Number of packets successfully redirected per second
80 err,drop/s Aggregated count of errors per second (including dropped packets)
81 xmit/s Number of packets transmitted on the output device per second
82
83
84 Verbose output mode displays at most the following fields:
85 FIELD DESCRIPTION
86 receive Displays the number of packets received and errors encountered
87
88 Whenever an error or packet drop occurs, details of per CPU error
89 and drop statistics will be expanded inline in terse mode.
90 pkt/s - Packets received per second
91 drop/s - Packets dropped per second
92 error/s - Errors encountered per second
93 redirect - Displays the number of packets successfully redirected
94 Errors encountered are expanded under redirect_err field
95 Note that passing -s to enable it has a per packet overhead
96 redir/s - Packets redirected successfully per second
97
98
99 redirect_err Displays the number of packets that failed redirection
100
101 The errno is expanded under this field with per CPU count
102 The recognized errors are:
103 EINVAL: Invalid redirection
104 ENETDOWN: Device being redirected to is down
105 EMSGSIZE: Packet length too large for device
106 EOPNOTSUPP: Operation not supported
107 ENOSPC: No space in ptr_ring of cpumap kthread
108
109 error/s - Packets that failed redirection per second
110
111
112 enqueue to cpu N Displays the number of packets enqueued to bulk queue of CPU N
113 Expands to cpu:FROM->N to display enqueue stats for each CPU enqueuing to CPU N
114 Received packets can be associated with the CPU redirect program is enqueuing
115 packets to.
116 pkt/s - Packets enqueued per second from other CPU to CPU N
117 drop/s - Packets dropped when trying to enqueue to CPU N
118 bulk-avg - Average number of packets processed for each event
119
120
121 kthread Displays the number of packets processed in CPUMAP kthread for each CPU
122 Packets consumed from ptr_ring in kthread, and its xdp_stats (after calling
123 CPUMAP bpf prog) are expanded below this. xdp_stats are expanded as a total and
124 then per-CPU to associate it to each CPU's pinned CPUMAP kthread.
125 pkt/s - Packets consumed per second from ptr_ring
126 drop/s - Packets dropped per second in kthread
127 sched - Number of times kthread called schedule()
128
129 xdp_stats (also expands to per-CPU counts)
130 pass/s - XDP_PASS count for CPUMAP program execution
131 drop/s - XDP_DROP count for CPUMAP program execution
132 redir/s - XDP_REDIRECT count for CPUMAP program execution
133
134
135 xdp_exception Displays xdp_exception tracepoint events
136
137 This can occur due to internal driver errors, unrecognized
138 XDP actions and due to explicit user trigger by use of XDP_ABORTED
139 Each action is expanded below this field with its count
140 hit/s - Number of times the tracepoint was hit per second
141
142
143 devmap_xmit Displays devmap_xmit tracepoint events
144
145 This tracepoint is invoked for successful transmissions on output
146 device but these statistics are not available for generic XDP mode,
147 hence they will be omitted from the output when using SKB mode
148 xmit/s - Number of packets that were transmitted per second
149 drop/s - Number of packets that failed transmissions per second
150 drv_err/s - Number of internal driver errors per second
151 bulk-avg - Average number of packets processed for each event
152
153
155 Please report any bugs on Github: https://github.com/xdp-project/xdp-
156 tools/issues
157
158
160 The original xdp-monitor tool was written by Jesper Dangaard Brouer. It
161 was then rewritten to support more features by Kumar Kartikeya Dwivedi.
162 This man page was written by Kumar Kartikeya Dwivedi.
163
164
165
166V1.4.1 OCTOBER 20, 2023 xdp-monitor(8)