Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-2.6-microblaze.git] / Documentation / networking / device_drivers / ethernet / intel / iavf.rst
1 .. SPDX-License-Identifier: GPL-2.0+
2
3 =================================================================
4 Linux Base Driver for Intel(R) Ethernet Adaptive Virtual Function
5 =================================================================
6
7 Intel Ethernet Adaptive Virtual Function Linux driver.
8 Copyright(c) 2013-2018 Intel Corporation.
9
10 Contents
11 ========
12
13 - Overview
14 - Identifying Your Adapter
15 - Additional Configurations
16 - Known Issues/Troubleshooting
17 - Support
18
19 Overview
20 ========
21
22 This file describes the iavf Linux Base Driver. This driver was formerly
23 called i40evf.
24
25 The iavf driver supports the below mentioned virtual function devices and
26 can only be activated on kernels running the i40e or newer Physical Function
27 (PF) driver compiled with CONFIG_PCI_IOV.  The iavf driver requires
28 CONFIG_PCI_MSI to be enabled.
29
30 The guest OS loading the iavf driver must support MSI-X interrupts.
31
32 Identifying Your Adapter
33 ========================
34
35 The driver in this kernel is compatible with devices based on the following:
36  * Intel(R) XL710 X710 Virtual Function
37  * Intel(R) X722 Virtual Function
38  * Intel(R) XXV710 Virtual Function
39  * Intel(R) Ethernet Adaptive Virtual Function
40
41 For the best performance, make sure the latest NVM/FW is installed on your
42 device.
43
44 For information on how to identify your adapter, and for the latest NVM/FW
45 images and Intel network drivers, refer to the Intel Support website:
46 https://www.intel.com/support
47
48
49 Additional Features and Configurations
50 ======================================
51
52 Viewing Link Messages
53 ---------------------
54 Link messages will not be displayed to the console if the distribution is
55 restricting system messages. In order to see network driver link messages on
56 your console, set dmesg to eight by entering the following::
57
58     # dmesg -n 8
59
60 NOTE:
61   This setting is not saved across reboots.
62
63 ethtool
64 -------
65 The driver utilizes the ethtool interface for driver configuration and
66 diagnostics, as well as displaying statistical information. The latest ethtool
67 version is required for this functionality. Download it at:
68 https://www.kernel.org/pub/software/network/ethtool/
69
70 Setting VLAN Tag Stripping
71 --------------------------
72 If you have applications that require Virtual Functions (VFs) to receive
73 packets with VLAN tags, you can disable VLAN tag stripping for the VF. The
74 Physical Function (PF) processes requests issued from the VF to enable or
75 disable VLAN tag stripping. Note that if the PF has assigned a VLAN to a VF,
76 then requests from that VF to set VLAN tag stripping will be ignored.
77
78 To enable/disable VLAN tag stripping for a VF, issue the following command
79 from inside the VM in which you are running the VF::
80
81     # ethtool -K <if_name> rxvlan on/off
82
83 or alternatively::
84
85     # ethtool --offload <if_name> rxvlan on/off
86
87 Adaptive Virtual Function
88 -------------------------
89 Adaptive Virtual Function (AVF) allows the virtual function driver, or VF, to
90 adapt to changing feature sets of the physical function driver (PF) with which
91 it is associated. This allows system administrators to update a PF without
92 having to update all the VFs associated with it. All AVFs have a single common
93 device ID and branding string.
94
95 AVFs have a minimum set of features known as "base mode," but may provide
96 additional features depending on what features are available in the PF with
97 which the AVF is associated. The following are base mode features:
98
99 - 4 Queue Pairs (QP) and associated Configuration Status Registers (CSRs)
100   for Tx/Rx
101 - i40e descriptors and ring format
102 - Descriptor write-back completion
103 - 1 control queue, with i40e descriptors, CSRs and ring format
104 - 5 MSI-X interrupt vectors and corresponding i40e CSRs
105 - 1 Interrupt Throttle Rate (ITR) index
106 - 1 Virtual Station Interface (VSI) per VF
107 - 1 Traffic Class (TC), TC0
108 - Receive Side Scaling (RSS) with 64 entry indirection table and key,
109   configured through the PF
110 - 1 unicast MAC address reserved per VF
111 - 16 MAC address filters for each VF
112 - Stateless offloads - non-tunneled checksums
113 - AVF device ID
114 - HW mailbox is used for VF to PF communications (including on Windows)
115
116 IEEE 802.1ad (QinQ) Support
117 ---------------------------
118 The IEEE 802.1ad standard, informally known as QinQ, allows for multiple VLAN
119 IDs within a single Ethernet frame. VLAN IDs are sometimes referred to as
120 "tags," and multiple VLAN IDs are thus referred to as a "tag stack." Tag stacks
121 allow L2 tunneling and the ability to segregate traffic within a particular
122 VLAN ID, among other uses.
123
124 The following are examples of how to configure 802.1ad (QinQ)::
125
126     # ip link add link eth0 eth0.24 type vlan proto 802.1ad id 24
127     # ip link add link eth0.24 eth0.24.371 type vlan proto 802.1Q id 371
128
129 Where "24" and "371" are example VLAN IDs.
130
131 NOTES:
132   Receive checksum offloads, cloud filters, and VLAN acceleration are not
133   supported for 802.1ad (QinQ) packets.
134
135 Application Device Queues (ADq)
136 -------------------------------
137 Application Device Queues (ADq) allows you to dedicate one or more queues to a
138 specific application. This can reduce latency for the specified application,
139 and allow Tx traffic to be rate limited per application. Follow the steps below
140 to set ADq.
141
142 Requirements:
143
144 - The sch_mqprio, act_mirred and cls_flower modules must be loaded
145 - The latest version of iproute2
146 - If another driver (for example, DPDK) has set cloud filters, you cannot
147   enable ADQ
148 - Depending on the underlying PF device, ADQ cannot be enabled when the
149   following features are enabled:
150
151   + Data Center Bridging (DCB)
152   + Multiple Functions per Port (MFP)
153   + Sideband Filters
154
155 1. Create traffic classes (TCs). Maximum of 8 TCs can be created per interface.
156 The shaper bw_rlimit parameter is optional.
157
158 Example: Sets up two tcs, tc0 and tc1, with 16 queues each and max tx rate set
159 to 1Gbit for tc0 and 3Gbit for tc1.
160
161 ::
162
163     tc qdisc add dev <interface> root mqprio num_tc 2 map 0 0 0 0 1 1 1 1
164     queues 16@0 16@16 hw 1 mode channel shaper bw_rlimit min_rate 1Gbit 2Gbit
165     max_rate 1Gbit 3Gbit
166
167 map: priority mapping for up to 16 priorities to tcs (e.g. map 0 0 0 0 1 1 1 1
168 sets priorities 0-3 to use tc0 and 4-7 to use tc1)
169
170 queues: for each tc, <num queues>@<offset> (e.g. queues 16@0 16@16 assigns
171 16 queues to tc0 at offset 0 and 16 queues to tc1 at offset 16. Max total
172 number of queues for all tcs is 64 or number of cores, whichever is lower.)
173
174 hw 1 mode channel: ‘channel’ with ‘hw’ set to 1 is a new new hardware
175 offload mode in mqprio that makes full use of the mqprio options, the
176 TCs, the queue configurations, and the QoS parameters.
177
178 shaper bw_rlimit: for each tc, sets minimum and maximum bandwidth rates.
179 Totals must be equal or less than port speed.
180
181 For example: min_rate 1Gbit 3Gbit: Verify bandwidth limit using network
182 monitoring tools such as ``ifstat`` or ``sar -n DEV [interval] [number of samples]``
183
184 NOTE:
185   Setting up channels via ethtool (ethtool -L) is not supported when the
186   TCs are configured using mqprio.
187
188 2. Enable HW TC offload on interface::
189
190     # ethtool -K <interface> hw-tc-offload on
191
192 3. Apply TCs to ingress (RX) flow of interface::
193
194     # tc qdisc add dev <interface> ingress
195
196 NOTES:
197  - Run all tc commands from the iproute2 <pathtoiproute2>/tc/ directory
198  - ADq is not compatible with cloud filters
199  - Setting up channels via ethtool (ethtool -L) is not supported when the TCs
200    are configured using mqprio
201  - You must have iproute2 latest version
202  - NVM version 6.01 or later is required
203  - ADq cannot be enabled when any the following features are enabled: Data
204    Center Bridging (DCB), Multiple Functions per Port (MFP), or Sideband Filters
205  - If another driver (for example, DPDK) has set cloud filters, you cannot
206    enable ADq
207  - Tunnel filters are not supported in ADq. If encapsulated packets do arrive
208    in non-tunnel mode, filtering will be done on the inner headers.  For example,
209    for VXLAN traffic in non-tunnel mode, PCTYPE is identified as a VXLAN
210    encapsulated packet, outer headers are ignored. Therefore, inner headers are
211    matched.
212  - If a TC filter on a PF matches traffic over a VF (on the PF), that traffic
213    will be routed to the appropriate queue of the PF, and will not be passed on
214    the VF. Such traffic will end up getting dropped higher up in the TCP/IP
215    stack as it does not match PF address data.
216  - If traffic matches multiple TC filters that point to different TCs, that
217    traffic will be duplicated and sent to all matching TC queues.  The hardware
218    switch mirrors the packet to a VSI list when multiple filters are matched.
219
220
221 Known Issues/Troubleshooting
222 ============================
223
224 Bonding fails with VFs bound to an Intel(R) Ethernet Controller 700 series device
225 ---------------------------------------------------------------------------------
226 If you bind Virtual Functions (VFs) to an Intel(R) Ethernet Controller 700
227 series based device, the VF slaves may fail when they become the active slave.
228 If the MAC address of the VF is set by the PF (Physical Function) of the
229 device, when you add a slave, or change the active-backup slave, Linux bonding
230 tries to sync the backup slave's MAC address to the same MAC address as the
231 active slave. Linux bonding will fail at this point. This issue will not occur
232 if the VF's MAC address is not set by the PF.
233
234 Traffic Is Not Being Passed Between VM and Client
235 -------------------------------------------------
236 You may not be able to pass traffic between a client system and a
237 Virtual Machine (VM) running on a separate host if the Virtual Function
238 (VF, or Virtual NIC) is not in trusted mode and spoof checking is enabled
239 on the VF. Note that this situation can occur in any combination of client,
240 host, and guest operating system. For information on how to set the VF to
241 trusted mode, refer to the section "VLAN Tag Packet Steering" in this
242 readme document. For information on setting spoof checking, refer to the
243 section "MAC and VLAN anti-spoofing feature" in this readme document.
244
245 Do not unload port driver if VF with active VM is bound to it
246 -------------------------------------------------------------
247 Do not unload a port's driver if a Virtual Function (VF) with an active Virtual
248 Machine (VM) is bound to it. Doing so will cause the port to appear to hang.
249 Once the VM shuts down, or otherwise releases the VF, the command will complete.
250
251 Using four traffic classes fails
252 --------------------------------
253 Do not try to reserve more than three traffic classes in the iavf driver. Doing
254 so will fail to set any traffic classes and will cause the driver to write
255 errors to stdout. Use a maximum of three queues to avoid this issue.
256
257 Multiple log error messages on iavf driver removal
258 --------------------------------------------------
259 If you have several VFs and you remove the iavf driver, several instances of
260 the following log errors are written to the log::
261
262     Unable to send opcode 2 to PF, err I40E_ERR_QUEUE_EMPTY, aq_err ok
263     Unable to send the message to VF 2 aq_err 12
264     ARQ Overflow Error detected
265
266 Virtual machine does not get link
267 ---------------------------------
268 If the virtual machine has more than one virtual port assigned to it, and those
269 virtual ports are bound to different physical ports, you may not get link on
270 all of the virtual ports. The following command may work around the issue::
271
272     # ethtool -r <PF>
273
274 Where <PF> is the PF interface in the host, for example: p5p1. You may need to
275 run the command more than once to get link on all virtual ports.
276
277 MAC address of Virtual Function changes unexpectedly
278 ----------------------------------------------------
279 If a Virtual Function's MAC address is not assigned in the host, then the VF
280 (virtual function) driver will use a random MAC address. This random MAC
281 address may change each time the VF driver is reloaded. You can assign a static
282 MAC address in the host machine. This static MAC address will survive
283 a VF driver reload.
284
285 Driver Buffer Overflow Fix
286 --------------------------
287 The fix to resolve CVE-2016-8105, referenced in Intel SA-00069
288 https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00069.html
289 is included in this and future versions of the driver.
290
291 Multiple Interfaces on Same Ethernet Broadcast Network
292 ------------------------------------------------------
293 Due to the default ARP behavior on Linux, it is not possible to have one system
294 on two IP networks in the same Ethernet broadcast domain (non-partitioned
295 switch) behave as expected. All Ethernet interfaces will respond to IP traffic
296 for any IP address assigned to the system. This results in unbalanced receive
297 traffic.
298
299 If you have multiple interfaces in a server, either turn on ARP filtering by
300 entering::
301
302     # echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter
303
304 NOTE:
305   This setting is not saved across reboots. The configuration change can be
306   made permanent by adding the following line to the file /etc/sysctl.conf::
307
308     net.ipv4.conf.all.arp_filter = 1
309
310 Another alternative is to install the interfaces in separate broadcast domains
311 (either in different switches or in a switch partitioned to VLANs).
312
313 Rx Page Allocation Errors
314 -------------------------
315 'Page allocation failure. order:0' errors may occur under stress.
316 This is caused by the way the Linux kernel reports this stressed condition.
317
318
319 Support
320 =======
321 For general information, go to the Intel support website at:
322
323 https://support.intel.com
324
325 or the Intel Wired Networking project hosted by Sourceforge at:
326
327 https://sourceforge.net/projects/e1000
328
329 If an issue is identified with the released source code on the supported kernel
330 with a supported adapter, email the specific information related to the issue
331 to e1000-devel@lists.sf.net