xdp-bench(8)
β¨ NAME β¨
xdp-bench β a simple XDP benchmarking tool π
π¦ SYNOPSIS π¦
xdp-bench is a benchmarking utility for exercising the different operation modes of XDP, bestie. It's meant to be a simple little program that shows off all the various operating modes β and those include dropping packets, hairpin forwarding (that's the one where you return XDP_TX), and redirection using the various in-kernel packet redirection facilities. iconic behaviour tbh π
The drop and TX modes have a bunch of options that control whether packet data gets touched (read or written) before it's dropped or transmitted. The redirection modes support using the simple ifindex-based bpf_redirect helper, the bpf_redirect_map helper using a cpumap as its target, bpf_redirect_map using a devmap as its target, and the devmap's broadcast mode, which lets you redirect to multiple devices at once. so many flavours fr fr π
There is more information on the meaning of the output in both default (terse) and extended output mode, in the Output Format Description section below. π
πΈ Running xdp-bench πΈ
The syntax for running xdp-bench is:
Usage: xdp-bench COMMAND [options]
COMMAND can be one of:
drop - Drop all packets on an interface
pass - Pass all packets to the network stack
tx - Transmit packets back out on an interface (hairpin forwarding)
redirect - XDP redirect using the bpf_redirect() helper
redirect-cpu - XDP CPU redirect using BPF_MAP_TYPE_CPUMAP
redirect-map - XDP redirect using BPF_MAP_TYPE_DEVMAP
redirect-multi - XDP multi-redirect using BPF_MAP_TYPE_DEVMAP and the BPF_F_BROADCAST flag
xsk-drop - AF_XDP socket-based drop
xsk-tx - AF_XDP socket-based hairpin forwarding
Each command, and its options, are explained below. Or, like, if you're impatient (valid β¨), just run xdp-bench COMMAND --help to see the options for each command. π«Ά
π The DROP command π
In this mode, xdp-bench installs an XDP program on an interface that literally just drops all packets. There are options to control what to do with the packet before dropping it (touch the packet data or not), plus which statistics to gather. This is the basic benchmark for the baseline (best-case) performance of XDP on an interface. the vibe check for your NIC basically π
The syntax for the drop command is:
xdp-bench drop [options] <ifname>
Where <ifname> is the name of the interface the XDP program should be installed on.
The supported options are:
-p, --packet-operation <ACTION>
Specify which operation should be taken on the packet before dropping it. The following actions are available:
no-touchβ Drop the packet without touching the packet dataread-dataβ Read a field in the packet header before droppingparse-ipβ Parse the IP header field before droppingswap-macsβ Swap the source and destination MAC addresses before dropping
Whether to touch the packet before dropping it can have a significant performance impact, because doing so requires bringing packet data into the CPU cache (and flushing it back out if you're writing). π
The default for this option is no-touch.
-l, --load-mode <MODE>
Specify which mechanism xdp-bench should use to load (and store) the packet data. The following modes are available:
dpaβ Use traditional Direct Packet Access from the XDP programload-bytesβ Use thexdp_load_bytes()andxdp_store_bytes()helper functions
This can be used to benchmark the various packet access modes supported by the kernel. π§
The default for this option is dpa.
-r, --rxq-stats
If set, the XDP program will also gather statistics on which receive queue index each packet was received on. This is displayed in the extended output mode along with per-CPU data (which, depending on the hardware configuration, may or may not be equivalent). π
-i, --interval <SECONDS>
Set the polling interval for collecting all statistics and displaying them to the output. The unit of interval is in seconds. β±οΈ
-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. β¨
-m, --mode
Selects the XDP program mode (native or skb). Note that native XDP mode is the default, and loading the redirect program in skb manner is neither performant, nor recommended. However, this option is useful if the interface driver lacks native XDP support, or when you're simply testing the tool. π
-v, --verbose
Enable verbose logging. Supply it 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.
π The PASS command π
In this mode, xdp-bench installs an XDP program on an interface that passes all packets to the network stack after processing them (it returns XDP_PASS). There are options to control what to do with the packet before passing it (touch the packet data or not), plus which statistics to gather. This is the basic benchmark for the overhead of installing an XDP program on an interface while still running the regular network stack. lowkey the "excuse me, just passing through" mode π
The syntax for the pass command is:
xdp-bench pass [options] <ifname>
Where <ifname> is the name of the interface the XDP program should be installed on.
The supported options are:
-p, --packet-operation <ACTION>
Specify which operation should be taken on the packet before passing it. The following actions are available:
no-touchβ Pass the packet without touching the packet dataread-dataβ Read a field in the packet header before passingparse-ipβ Parse the IP header field before passingswap-macsβ Swap the source and destination MAC addresses before passing
The default for this option is no-touch.
-l, --load-mode <MODE>
Specify which mechanism xdp-bench should use to load (and store) the packet data. The following modes are available:
dpaβ Use traditional Direct Packet Access from the XDP programload-bytesβ Use thexdp_load_bytes()andxdp_store_bytes()helper functions
This can be used to benchmark the various packet access modes supported by the kernel. π§
The default for this option is dpa.
-r, --rxq-stats
If set, the XDP program will also gather statistics on which receive queue index each packet was received on. This is displayed in the extended output mode along with per-CPU data (which, depending on the hardware configuration, may or may not be equivalent). π
-i, --interval <SECONDS>
Set the polling interval for collecting all statistics and displaying them to the output. The unit of interval is in seconds. β±οΈ
-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. β¨
-m, --mode
Selects the XDP program mode (native or skb). Note that native XDP mode is the default, and loading the redirect program in skb manner is neither performant, nor recommended. However, this option is useful if the interface driver lacks native XDP support, or when you're simply testing the tool. π
-v, --verbose
Enable verbose logging. Supply it 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.
π The TX command π
In this mode, xdp-bench installs an XDP program on an interface that performs so-called "hairpin forwarding" β which means every single packet is transmitted back out the same interface (using the XDP_TX return code). π« There are options to control what to do with the packet before transmitting it (touch the packet data or not), plus which statistics to gather.
The syntax for the tx command is:
xdp-bench tx [options] <ifname>
Where <ifname> is the name of the interface the XDP program should be installed on.
The supported options are:
-p, --packet-operation <ACTION>
Specify which operation should be taken on the packet before transmitting it. The following actions are available:
no-touchβ Transmit the packet without touching the packet dataread-dataβ Read a field in the packet header before transmittingparse-ipβ Parse the IP header field before transmittingswap-macsβ Swap the source and destination MAC addresses before transmitting
To allow the packet to be successfully transmitted back to the sender, the MAC addresses have to be swapped, so that the source MAC matches the network device. However, there is a performance overhead in doing the swapping, so this option allows this function to be turned off. π«Ά
The default for this option is swap-macs.
-l, --load-mode <MODE>
Specify which mechanism xdp-bench should use to load (and store) the packet data. The following modes are available:
dpaβ Use traditional Direct Packet Access from the XDP programload-bytesβ Use thexdp_load_bytes()andxdp_store_bytes()helper functions
This can be used to benchmark the various packet access modes supported by the kernel. π§
The default for this option is dpa.
-r, --rxq-stats
If set, the XDP program will also gather statistics on which receive queue index each packet was received on. This is displayed in the extended output mode along with per-CPU data (which, depending on the hardware configuration, may or may not be equivalent). π
-i, --interval <SECONDS>
Set the polling interval for collecting all statistics and displaying them to the output. The unit of interval is in seconds. β±οΈ
-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. β¨
-m, --mode
Selects the XDP program mode (native or skb). Note that native XDP mode is the default, and loading the redirect program in skb manner is neither performant, nor recommended. However, this option is useful if the interface driver lacks native XDP support, or when you're simply testing the tool. π
-v, --verbose
Enable verbose logging. Supply it 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.
π The REDIRECT command π
okay bestie, this one is the classic. In this mode, xdp-bench sets up packet redirection between the two interfaces you hand it on the command line, using the bpf_redirect BPF helper β and that helper fires on packet reception on the ingress interface. cute, efficient, iconic π
The syntax for the redirect command is:
xdp-bench redirect [options] <ifname_in> <ifname_out>
Where <ifname_in> is the name of the input interface from where packets will be redirect to the output interface <ifname_out>. (yes, packets go in one door and out the other, main character energy fr fr πͺβ‘οΈπͺ)
The supported options are:
-l,--load-mode<MODE> β tellxdp-benchwhich mechanism it should use to load (and store) the packet data. The following modes are available:dpaβ Use traditional Direct Packet Access from the XDP programload-bytesβ Use thexdp_load_bytes()andxdp_store_bytes()helper functions
This can be used to benchmark the various packet access modes supported by the kernel. The default for this option is dpa.
-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. Heads up though: this option comes with a per packet tracing overhead, for recording all successful redirections. so it's giving "we're watching everything and it costs us" π-e,--extendedβ startxdp-benchin "extended" output mode. If not set,xdp-benchwill start in "terse" mode. The output mode can be switched by hittingC-$while the program is running. See also the Output Format Description section below. β¨-m,--modeβ selects the XDP program mode (nativeorskb). Note that native XDP mode is the default, and loading the redirect program in skb manner is neither performant, nor recommended. However, this option is useful if the interface driver lacks native XDP support, or when simply testing the tool.-v,--verboseβ enable verbose logging. Supply twice to enable verbose logging from the underlyinglibxdpandlibbpflibraries. π£οΈ--versionβ show the application version and exit.-h,--helpβ display a summary of the available options
π§ The REDIRECT-CPU command π§
okay this one is lowkey my fave. In this mode, xdp-bench sets up packet redirection using the bpf_redirect_map BPF helper triggered on packet reception on the ingress interface, using a cpumap as its target. So basically this tool can redirect packets on an interface from one CPU to another π§ And on top of that, it then supports redirecting the packet to another output device when it is processed on the target CPU. multitasking queen behavior π
The syntax for the redirect-cpu command is:
xdp-bench redirect-cpu [options] <ifname> -c 0 ... -c N
Where <ifname> is the name of the input interface from where packets will be redirect to the target CPU list specified using -c.
The supported options are:
-c,--cpu<CPU> β specify a possible target CPU index. This option must be passed at least once, and can be passed multiple times to specify a list of CPUs. Which CPU is chosen for a given packet depends on the value of the--program-modeoption, described below.-p,--program-mode<MODE> β specify a program that embeds a predefined policy deciding how packets are redirected to different CPUs. The following options are available:no-touchβ Redirect without touching packet datatouchβ Read packet data before redirectinground-robinβ Cycle between target CPUs in a round-robin fashion (for each packet)l4-protoβ Choose the target CPU based on the layer-4 protocol of packetl4-filterβ Likel4-proto, but drop UDP packets with destination port 9 (used by pktgen)l4-hashβ Use source and destination IP hashing to pick target CPUl4-sportβ Use modulo of source port to pick target CPUl4-dportβ Use modulo of destination port to pick target CPU
The no-touch and touch modes always redirect packets to the same CPU (the first value supplied to --cpu). The round-robin and l4-hash modes distribute packets between all the CPUs supplied as --cpu arguments, while l4-proto and l4-filter send TCP and unrecognised packets to CPU index 0, UDP packets to CPU index 1 and ICMP packets to CPU index 2 (where the index refers to the order the actual CPUs are given on the command line).
The default for this option is l4-hash.
-r --remote-action<ACTION> β if this option is set, a separate program is installed into thecpumap, which will be invoked on the remote CPU after the packet is processed there. The action can be eitherdroporpass, which will drop the packet or pass it to the regular networking stack, respectively. Or it can beredirect, which will cause the packet to be redirected to another interface and transmitted out that interface on the remote CPU. If this option is set toredirectthe target device must be specified using--redirect-device.
The default for this option is disabled.
-r,--redirect-device<IFNAME> β specify the device to redirect the packet to when it is received on the target CPU. Note that this option can only be specified with--remote-action redirect.
ngl bestie, yes β both of these are written as -r in the page. I don't make the rules, I just report them π
-q,--qsize<PACKETS> β set the queue size for the per-CPUcpumapring buffer used for redirecting packets from multiple CPUs to one CPU. The default value is2048packets.-x,--stress-modeβ stress thecpumapimplementation by deallocating and reallocating thecpumapring buffer on each polling interval. it's giving chaos for science π« π₯-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β startxdp-benchin "extended" output mode. If not set,xdp-benchwill start in "terse" mode. The output mode can be switched by hittingC-$while the program is running. See also the Output Format Description section below.-m,--modeβ selects the XDP program mode (nativeorskb). Note that native XDP mode is the default, and loading the redirect program in skb manner is neither performant, nor recommended. However, this option is useful if the interface driver lacks native XDP support, or when simply testing the tool.-v,--verboseβ enable verbose logging. Supply twice to enable verbose logging from the underlyinglibxdpandlibbpflibraries.--versionβ show the application version and exit.-h,--helpβ display a summary of the available options
πΊοΈ The REDIRECT-MAP command πΊοΈ
In this mode, xdp-bench sets up packet redirection between two interfaces supplied on the command line using the bpf_redirect_map() BPF helper triggered on packet reception on the ingress interface, using a devmap as its target. it's the same idea as before but the map is a devmap this time, obsessed with the range honestly π
The syntax for the redirect-map command is:
xdp-bench redirect-map [options] <ifname_in> <ifname_out>
Where <ifname_in> is the name of the input interface from where packets will be redirect to the output interface <ifname_out>.
The supported options are:
-X,--load-egressβ load a program in thedevmapentry used for redirection, so that it is invoked after the packet is redirected to the target device, before it is transmitted out of the output interface. The program can be selected via theegress-modeoption.-A,--egress-mode<MODE> β set egress program to load:forwardβ Update the packet data so its source MAC address matches the one of the destination interface.dropβ Drop packet.
The default for this option is forward.
-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β startxdp-benchin "extended" output mode. If not set,xdp-benchwill start in "terse" mode. The output mode can be switched by hittingC-$while the program is running. See also the Output Format Description section below.-m,--modeβ selects the XDP program mode (nativeorskb). Note that native XDP mode is the default, and loading the redirect program in skb manner is neither performant, nor recommended. However, this option is useful if the interface driver lacks native XDP support, or when simply testing the tool.-v,--verboseβ enable verbose logging. Supply twice to enable verbose logging from the underlyinglibxdpandlibbpflibraries.--versionβ show the application version and exit.-h,--helpβ display a summary of the available options
π« The REDIRECT-MULTI command π«
Okay bestie, so this one is the one-to-many version of redirect. xdp-bench sets up packet redirection from one input interface out to one or more output interfaces, using the bpf_redirect_map BPF helper that fires when a packet shows up on the ingress interface, with a devmap as its target. Then the packet gets broadcast to every single output interface you listed on the command line, using devmap's packet broadcast feature. It's giving group chat blast, but for packets π
The syntax for the redirect-multi command is:
xdp-bench redirect-multi [options] <ifname_in> <ifname_out1> ...
<ifname_outN>
Where <ifname_in> is the name of the input interface from where packets will be redirect to one or many output interface(s). Yes, that's the original wording and it's lowkey iconic, so it stays π«Ά
The supported options are:
-X,--load-egressβ Loads a program in the devmap entry used for redirection, so it gets invoked after the packet is redirected to the target device, but before it's transmitted out of the output interface. You pick which program with theegress-modeoption. β¨-A,--egress-mode <MODE>β Sets the egress program to load:forwardβ Update the packet data so its source MAC address matches the one of the destination interface.dropβ Drop packet.
The default for this option is forward.
-i,--interval <SECONDS>β Sets the polling interval for collecting all statistics and displaying them to the output. The unit of interval is in seconds. β±οΈ-s,--statsβ Enables statistics for successful redirection. Heads up though: this option comes with a per packet tracing overhead, for recording all successful redirections. Cute stats, small tax π-e,--extendedβ Starts xdp-bench in "extended" output mode. If not set, xdp-bench will start in "terse" mode. You can switch the output mode on the fly by hittingC-$while the program is running. See also the Output Format Description section below. π-m,--modeβ Selects the XDP program mode (nativeorskb). Native XDP mode is the default, and loading the redirect program in skb manner is neither performant, nor recommended. That said, it's useful if the interface driver lacks native XDP support, or when you're simply testing the tool. π-v,--verboseβ Enable verbose logging. Supply it twice to enable verbose logging from the underlyinglibxdpandlibbpflibraries. Two-vs, double the yapping π’--versionβ Show the application version and exit.-h,--helpβ Display a summary of the available options
πΈ The XSK-DROP and XSK-TX commands πΈ
In these modes, xdp-bench drops or mirrors incoming packets (like when using the drop or tx commands), but using an AF_XDP socket that passes the packets directly from the XDP hook to userspace. So basically it's the same vibe as drop/tx, except the packets take a little detour up to userspace. These modes are perfect for testing and benchmarking AF_XDP sockets. The two commands differ only in the action taken β the syntax and options are otherwise identical. Twins fr fr π―
The code for these commands is derived from the xdpsock utility previously part of the kernel sources, and more recently the bpf-examples repository. The xsk-drop command corresponds to the --rxdrop option of xdpsock, and the xsk-tx command corresponds to the --l2fwd option of xdpsock. History lesson, but make it slay πβ¨
The syntax and options for the two commands are identical:
xdp-bench xsk-drop [options] <ifname>
or
xdp-bench xsk-tx [options] <ifname>
The supported options are:
-q,--queue <queue>β Select the hardware receive queue to use for the test. The AF_XDP socket is bound to this queue, which means that xdp-bench will process all packets arriving on it. The default is to use queue0.-i,--interval <seconds>β Set the polling interval for collecting all statistics and displaying them to the output. The default interval is2seconds. β°-f,--frame-size <size>β Set the size of the memory frames used to receive packets. Incoming packets will always use a memory chunk of this size, regardless of the size of the packet on the wire. The size must be a power of two, unless the--unalignedflag is used. The default is4096bytes (which corresponds to the page size on most systems). π-d,--duration <seconds>β Set the test duration, in seconds. The default is0, which means run forever. Bestie said no end time, we go until we feel like it π«Ά-b,--batch-size <packets>β Set the batch size for the receive loop. This is the maximum number of packets processed at once each time the loop runs. The default is64packets.-I,--irq-string <irq-string>β Enable printing of interrupt statistics for the interrupt number associated with irq-string in/proc/interrupts. The string is used to find a matching IRQ number by simple substring matching. No default (which means no IRQ statistics are printed).-p,--pollβ Use thepoll()system call to get notifications for new packets, instead of running in a loop constantly checking for new packets. Much chiller, way less spinning π-m,--no-need-wakeupβ Don't set theXDP_USE_NEED_WAKEUPflag when binding the AF_XDP socket. The flag is set by default, and causes the kernel driver to occasionally go to sleep and yield the CPU to the userspace application when receiving packets. Letting the driver nap, basically π΄-u,--unalignedβ Support receiving unaligned packets, i.e., packets that are not aligned to the beginning of a data frame. When set, xdp-bench will enable huge pages for the userspace memory buffer used to receive packets. Setting this option enables frame sizes that are not a power of two (see the--frame-sizeoption).-M,--shared-umemβ Enable shared userspace memory across multiple AF_XDP sockets. When this option is set, xdp-bench will create four sockets that share the same userspace memory buffer, and packets will be sent to each socket in a round-robin fashion. Sharing is caring π-x,--extra-statsβ Print extra packet statistics at each output interval.-Q,--quietβ Don't print any statistics at each output interval. Silence, but make it intentional π€«-a,--app-statsβ Print additional application-level statistics at each output interval.-B,--busy-pollβ Set theSO_PREFER_BUSY_POLLsocket option, which enables the application to busy-poll without IRQs ever being enabled on the hardware queue being processed. To make use of this option, thenapi_defer_hard_irqsandgro_flush_timeoutsysctls should be set for the interface in question. For more information, seehttps://docs.kernel.org/networking/napi.html#software-irq-coalescing.-F,--fragsβ Enable XDP fragments. This makes it possible to receive packets that are larger than the system page size, and requires kernel and driver support. β οΈ kernel and driver support is not optional here, bestie.-C,--copy-mode <mode>β Select the copying mode for the packets. Set to one ofauto,copy, orzero-copy. The default isauto, which lets the kernel pick. Usingzero-copyrequires kernel and driver support, and can only be used when attaching the XDP program in native mode (see--attach-mode). π¨ remember: zero-copy + skb mode = no.-w,--clock <clock>β Choose the clock that will be used for all timer events in the application. The valid values areMONOTONIC,REALTIME,TAIandBOOTTIME, and the default isMONOTONIC.-W,--policy <policy>β Set the scheduler policy for the application before running. Valid values areSCHED_OTHERandSCHED_FIFO, and the default isSCHED_OTHER.-U,--schpri <priority>β Set the scheduler priority when usingSCHED_FIFO. Defaults to0.-A,--attach-mode <mode>β Set the XDP program attach mode (nativeorskb). The default isnativemode. Note thatzero-copycan only be used innativemode. π native mode stays winning.-v,--verboseβ Enable verbose logging. Supply twice to enable verbose logging from the underlyinglibxdpandlibbpflibraries.--versionβ Show the application version and exit.-h,--helpβ Display a summary of the available options
β¨ OUTPUT FORMAT DESCRIPTION β¨
Okay bestie, listen β by default the redirect success stats are off, you have to pass --stats to turn them on. And the terse output mode is the default, but you can unlock the extended output mode with the --extended command line option. π
Oh and plot twist: you can switch the mode dynamically at runtime with SIGQUIT (Ctrl+\). Iconic behaviour, honestly. π
π Terse mode
Terse mode shows you at most these 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 when not using the drop command)xmit/sβ Number of packets transmitted on the output device per second
π₯ Extended output mode
Extended output mode shows you at most these fields (and yeah, it's a lot, it's giving main character energy):
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
Then:
redirectβ Displays the number of packets successfully redirected- Errors encountered are expanded under
redirect_errfield - Note that passing
-sto enable it has a per packet overhead β not free, bestie, it costs you redir/sβ Packets redirected successfully per second
redirect_err
Displays the number of packets that failed redirection.
The errno is 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 in ptr_ring of cpumap kthread
And then:
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->N to 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_ring in kthread, and its xdp_stats (after calling CPUMAP bpf prog) are expanded below this. xdp_stats are 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
Like, genuinely please do. Found a bug? Tell them. We're not gatekeeping. π«Ά
π AUTHOR π
Earlier xdp-redirect tools were written by Jesper Dangaard Brouer and John Fastabend. They were then rewritten β for more features, slay β by Kumar Kartikeya Dwivedi, who also ported them to xdp-tools together with Toke HΓΈiland-JΓΈrgensen. This man page was written by Kumar Kartikeya Dwivedi and Toke HΓΈiland-JΓΈrgensen.
okay that's the whole page, bestie, we did it π β¨
This is from xdp-bench, version V1.6.3, dated FEBRUARY 19, 2026 β so like, extremely fresh. Go forth and benchmark responsibly, no cap. ππ¦π
π¦ 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