1 .. SPDX-License-Identifier: BSD-3-Clause
2 Copyright(c) 2019 Intel Corporation.
4 AF_XDP Poll Mode Driver
5 ==========================
7 AF_XDP is an address family that is optimized for high performance
8 packet processing. AF_XDP sockets enable the possibility for XDP program to
9 redirect packets to a memory buffer in userspace.
11 For the full details behind AF_XDP socket, you can refer to
12 `AF_XDP documentation in the Kernel
13 <https://www.kernel.org/doc/Documentation/networking/af_xdp.rst>`_.
15 This Linux-specific PMD driver creates the AF_XDP socket and binds it to a
16 specific netdev queue, it allows a DPDK application to send and receive raw
17 packets through the socket which would bypass the kernel network stack.
18 Current implementation only supports single queue, multi-queues feature will
21 Note that MTU of AF_XDP PMD is limited due to XDP lacks support for
27 The following options can be provided to set up an af_xdp port in DPDK.
29 * ``iface`` - name of the Kernel interface to attach to (required);
30 * ``start_queue`` - starting netdev queue id (optional, default 0);
31 * ``queue_count`` - total netdev queue number (optional, default 1);
32 * ``pmd_zero_copy`` - enable zero copy or not (optional, default 0);
37 This is a Linux-specific PMD, thus the following prerequisites apply:
39 * A Linux Kernel (version > v4.18) with XDP sockets configuration enabled;
40 * libbpf (within kernel version > v5.1-rc4) with latest af_xdp support installed,
41 User can install libbpf via `make install_lib` && `make install_headers` in
42 <kernel src tree>/tools/lib/bpf;
43 * A Kernel bound interface to attach to;
45 Set up an af_xdp interface
46 -----------------------------
48 The following example will set up an af_xdp interface in DPDK:
50 .. code-block:: console
52 --vdev net_af_xdp,iface=ens786f1,queue=0