]> git.proxmox.com Git - ceph.git/blame - ceph/src/seastar/dpdk/doc/guides/nics/nfp.rst
import 15.2.0 Octopus source
[ceph.git] / ceph / src / seastar / dpdk / doc / guides / nics / nfp.rst
CommitLineData
11fdf7f2 1.. BSD LICENSE
9f95a23c 2 Copyright(c) 2015-2017 Netronome Systems, Inc. All rights reserved.
11fdf7f2
TL
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
7 are met:
8
9 * Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11 * Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in
13 the documentation and/or other materials provided with the
14 distribution.
15 * Neither the name of Intel Corporation nor the names of its
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
18
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31NFP poll mode driver library
32============================
33
34Netronome's sixth generation of flow processors pack 216 programmable
35cores and over 100 hardware accelerators that uniquely combine packet,
36flow, security and content processing in a single device that scales
9f95a23c 37up to 400-Gb/s.
11fdf7f2
TL
38
39This document explains how to use DPDK with the Netronome Poll Mode
40Driver (PMD) supporting Netronome's Network Flow Processor 6xxx
9f95a23c 41(NFP-6xxx) and Netronome's Flow Processor 4xxx (NFP-4xxx).
11fdf7f2 42
9f95a23c
TL
43NFP is a SRIOV capable device and the PMD driver supports the physical
44function (PF) and the virtual functions (VFs).
11fdf7f2
TL
45
46Dependencies
47------------
48
9f95a23c 49Before using the Netronome's DPDK PMD some NFP configuration,
11fdf7f2 50which is not related to DPDK, is required. The system requires
9f95a23c
TL
51installation of **Netronome's BSP (Board Support Package)** along
52with a specific NFP firmware application. Netronome's NSP ABI
53version should be 0.20 or higher.
11fdf7f2 54
9f95a23c
TL
55If you have a NFP device you should already have the code and
56documentation for this configuration. Contact
11fdf7f2
TL
57**support@netronome.com** to obtain the latest available firmware.
58
9f95a23c
TL
59The NFP Linux netdev kernel driver for VFs has been a part of the
60vanilla kernel since kernel version 4.5, and support for the PF
61since kernel version 4.11. Support for older kernels can be obtained
62on Github at
63**https://github.com/Netronome/nfp-drv-kmods** along with the build
11fdf7f2
TL
64instructions.
65
9f95a23c
TL
66NFP PMD needs to be used along with UIO ``igb_uio`` or VFIO (``vfio-pci``)
67Linux kernel driver.
11fdf7f2
TL
68
69Building the software
70---------------------
71
72Netronome's PMD code is provided in the **drivers/net/nfp** directory.
73Although NFP PMD has NetronomeĀ“s BSP dependencies, it is possible to
9f95a23c 74compile it along with other DPDK PMDs even if no BSP was installed previously.
11fdf7f2 75Of course, a DPDK app will require such a BSP installed for using the
9f95a23c 76NFP PMD, along with a specific NFP firmware application.
11fdf7f2 77
9f95a23c 78Default PMD configuration is at the **common_linux configuration** file:
11fdf7f2
TL
79
80- **CONFIG_RTE_LIBRTE_NFP_PMD=y**
81
9f95a23c 82Once the DPDK is built all the DPDK apps and examples include support for
11fdf7f2
TL
83the NFP PMD.
84
85
86Driver compilation and testing
87------------------------------
88
89Refer to the document :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
90for details.
91
9f95a23c
TL
92Using the PF
93------------
94
95NFP PMD supports using the NFP PF as another DPDK port, but it does not
96have any functionality for controlling VFs. In fact, it is not possible to use
97the PMD with the VFs if the PF is being used by DPDK, that is, with the NFP PF
98bound to ``igb_uio`` or ``vfio-pci`` kernel drivers. Future DPDK versions will
99have a PMD able to work with the PF and VFs at the same time and with the PF
100implementing VF management along with other PF-only functionalities/offloads.
101
102The PMD PF has extra work to do which will delay the DPDK app initialization
103like uploading the firmware and configure the Link state properly when starting or
104stopping a PF port. Since DPDK 18.05 the firmware upload happens when
105a PF is initialized, which was not always true with older DPDK versions.
106
107Depending on the Netronome product installed in the system, firmware files
108should be available under ``/lib/firmware/netronome``. DPDK PMD supporting the
109PF looks for a firmware file in this order:
110
111 1) First try to find a firmware image specific for this device using the
112 NFP serial number:
113
114 serial-00-15-4d-12-20-65-10-ff.nffw
115
116 2) Then try the PCI name:
117
118 pci-0000:04:00.0.nffw
119
120 3) Finally try the card type and media:
121
122 nic_AMDA0099-0001_2x25.nffw
123
124Netronome's software packages install firmware files under ``/lib/firmware/netronome``
125to support all the Netronome's SmartNICs and different firmware applications.
126This is usually done using file names based on SmartNIC type and media and with a
127directory per firmware application. Options 1 and 2 for firmware filenames allow
128more than one SmartNIC, same type of SmartNIC or different ones, and to upload a
129different firmware to each SmartNIC.
130
131
132PF multiport support
133--------------------
134
135Some NFP cards support several physical ports with just one single PCI device.
136The DPDK core is designed with a 1:1 relationship between PCI devices and DPDK
137ports, so NFP PMD PF support requires handling the multiport case specifically.
138During NFP PF initialization, the PMD will extract the information about the
139number of PF ports from the firmware and will create as many DPDK ports as
140needed.
141
142Because the unusual relationship between a single PCI device and several DPDK
143ports, there are some limitations when using more than one PF DPDK port: there
144is no support for RX interrupts and it is not possible either to use those PF
145ports with the device hotplug functionality.
146
147
148PF multiprocess support
149-----------------------
150
151Due to how the driver needs to access the NFP through a CPP interface, which implies
152to use specific registers inside the chip, the number of secondary processes with PF
153ports is limited to only one.
154
155This limitation will be solved in future versions but having basic multiprocess support
156is important for allowing development and debugging through the PF using a secondary
157process which will create a CPP bridge for user space tools accessing the NFP.
158
11fdf7f2
TL
159
160System configuration
161--------------------
162
9f95a23c
TL
163#. **Enable SR-IOV on the NFP device:** The current NFP PMD supports the PF and
164 the VFs on a NFP device. However, it is not possible to work with both at the
165 same time because the VFs require the PF being bound to the NFP PF Linux
166 netdev driver. Make sure you are working with a kernel with NFP PF support or
167 get the drivers from the above Github repository and follow the instructions
168 for building and installing it.
11fdf7f2 169
9f95a23c 170 VFs need to be enabled before they can be used with the PMD.
11fdf7f2
TL
171 Before enabling the VFs it is useful to obtain information about the
172 current NFP PCI device detected by the system:
173
174 .. code-block:: console
175
176 lspci -d19ee:
177
178 Now, for example, configure two virtual functions on a NFP-6xxx device
179 whose PCI system identity is "0000:03:00.0":
180
181 .. code-block:: console
182
183 echo 2 > /sys/bus/pci/devices/0000:03:00.0/sriov_numvfs
184
185 The result of this command may be shown using lspci again:
186
187 .. code-block:: console
188
189 lspci -d19ee: -k
190
191 Two new PCI devices should appear in the output of the above command. The
192 -k option shows the device driver, if any, that devices are bound to.
193 Depending on the modules loaded at this point the new PCI devices may be
194 bound to nfp_netvf driver.