net/af_xdp: introduce AF_XDP PMD
[dpdk.git] / doc / guides / nics / af_xdp.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright(c) 2019 Intel Corporation.
3
4 AF_XDP Poll Mode Driver
5 ==========================
6
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.
10
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>`_.
14
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
19 be added later.
20
21 Note that MTU of AF_XDP PMD is limited due to XDP lacks support for
22 fragmentation.
23
24 Options
25 -------
26
27 The following options can be provided to set up an af_xdp port in DPDK.
28
29 *   ``iface`` - name of the Kernel interface to attach to (required);
30 *   ``queue`` - netdev queue id (optional, default 0);
31
32 Prerequisites
33 -------------
34
35 This is a Linux-specific PMD, thus the following prerequisites apply:
36
37 *  A Linux Kernel (version > v4.18) with XDP sockets configuration enabled;
38 *  libbpf (within kernel version > v5.1-rc4) with latest af_xdp support installed,
39    User can install libbpf via `make install_lib` && `make install_headers` in
40    <kernel src tree>/tools/lib/bpf;
41 *  A Kernel bound interface to attach to;
42
43 Set up an af_xdp interface
44 -----------------------------
45
46 The following example will set up an af_xdp interface in DPDK:
47
48 .. code-block:: console
49
50     --vdev net_af_xdp,iface=ens786f1,queue=0