xdp-monitor(8)
π NAME π
XDP-monitor β a simple, BPF-powered XDP monitoring tool. bestie, it just watches your XDP stuff and tells you what's up β¨
πΈ SYNOPSIS πΈ
XDP-monitor is that girl who monitors various XDP related statistics and events, using the BPF tracepoints infrastructure, and she's trying so hard to be as low overhead as possible. π«Ά
β οΈ Heads up: by default, statistics for successful XDP redirect events is disabled, because turning that on means a per-packet BPF tracing overhead. like yeah it's low overhead, but it can still lead to packet processing degradation. not cute. π
This tool relies on the BPF raw tracepoints infrastructure in the kernel. periodt.
There's more info on what all the output actually means, both in default (terse) mode and verbose mode, down in the Output Format Description section. iykyk π
β¨ Running xdp-monitor β¨
The syntax for running xdp-monitor is literally this and nothing else:
xdp-monitor [options]
The supported options are:
π The Options, Bestie π
-i,--interval <SECONDS>β sets the polling interval for collecting all the statistics and displaying them to the output. the unit of interval is in seconds. β±οΈ-s,--statsβ enables statistics for successful redirection. heads up tho: this option comes with a per packet tracing overhead, because it has to record every single successful redirection. π-e,--extendedβ startsxdp-benchin "extended" output mode. if you don't set it,xdp-benchstarts in "terse" mode. you can switch the output mode live by hitting C-$ while the program is running. see also the Output Format Description section below. π-v,--verboseβ enables verbose logging. supply it twice to get verbose logging out of the underlyinglibxdpandlibbpflibraries. two-vs, double the yapping π£οΈ--versionβ shows the application version and exits. slay, short and sweet.-h,--helpβ displays a summary of the available options. your safety net fr fr π«Ά
π Output Format Description π
By default, redirect success statistics are disabled β use --stats to enable them. The terse output mode is the default, and extended output mode can be activated with the --extended command line option.
SIGQUIT (Ctrl + \) can be used to switch the mode dynamically at runtime. no restart needed, we love a flexible queen π
π Terse mode π
Terse mode displays at most the following fields:
rx/sβ Number of packets received per secondredir/sβ Number of packets successfully redirected per seconderr,drop/sβ Aggregated count of errors per second (including dropped packets)xmit/sβ Number of packets transmitted on the output device per second
π¦ Verbose output mode π¦
Verbose output mode displays at most the following fields. there are a lot of them, so buckle up bestie π
π receive
Displays the number of packets received and errors encountered.
- Whenever an error or packet drop occurs, details of per CPU error and drop statistics will be expanded inline in terse mode.
pkt/sβ Packets received per seconddrop/sβ Packets dropped per seconderror/sβ Errors encountered per second
πΈ redirect
Displays the number of packets successfully redirected.
- Errors encountered are expanded under the
redirect_errfield. - Note that passing
-sto enable it has a per packet overhead. πredir/sβ Packets redirected successfully per second
π₯ redirect_err
Displays the number of packets that failed redirection.
- The
errnois expanded under this field with per CPU count. - The recognized errors are:
EINVAL: Invalid redirectionENETDOWN: Device being redirected to is downEMSGSIZE: Packet length too large for deviceEOPNOTSUPP: Operation not supportedENOSPC: No space inptr_ringof cpumap kthread
error/sβ Packets that failed redirection per second
β¨ enqueue to cpu N
Displays the number of packets enqueued to bulk queue of CPU N.
- Expands to
cpu:FROM->Nto display enqueue stats for each CPU enqueuing to CPU N. - Received packets can be associated with the CPU redirect program is enqueuing packets to.
pkt/sβ Packets enqueued per second from other CPU to CPU Ndrop/sβ Packets dropped when trying to enqueue to CPU Nbulk-avgβ Average number of packets processed for each event
π kthread
Displays the number of packets processed in CPUMAP kthread for each CPU.
- Packets consumed from
ptr_ringin kthread, and itsxdp_stats(after calling CPUMAP bpf prog) are expanded below this.xdp_statsare expanded as a total and then per-CPU, to associate it to each CPU's pinned CPUMAP kthread.pkt/sβ Packets consumed per second fromptr_ringdrop/sβ Packets dropped per second in kthreadschedβ Number of times kthread calledschedule()
xdp_stats(also expands to per-CPU counts)pass/sβXDP_PASScount for CPUMAP program executiondrop/sβXDP_DROPcount for CPUMAP program executionredir/sβXDP_REDIRECTcount for CPUMAP program execution
π xdp_exception
Displays xdp_exception tracepoint events.
- This can occur due to internal driver errors, unrecognized XDP actions, and due to explicit user trigger by use of
XDP_ABORTED. - Each action is expanded below this field with its count.
hit/sβ Number of times the tracepoint was hit per second
π§ devmap_xmit
Displays devmap_xmit tracepoint events.
- This tracepoint is invoked for successful transmissions on output device, but these statistics are not available for generic XDP mode, hence they will be omitted from the output when using SKB mode. π
xmit/sβ Number of packets that were transmitted per seconddrop/sβ Number of packets that failed transmissions per seconddrv_err/sβ Number of internal driver errors per secondbulk-avgβ Average number of packets processed for each event
π BUGS π
Please report any bugs on Github: https://github.com/xdp-project/xdp-tools/issues β the maintainers are actually so nice about it, no cap. π«Ά
π AUTHOR π
The original xdp-monitor tool was written by Jesper Dangaard Brouer. It was then rewritten to support more features by Kumar Kartikeya Dwivedi. This man page was written by Kumar Kartikeya Dwivedi. iconic behavior, honestly π
and that's the whole page bestie!! this is version V1.6.3, dated DECEMBER 12, 2022, and you've been reading xdp-monitor(8) π
β¨ go monitor some XDP, you've got this π¦
π¦ where this page comes from
- arch rolling: xdp-tools 1.6.3-2 Β· GPL AND LGPL AND BSD2
- ubuntu stonking: xdp-tools 1.6.3-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms