iavf.rst 13 KB

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