1 .. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
3 =============================================
4 Netronome Flow Processor (NFP) Kernel Drivers
5 =============================================
7 Copyright (c) 2019, Netronome Systems, Inc.
13 - `Acquiring Firmware`_
18 This driver supports Netronome's line of Flow Processor devices,
19 including the NFP4000, NFP5000, and NFP6000 models, which are also
20 incorporated in the company's family of Agilio SmartNICs. The SR-IOV
21 physical and virtual functions for these devices are supported by
27 The NFP4000 and NFP6000 devices require application specific firmware
28 to function. Application firmware can be located either on the host file system
29 or in the device flash (if supported by management firmware).
31 Firmware files on the host filesystem contain card type (`AMDA-*` string), media
32 config etc. They should be placed in `/lib/firmware/netronome` directory to
33 load firmware from the host file system.
35 Firmware for basic NIC operation is available in the upstream
36 `linux-firmware.git` repository.
41 Recent versions of management firmware supports loading application
42 firmware from flash when the host driver gets probed. The firmware loading
43 policy configuration may be used to configure this feature appropriately.
45 Devlink or ethtool can be used to update the application firmware on the device
46 flash by providing the appropriate `nic_AMDA*.nffw` file to the respective
47 command. Users need to take care to write the correct firmware image for the
48 card and media configuration to flash.
50 Available storage space in flash depends on the card being used.
52 Dealing with multiple projects
53 ------------------------------
55 NFP hardware is fully programmable therefore there can be different
56 firmware images targeting different applications.
58 When using application firmware from host, we recommend placing
59 actual firmware files in application-named subdirectories in
60 `/lib/firmware/netronome` and linking the desired files, e.g.::
62 $ tree /lib/firmware/netronome/
63 /lib/firmware/netronome/
65 │ ├── nic_AMDA0081-0001_1x40.nffw
66 │ └── nic_AMDA0081-0001_4x10.nffw
68 │ ├── nic_AMDA0081-0001_1x40.nffw
69 │ └── nic_AMDA0081-0001_4x10.nffw
71 │ ├── nic_AMDA0081-0001_1x40.nffw
72 │ └── nic_AMDA0081-0001_4x10.nffw
73 ├── nic_AMDA0081-0001_1x40.nffw -> bpf/nic_AMDA0081-0001_1x40.nffw
74 └── nic_AMDA0081-0001_4x10.nffw -> bpf/nic_AMDA0081-0001_4x10.nffw
76 3 directories, 8 files
78 You may need to use hard instead of symbolic links on distributions
79 which use old `mkinitrd` command instead of `dracut` (e.g. Ubuntu).
81 After changing firmware files you may need to regenerate the initramfs
82 image. Initramfs contains drivers and firmware files your system may
83 need to boot. Refer to the documentation of your distribution to find
84 out how to update initramfs. Good indication of stale initramfs
85 is system loading wrong driver or firmware on boot, but when driver is
86 later reloaded manually everything works correctly.
88 Selecting firmware per device
89 -----------------------------
91 Most commonly all cards on the system use the same type of firmware.
92 If you want to load specific firmware image for a specific card, you
93 can use either the PCI bus address or serial number. Driver will print
94 which files it's looking for when it recognizes a NFP device::
96 nfp: Looking for firmware file in order of priority:
97 nfp: netronome/serial-00-12-34-aa-bb-cc-10-ff.nffw: not found
98 nfp: netronome/pci-0000:02:00.0.nffw: not found
99 nfp: netronome/nic_AMDA0081-0001_1x40.nffw: found, loading...
101 In this case if file (or link) called *serial-00-12-34-aa-bb-5d-10-ff.nffw*
102 or *pci-0000:02:00.0.nffw* is present in `/lib/firmware/netronome` this
103 firmware file will take precedence over `nic_AMDA*` files.
105 Note that `serial-*` and `pci-*` files are **not** automatically included
106 in initramfs, you will have to refer to documentation of appropriate tools
107 to find out how to include them.
109 Firmware loading policy
110 -----------------------
112 Firmware loading policy is controlled via three HWinfo parameters
113 stored as key value pairs in the device flash:
116 Defines which firmware should take precedence, 'Disk' (0), 'Flash' (1) or
117 the 'Preferred' (2) firmware. When 'Preferred' is selected, the management
118 firmware makes the decision over which firmware will be loaded by comparing
119 versions of the flash firmware and the host supplied firmware.
120 This variable is configurable using the 'fw_load_policy'
124 Defines if the driver should reset the firmware when
125 the driver is probed, either 'Disk' (0) if firmware was found on disk,
126 'Always' (1) reset or 'Never' (2) reset. Note that the device is always
127 reset on driver unload if firmware was loaded when the driver was probed.
128 This variable is configurable using the 'reset_dev_on_drv_probe'
132 Defines a list of PF devices allowed to load FW on the device.
133 This variable is not currently user configurable.
138 Following device statistics are available through the ``ethtool -S`` interface:
140 .. flat-table:: NFP device statistics
150 - Packet can be discarded on the RX path for one of the following reasons:
152 * The NIC is not in promisc mode, and the destination MAC address
153 doesn't match the interfaces' MAC address.
154 * The received packet is larger than the max buffer size on the host.
155 I.e. it exceeds the Layer 3 MRU.
156 * There is no freelist descriptor available on the host for the packet.
157 It is likely that the NIC couldn't cache one in time.
158 * A BPF program discarded the packet.
159 * The datapath drop action was executed.
160 * The MAC discarded the packet due to lack of ingress buffer space
165 - A packet can be counted (and dropped) as RX error for the following
168 * A problem with the VEB lookup (only when SR-IOV is used).
169 * A physical layer problem that causes Ethernet errors, like FCS or
170 alignment errors. The cause is usually faulty cables or SFPs.
174 - Total number of bytes received.
178 - Unicast bytes received.
182 - Multicast bytes received.
186 - Broadcast bytes received.
190 - Total number of packets received.
194 - Multicast packets received.
198 - Broadcast packets received.
202 - A packet can be discarded in the TX direction if the MAC is
203 being flow controlled and the NIC runs out of TX queue space.
207 - A packet can be counted as TX error (and dropped) for one for the
210 * The packet is an LSO segment, but the Layer 3 or Layer 4 offset
211 could not be determined. Therefore LSO could not continue.
212 * An invalid packet descriptor was received over PCIe.
213 * The packet Layer 3 length exceeds the device MTU.
214 * An error on the MAC/physical layer. Usually due to faulty cables or
216 * A CTM buffer could not be allocated.
217 * The packet offset was incorrect and could not be fixed by the NIC.
221 - Total number of bytes transmitted.
225 - Unicast bytes transmitted.
229 - Multicast bytes transmitted.
233 - Broadcast bytes transmitted.
237 - Total number of packets transmitted.
241 - Multicast packets transmitted.
245 - Broadcast packets transmitted.
247 Note that statistics unknown to the driver will be displayed as
248 ``dev_unknown_stat$ID``, where ``$ID`` refers to the second column