NAME
XDP-monitor - a simple BPF-powered XDP monitoring tool
SYNOPSIS
XDP-monitor is a tool that monitors various XDP related statistics and events using BPF tracepoints infrastructure, trying to be as low overhead as possible.
Note that by default, statistics for successful XDP redirect events is disabled, as that leads to a per-packet BPF tracing overhead, which while being low overhead, can lead to packet processing degradation.
This tool relies on the BPF raw tracepoints infrastructure in the kernel.
There is more information on the meaning of the output in both default (terse) and verbose output mode, in the Output Format Description section.
Running xdp-monitor
The syntax for running xdp-monitor is:
xdp-monitor [options]
The supported options are:
-i, --interval <SECONDS>
Set the polling interval for collecting all statistics and displaying them to the output. The unit of interval is in seconds.
-s, --stats
Enable statistics for successful redirection. This option comes with a per packet tracing overhead, for recording all successful redirections.
-e, --extended
Start xdp-bench in "extended" output mode. If not set, xdp-bench will start in "terse" mode. The output mode can be switched by hitting C-$ while the program is running. See also the Output Format Description section below.
-v, --verbose
Enable verbose logging. Supply twice to enable verbose logging from the underlying libxdp and libbpf libraries.
--version
Show the application version and exit.
-h, --help
Display a summary of the available options
Output Format Description
By default, redirect success statistics are disabled, use --stats to enable. The terse output mode is default, extended output mode can be activated using the --extended command line option.
SIGQUIT (Ctrl + \) can be used to switch the mode dynamically at runtime.
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 displays at most the following fields:
FIELD DESCRIPTIONreceive Displays the number of packets received and errors encounteredWhenever an error or packet drop occurs, details of per CPU errorand drop statistics will be expanded inline in terse mode.pkt/s - Packets received per seconddrop/s - Packets dropped per seconderror/s - Errors encountered per secondredirect - Displays the number of packets successfully redirectedErrors encountered are expanded under redirect_err fieldNote that passing -s to enable it has a per packet overheadredir/s - Packets redirected successfully per secondredirect_err Displays the number of packets that failed redirectionThe errno is expanded under this field with per CPU countThe recognized errors are:EINVAL: Invalid redirectionENETDOWN: Device being redirected to is downEMSGSIZE: Packet length too large for deviceEOPNOTSUPP: Operation not supportedENOSPC: No space in ptr_ring of cpumap kthreaderror/s - Packets that failed redirection per secondenqueue to cpu N Displays the number of packets enqueued to bulk queue of CPU NExpands to cpu:FROM->N to display enqueue stats for each CPU enqueuing to CPU NReceived packets can be associated with the CPU redirect program is enqueuingpackets 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 eventkthread Displays the number of packets processed in CPUMAP kthread for each CPUPackets consumed from ptr_ring in kthread, and its xdp_stats (after callingCPUMAP bpf prog) are expanded below this. xdp_stats are expanded as a total andthen per-CPU to associate it to each CPU's pinned CPUMAP kthread.pkt/s - Packets consumed per second from ptr_ringdrop/s - Packets dropped per second in kthreadsched - Number of times kthread called schedule()xdp_stats (also expands to per-CPU counts)pass/s - XDP_PASS count for CPUMAP program executiondrop/s - XDP_DROP count for CPUMAP program executionredir/s - XDP_REDIRECT count for CPUMAP program executionxdp_exception Displays xdp_exception tracepoint eventsThis can occur due to internal driver errors, unrecognizedXDP actions and due to explicit user trigger by use of XDP_ABORTEDEach action is expanded below this field with its counthit/s - Number of times the tracepoint was hit per seconddevmap_xmit Displays devmap_xmit tracepoint eventsThis tracepoint is invoked for successful transmissions on outputdevice but these statistics are not available for generic XDP mode,hence they will be omitted from the output when using SKB modexmit/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
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.