net/hns3: support Rx interrupt
[dpdk.git] / doc / guides / nics / nfp.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright(c) 2015-2017 Netronome Systems, Inc. All rights reserved.
3     All rights reserved.
4
5 NFP poll mode driver library
6 ============================
7
8 Netronome's sixth generation of flow processors pack 216 programmable
9 cores and over 100 hardware accelerators that uniquely combine packet,
10 flow, security and content processing in a single device that scales
11 up to 400-Gb/s.
12
13 This document explains how to use DPDK with the Netronome Poll Mode
14 Driver (PMD) supporting Netronome's Network Flow Processor 6xxx
15 (NFP-6xxx) and Netronome's Flow Processor 4xxx (NFP-4xxx).
16
17 NFP is a SRIOV capable device and the PMD driver supports the physical
18 function (PF) and the virtual functions (VFs).
19
20 Dependencies
21 ------------
22
23 Before using the Netronome's DPDK PMD some NFP configuration,
24 which is not related to DPDK, is required. The system requires
25 installation of **Netronome's BSP (Board Support Package)** along
26 with a specific NFP firmware application. Netronome's NSP ABI
27 version should be 0.20 or higher.
28
29 If you have a NFP device you should already have the code and
30 documentation for this configuration. Contact
31 **support@netronome.com** to obtain the latest available firmware.
32
33 The NFP Linux netdev kernel driver for VFs has been a part of the
34 vanilla kernel since kernel version 4.5, and support for the PF
35 since kernel version 4.11. Support for older kernels can be obtained
36 on Github at
37 **https://github.com/Netronome/nfp-drv-kmods** along with the build
38 instructions.
39
40 NFP PMD needs to be used along with UIO ``igb_uio`` or VFIO (``vfio-pci``)
41 Linux kernel driver.
42
43 Building the software
44 ---------------------
45
46 Netronome's PMD code is provided in the **drivers/net/nfp** directory.
47 Although NFP PMD has NetronomeĀ“s BSP dependencies, it is possible to
48 compile it along with other DPDK PMDs even if no BSP was installed previously.
49 Of course, a DPDK app will require such a BSP installed for using the
50 NFP PMD, along with a specific NFP firmware application.
51
52 Default PMD configuration is at the **common_linux configuration** file:
53
54 - **CONFIG_RTE_LIBRTE_NFP_PMD=y**
55
56 Once the DPDK is built all the DPDK apps and examples include support for
57 the NFP PMD.
58
59
60 Driver compilation and testing
61 ------------------------------
62
63 Refer to the document :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
64 for details.
65
66 Using the PF
67 ------------
68
69 NFP PMD supports using the NFP PF as another DPDK port, but it does not
70 have any functionality for controlling VFs. In fact, it is not possible to use
71 the PMD with the VFs if the PF is being used by DPDK, that is, with the NFP PF
72 bound to ``igb_uio`` or ``vfio-pci`` kernel drivers. Future DPDK versions will
73 have a PMD able to work with the PF and VFs at the same time and with the PF
74 implementing VF management along with other PF-only functionalities/offloads.
75
76 The PMD PF has extra work to do which will delay the DPDK app initialization
77 like uploading the firmware and configure the Link state properly when starting or
78 stopping a PF port. Since DPDK 18.05 the firmware upload happens when
79 a PF is initialized, which was not always true with older DPDK versions.
80
81 Depending on the Netronome product installed in the system, firmware files
82 should be available under ``/lib/firmware/netronome``. DPDK PMD supporting the
83 PF looks for a firmware file in this order:
84
85         1) First try to find a firmware image specific for this device using the
86            NFP serial number:
87
88                 serial-00-15-4d-12-20-65-10-ff.nffw
89
90         2) Then try the PCI name:
91
92                 pci-0000:04:00.0.nffw
93
94         3) Finally try the card type and media:
95
96                 nic_AMDA0099-0001_2x25.nffw
97
98 Netronome's software packages install firmware files under ``/lib/firmware/netronome``
99 to support all the Netronome's SmartNICs and different firmware applications.
100 This is usually done using file names based on SmartNIC type and media and with a
101 directory per firmware application. Options 1 and 2 for firmware filenames allow
102 more than one SmartNIC, same type of SmartNIC or different ones, and to upload a
103 different firmware to each SmartNIC.
104
105
106 PF multiport support
107 --------------------
108
109 Some NFP cards support several physical ports with just one single PCI device.
110 The DPDK core is designed with a 1:1 relationship between PCI devices and DPDK
111 ports, so NFP PMD PF support requires handling the multiport case specifically.
112 During NFP PF initialization, the PMD will extract the information about the
113 number of PF ports from the firmware and will create as many DPDK ports as
114 needed.
115
116 Because the unusual relationship between a single PCI device and several DPDK
117 ports, there are some limitations when using more than one PF DPDK port: there
118 is no support for RX interrupts and it is not possible either to use those PF
119 ports with the device hotplug functionality.
120
121
122 PF multiprocess support
123 -----------------------
124
125 Due to how the driver needs to access the NFP through a CPP interface, which implies
126 to use specific registers inside the chip, the number of secondary processes with PF
127 ports is limited to only one.
128
129 This limitation will be solved in future versions but having basic multiprocess support
130 is important for allowing development and debugging through the PF using a secondary
131 process which will create a CPP bridge for user space tools accessing the NFP.
132
133
134 System configuration
135 --------------------
136
137 #. **Enable SR-IOV on the NFP device:** The current NFP PMD supports the PF and
138    the VFs on a NFP device. However, it is not possible to work with both at the
139    same time because the VFs require the PF being bound to the NFP PF Linux
140    netdev driver.  Make sure you are working with a kernel with NFP PF support or
141    get the drivers from the above Github repository and follow the instructions
142    for building and installing it.
143
144    VFs need to be enabled before they can be used with the PMD.
145    Before enabling the VFs it is useful to obtain information about the
146    current NFP PCI device detected by the system:
147
148    .. code-block:: console
149
150       lspci -d19ee:
151
152    Now, for example, configure two virtual functions on a NFP-6xxx device
153    whose PCI system identity is "0000:03:00.0":
154
155    .. code-block:: console
156
157       echo 2 > /sys/bus/pci/devices/0000:03:00.0/sriov_numvfs
158
159    The result of this command may be shown using lspci again:
160
161    .. code-block:: console
162
163       lspci -d19ee: -k
164
165    Two new PCI devices should appear in the output of the above command. The
166    -k option shows the device driver, if any, that devices are bound to.
167    Depending on the modules loaded at this point the new PCI devices may be
168    bound to nfp_netvf driver.