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