i40e.rst 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  1. .. SPDX-License-Identifier: GPL-2.0+
  2. =================================================================
  3. Linux Base Driver for the Intel(R) Ethernet Controller 700 Series
  4. =================================================================
  5. Intel 40 Gigabit Linux driver.
  6. Copyright(c) 1999-2018 Intel Corporation.
  7. Contents
  8. ========
  9. - Overview
  10. - Identifying Your Adapter
  11. - Intel(R) Ethernet Flow Director
  12. - Additional Configurations
  13. - Known Issues
  14. - Support
  15. Driver information can be obtained using ethtool, lspci, and ifconfig.
  16. Instructions on updating ethtool can be found in the section Additional
  17. Configurations later in this document.
  18. For questions related to hardware requirements, refer to the documentation
  19. supplied with your Intel adapter. All hardware requirements listed apply to use
  20. with Linux.
  21. Identifying Your Adapter
  22. ========================
  23. The driver is compatible with devices based on the following:
  24. * Intel(R) Ethernet Controller X710
  25. * Intel(R) Ethernet Controller XL710
  26. * Intel(R) Ethernet Network Connection X722
  27. * Intel(R) Ethernet Controller XXV710
  28. For the best performance, make sure the latest NVM/FW is installed on your
  29. device.
  30. For information on how to identify your adapter, and for the latest NVM/FW
  31. images and Intel network drivers, refer to the Intel Support website:
  32. https://www.intel.com/support
  33. SFP+ and QSFP+ Devices
  34. ----------------------
  35. For information about supported media, refer to this document:
  36. https://www.intel.com/content/dam/www/public/us/en/documents/release-notes/xl710-ethernet-controller-feature-matrix.pdf
  37. NOTE: Some adapters based on the Intel(R) Ethernet Controller 700 Series only
  38. support Intel Ethernet Optics modules. On these adapters, other modules are not
  39. supported and will not function. In all cases Intel recommends using Intel
  40. Ethernet Optics; other modules may function but are not validated by Intel.
  41. Contact Intel for supported media types.
  42. NOTE: For connections based on Intel(R) Ethernet Controller 700 Series, support
  43. is dependent on your system board. Please see your vendor for details.
  44. NOTE: In systems that do not have adequate airflow to cool the adapter and
  45. optical modules, you must use high temperature optical modules.
  46. Virtual Functions (VFs)
  47. -----------------------
  48. Use sysfs to enable VFs. For example::
  49. #echo $num_vf_enabled > /sys/class/net/$dev/device/sriov_numvfs #enable VFs
  50. #echo 0 > /sys/class/net/$dev/device/sriov_numvfs #disable VFs
  51. For example, the following instructions will configure PF eth0 and the first VF
  52. on VLAN 10::
  53. $ ip link set dev eth0 vf 0 vlan 10
  54. VLAN Tag Packet Steering
  55. ------------------------
  56. Allows you to send all packets with a specific VLAN tag to a particular SR-IOV
  57. virtual function (VF). Further, this feature allows you to designate a
  58. particular VF as trusted, and allows that trusted VF to request selective
  59. promiscuous mode on the Physical Function (PF).
  60. To set a VF as trusted or untrusted, enter the following command in the
  61. Hypervisor::
  62. # ip link set dev eth0 vf 1 trust [on|off]
  63. Once the VF is designated as trusted, use the following commands in the VM to
  64. set the VF to promiscuous mode.
  65. ::
  66. For promiscuous all:
  67. #ip link set eth2 promisc on
  68. Where eth2 is a VF interface in the VM
  69. For promiscuous Multicast:
  70. #ip link set eth2 allmulticast on
  71. Where eth2 is a VF interface in the VM
  72. NOTE: By default, the ethtool priv-flag vf-true-promisc-support is set to
  73. "off",meaning that promiscuous mode for the VF will be limited. To set the
  74. promiscuous mode for the VF to true promiscuous and allow the VF to see all
  75. ingress traffic, use the following command::
  76. #ethtool -set-priv-flags p261p1 vf-true-promisc-support on
  77. The vf-true-promisc-support priv-flag does not enable promiscuous mode; rather,
  78. it designates which type of promiscuous mode (limited or true) you will get
  79. when you enable promiscuous mode using the ip link commands above. Note that
  80. this is a global setting that affects the entire device. However,the
  81. vf-true-promisc-support priv-flag is only exposed to the first PF of the
  82. device. The PF remains in limited promiscuous mode (unless it is in MFP mode)
  83. regardless of the vf-true-promisc-support setting.
  84. Now add a VLAN interface on the VF interface::
  85. #ip link add link eth2 name eth2.100 type vlan id 100
  86. Note that the order in which you set the VF to promiscuous mode and add the
  87. VLAN interface does not matter (you can do either first). The end result in
  88. this example is that the VF will get all traffic that is tagged with VLAN 100.
  89. Intel(R) Ethernet Flow Director
  90. -------------------------------
  91. The Intel Ethernet Flow Director performs the following tasks:
  92. - Directs receive packets according to their flows to different queues.
  93. - Enables tight control on routing a flow in the platform.
  94. - Matches flows and CPU cores for flow affinity.
  95. - Supports multiple parameters for flexible flow classification and load
  96. balancing (in SFP mode only).
  97. NOTE: The Linux i40e driver supports the following flow types: IPv4, TCPv4, and
  98. UDPv4. For a given flow type, it supports valid combinations of IP addresses
  99. (source or destination) and UDP/TCP ports (source and destination). For
  100. example, you can supply only a source IP address, a source IP address and a
  101. destination port, or any combination of one or more of these four parameters.
  102. NOTE: The Linux i40e driver allows you to filter traffic based on a
  103. user-defined flexible two-byte pattern and offset by using the ethtool user-def
  104. and mask fields. Only L3 and L4 flow types are supported for user-defined
  105. flexible filters. For a given flow type, you must clear all Intel Ethernet Flow
  106. Director filters before changing the input set (for that flow type).
  107. To enable or disable the Intel Ethernet Flow Director::
  108. # ethtool -K ethX ntuple <on|off>
  109. When disabling ntuple filters, all the user programmed filters are flushed from
  110. the driver cache and hardware. All needed filters must be re-added when ntuple
  111. is re-enabled.
  112. To add a filter that directs packet to queue 2, use -U or -N switch::
  113. # ethtool -N ethX flow-type tcp4 src-ip 192.168.10.1 dst-ip \
  114. 192.168.10.2 src-port 2000 dst-port 2001 action 2 [loc 1]
  115. To set a filter using only the source and destination IP address::
  116. # ethtool -N ethX flow-type tcp4 src-ip 192.168.10.1 dst-ip \
  117. 192.168.10.2 action 2 [loc 1]
  118. To see the list of filters currently present::
  119. # ethtool <-u|-n> ethX
  120. Application Targeted Routing (ATR) Perfect Filters
  121. --------------------------------------------------
  122. ATR is enabled by default when the kernel is in multiple transmit queue mode.
  123. An ATR Intel Ethernet Flow Director filter rule is added when a TCP-IP flow
  124. starts and is deleted when the flow ends. When a TCP-IP Intel Ethernet Flow
  125. Director rule is added from ethtool (Sideband filter), ATR is turned off by the
  126. driver. To re-enable ATR, the sideband can be disabled with the ethtool -K
  127. option. For example::
  128. ethtool -K [adapter] ntuple [off|on]
  129. If sideband is re-enabled after ATR is re-enabled, ATR remains enabled until a
  130. TCP-IP flow is added. When all TCP-IP sideband rules are deleted, ATR is
  131. automatically re-enabled.
  132. Packets that match the ATR rules are counted in fdir_atr_match stats in
  133. ethtool, which also can be used to verify whether ATR rules still exist.
  134. Sideband Perfect Filters
  135. ------------------------
  136. Sideband Perfect Filters are used to direct traffic that matches specified
  137. characteristics. They are enabled through ethtool's ntuple interface. To add a
  138. new filter use the following command::
  139. ethtool -U <device> flow-type <type> src-ip <ip> dst-ip <ip> src-port <port> \
  140. dst-port <port> action <queue>
  141. Where:
  142. <device> - the ethernet device to program
  143. <type> - can be ip4, tcp4, udp4, or sctp4
  144. <ip> - the ip address to match on
  145. <port> - the port number to match on
  146. <queue> - the queue to direct traffic towards (-1 discards matching traffic)
  147. Use the following command to display all of the active filters::
  148. ethtool -u <device>
  149. Use the following command to delete a filter::
  150. ethtool -U <device> delete <N>
  151. Where <N> is the filter id displayed when printing all the active filters, and
  152. may also have been specified using "loc <N>" when adding the filter.
  153. The following example matches TCP traffic sent from 192.168.0.1, port 5300,
  154. directed to 192.168.0.5, port 80, and sends it to queue 7::
  155. ethtool -U enp130s0 flow-type tcp4 src-ip 192.168.0.1 dst-ip 192.168.0.5 \
  156. src-port 5300 dst-port 80 action 7
  157. For each flow-type, the programmed filters must all have the same matching
  158. input set. For example, issuing the following two commands is acceptable::
  159. ethtool -U enp130s0 flow-type ip4 src-ip 192.168.0.1 src-port 5300 action 7
  160. ethtool -U enp130s0 flow-type ip4 src-ip 192.168.0.5 src-port 55 action 10
  161. Issuing the next two commands, however, is not acceptable, since the first
  162. specifies src-ip and the second specifies dst-ip::
  163. ethtool -U enp130s0 flow-type ip4 src-ip 192.168.0.1 src-port 5300 action 7
  164. ethtool -U enp130s0 flow-type ip4 dst-ip 192.168.0.5 src-port 55 action 10
  165. The second command will fail with an error. You may program multiple filters
  166. with the same fields, using different values, but, on one device, you may not
  167. program two tcp4 filters with different matching fields.
  168. Matching on a sub-portion of a field is not supported by the i40e driver, thus
  169. partial mask fields are not supported.
  170. The driver also supports matching user-defined data within the packet payload.
  171. This flexible data is specified using the "user-def" field of the ethtool
  172. command in the following way:
  173. +----------------------------+--------------------------+
  174. | 31 28 24 20 16 | 15 12 8 4 0 |
  175. +----------------------------+--------------------------+
  176. | offset into packet payload | 2 bytes of flexible data |
  177. +----------------------------+--------------------------+
  178. For example,
  179. ::
  180. ... user-def 0x4FFFF ...
  181. tells the filter to look 4 bytes into the payload and match that value against
  182. 0xFFFF. The offset is based on the beginning of the payload, and not the
  183. beginning of the packet. Thus
  184. ::
  185. flow-type tcp4 ... user-def 0x8BEAF ...
  186. would match TCP/IPv4 packets which have the value 0xBEAF 8 bytes into the
  187. TCP/IPv4 payload.
  188. Note that ICMP headers are parsed as 4 bytes of header and 4 bytes of payload.
  189. Thus to match the first byte of the payload, you must actually add 4 bytes to
  190. the offset. Also note that ip4 filters match both ICMP frames as well as raw
  191. (unknown) ip4 frames, where the payload will be the L3 payload of the IP4 frame.
  192. The maximum offset is 64. The hardware will only read up to 64 bytes of data
  193. from the payload. The offset must be even because the flexible data is 2 bytes
  194. long and must be aligned to byte 0 of the packet payload.
  195. The user-defined flexible offset is also considered part of the input set and
  196. cannot be programmed separately for multiple filters of the same type. However,
  197. the flexible data is not part of the input set and multiple filters may use the
  198. same offset but match against different data.
  199. To create filters that direct traffic to a specific Virtual Function, use the
  200. "action" parameter. Specify the action as a 64 bit value, where the lower 32
  201. bits represents the queue number, while the next 8 bits represent which VF.
  202. Note that 0 is the PF, so the VF identifier is offset by 1. For example::
  203. ... action 0x800000002 ...
  204. specifies to direct traffic to Virtual Function 7 (8 minus 1) into queue 2 of
  205. that VF.
  206. Note that these filters will not break internal routing rules, and will not
  207. route traffic that otherwise would not have been sent to the specified Virtual
  208. Function.
  209. Setting the link-down-on-close Private Flag
  210. -------------------------------------------
  211. When the link-down-on-close private flag is set to "on", the port's link will
  212. go down when the interface is brought down using the ifconfig ethX down command.
  213. Use ethtool to view and set link-down-on-close, as follows::
  214. ethtool --show-priv-flags ethX
  215. ethtool --set-priv-flags ethX link-down-on-close [on|off]
  216. Setting the mdd-auto-reset-vf Private Flag
  217. ------------------------------------------
  218. When the mdd-auto-reset-vf private flag is set to "on", the problematic VF will
  219. be automatically reset if a malformed descriptor is detected. If the flag is
  220. set to "off", the problematic VF will be disabled.
  221. Use ethtool to view and set mdd-auto-reset-vf, as follows::
  222. ethtool --show-priv-flags ethX
  223. ethtool --set-priv-flags ethX mdd-auto-reset-vf [on|off]
  224. Viewing Link Messages
  225. ---------------------
  226. Link messages will not be displayed to the console if the distribution is
  227. restricting system messages. In order to see network driver link messages on
  228. your console, set dmesg to eight by entering the following::
  229. dmesg -n 8
  230. NOTE: This setting is not saved across reboots.
  231. Jumbo Frames
  232. ------------
  233. Jumbo Frames support is enabled by changing the Maximum Transmission Unit (MTU)
  234. to a value larger than the default value of 1500.
  235. Use the ifconfig command to increase the MTU size. For example, enter the
  236. following where <x> is the interface number::
  237. ifconfig eth<x> mtu 9000 up
  238. Alternatively, you can use the ip command as follows::
  239. ip link set mtu 9000 dev eth<x>
  240. ip link set up dev eth<x>
  241. This setting is not saved across reboots. The setting change can be made
  242. permanent by adding 'MTU=9000' to the file::
  243. /etc/sysconfig/network-scripts/ifcfg-eth<x> // for RHEL
  244. /etc/sysconfig/network/<config_file> // for SLES
  245. NOTE: The maximum MTU setting for Jumbo Frames is 9702. This value coincides
  246. with the maximum Jumbo Frames size of 9728 bytes.
  247. NOTE: This driver will attempt to use multiple page sized buffers to receive
  248. each jumbo packet. This should help to avoid buffer starvation issues when
  249. allocating receive packets.
  250. ethtool
  251. -------
  252. The driver utilizes the ethtool interface for driver configuration and
  253. diagnostics, as well as displaying statistical information. The latest ethtool
  254. version is required for this functionality. Download it at:
  255. https://www.kernel.org/pub/software/network/ethtool/
  256. Supported ethtool Commands and Options for Filtering
  257. ----------------------------------------------------
  258. -n --show-nfc
  259. Retrieves the receive network flow classification configurations.
  260. rx-flow-hash tcp4|udp4|ah4|esp4|sctp4|tcp6|udp6|ah6|esp6|sctp6
  261. Retrieves the hash options for the specified network traffic type.
  262. -N --config-nfc
  263. Configures the receive network flow classification.
  264. rx-flow-hash tcp4|udp4|ah4|esp4|sctp4|tcp6|udp6|ah6|esp6|sctp6 m|v|t|s|d|f|n|r...
  265. Configures the hash options for the specified network traffic type.
  266. udp4 UDP over IPv4
  267. udp6 UDP over IPv6
  268. f Hash on bytes 0 and 1 of the Layer 4 header of the Rx packet.
  269. n Hash on bytes 2 and 3 of the Layer 4 header of the Rx packet.
  270. Speed and Duplex Configuration
  271. ------------------------------
  272. In addressing speed and duplex configuration issues, you need to distinguish
  273. between copper-based adapters and fiber-based adapters.
  274. In the default mode, an Intel(R) Ethernet Network Adapter using copper
  275. connections will attempt to auto-negotiate with its link partner to determine
  276. the best setting. If the adapter cannot establish link with the link partner
  277. using auto-negotiation, you may need to manually configure the adapter and link
  278. partner to identical settings to establish link and pass packets. This should
  279. only be needed when attempting to link with an older switch that does not
  280. support auto-negotiation or one that has been forced to a specific speed or
  281. duplex mode. Your link partner must match the setting you choose. 1 Gbps speeds
  282. and higher cannot be forced. Use the autonegotiation advertising setting to
  283. manually set devices for 1 Gbps and higher.
  284. NOTE: You cannot set the speed for devices based on the Intel(R) Ethernet
  285. Network Adapter XXV710 based devices.
  286. Speed, duplex, and autonegotiation advertising are configured through the
  287. ethtool utility.
  288. Caution: Only experienced network administrators should force speed and duplex
  289. or change autonegotiation advertising manually. The settings at the switch must
  290. always match the adapter settings. Adapter performance may suffer or your
  291. adapter may not operate if you configure the adapter differently from your
  292. switch.
  293. An Intel(R) Ethernet Network Adapter using fiber-based connections, however,
  294. will not attempt to auto-negotiate with its link partner since those adapters
  295. operate only in full duplex and only at their native speed.
  296. NAPI
  297. ----
  298. NAPI (Rx polling mode) is supported in the i40e driver.
  299. See :ref:`Documentation/networking/napi.rst <napi>` for more information.
  300. Flow Control
  301. ------------
  302. Ethernet Flow Control (IEEE 802.3x) can be configured with ethtool to enable
  303. receiving and transmitting pause frames for i40e. When transmit is enabled,
  304. pause frames are generated when the receive packet buffer crosses a predefined
  305. threshold. When receive is enabled, the transmit unit will halt for the time
  306. delay specified when a pause frame is received.
  307. NOTE: You must have a flow control capable link partner.
  308. Flow Control is on by default.
  309. Use ethtool to change the flow control settings.
  310. To enable or disable Rx or Tx Flow Control::
  311. ethtool -A eth? rx <on|off> tx <on|off>
  312. Note: This command only enables or disables Flow Control if auto-negotiation is
  313. disabled. If auto-negotiation is enabled, this command changes the parameters
  314. used for auto-negotiation with the link partner.
  315. To enable or disable auto-negotiation::
  316. ethtool -s eth? autoneg <on|off>
  317. Note: Flow Control auto-negotiation is part of link auto-negotiation. Depending
  318. on your device, you may not be able to change the auto-negotiation setting.
  319. RSS Hash Flow
  320. -------------
  321. Allows you to set the hash bytes per flow type and any combination of one or
  322. more options for Receive Side Scaling (RSS) hash byte configuration.
  323. ::
  324. # ethtool -N <dev> rx-flow-hash <type> <option>
  325. Where <type> is:
  326. tcp4 signifying TCP over IPv4
  327. udp4 signifying UDP over IPv4
  328. tcp6 signifying TCP over IPv6
  329. udp6 signifying UDP over IPv6
  330. And <option> is one or more of:
  331. s Hash on the IP source address of the Rx packet.
  332. d Hash on the IP destination address of the Rx packet.
  333. f Hash on bytes 0 and 1 of the Layer 4 header of the Rx packet.
  334. n Hash on bytes 2 and 3 of the Layer 4 header of the Rx packet.
  335. MAC and VLAN anti-spoofing feature
  336. ----------------------------------
  337. When a malicious driver attempts to send a spoofed packet, it is dropped by the
  338. hardware and not transmitted.
  339. NOTE: This feature can be disabled for a specific Virtual Function (VF)::
  340. ip link set <pf dev> vf <vf id> spoofchk {off|on}
  341. IEEE 1588 Precision Time Protocol (PTP) Hardware Clock (PHC)
  342. ------------------------------------------------------------
  343. Precision Time Protocol (PTP) is used to synchronize clocks in a computer
  344. network. PTP support varies among Intel devices that support this driver. Use
  345. "ethtool -T <netdev name>" to get a definitive list of PTP capabilities
  346. supported by the device.
  347. IEEE 802.1ad (QinQ) Support
  348. ---------------------------
  349. The IEEE 802.1ad standard, informally known as QinQ, allows for multiple VLAN
  350. IDs within a single Ethernet frame. VLAN IDs are sometimes referred to as
  351. "tags," and multiple VLAN IDs are thus referred to as a "tag stack." Tag stacks
  352. allow L2 tunneling and the ability to segregate traffic within a particular
  353. VLAN ID, among other uses.
  354. The following are examples of how to configure 802.1ad (QinQ)::
  355. ip link add link eth0 eth0.24 type vlan proto 802.1ad id 24
  356. ip link add link eth0.24 eth0.24.371 type vlan proto 802.1Q id 371
  357. Where "24" and "371" are example VLAN IDs.
  358. NOTES:
  359. Receive checksum offloads, cloud filters, and VLAN acceleration are not
  360. supported for 802.1ad (QinQ) packets.
  361. VXLAN and GENEVE Overlay HW Offloading
  362. --------------------------------------
  363. Virtual Extensible LAN (VXLAN) allows you to extend an L2 network over an L3
  364. network, which may be useful in a virtualized or cloud environment. Some
  365. Intel(R) Ethernet Network devices perform VXLAN processing, offloading it from
  366. the operating system. This reduces CPU utilization.
  367. VXLAN offloading is controlled by the Tx and Rx checksum offload options
  368. provided by ethtool. That is, if Tx checksum offload is enabled, and the
  369. adapter has the capability, VXLAN offloading is also enabled.
  370. Support for VXLAN and GENEVE HW offloading is dependent on kernel support of
  371. the HW offloading features.
  372. Multiple Functions per Port
  373. ---------------------------
  374. Some adapters based on the Intel Ethernet Controller X710/XL710 support
  375. multiple functions on a single physical port. Configure these functions through
  376. the System Setup/BIOS.
  377. Minimum TX Bandwidth is the guaranteed minimum data transmission bandwidth, as
  378. a percentage of the full physical port link speed, that the partition will
  379. receive. The bandwidth the partition is awarded will never fall below the level
  380. you specify.
  381. The range for the minimum bandwidth values is:
  382. 1 to ((100 minus # of partitions on the physical port) plus 1)
  383. For example, if a physical port has 4 partitions, the range would be:
  384. 1 to ((100 - 4) + 1 = 97)
  385. The Maximum Bandwidth percentage represents the maximum transmit bandwidth
  386. allocated to the partition as a percentage of the full physical port link
  387. speed. The accepted range of values is 1-100. The value is used as a limiter,
  388. should you chose that any one particular function not be able to consume 100%
  389. of a port's bandwidth (should it be available). The sum of all the values for
  390. Maximum Bandwidth is not restricted, because no more than 100% of a port's
  391. bandwidth can ever be used.
  392. NOTE: X710/XXV710 devices fail to enable Max VFs (64) when Multiple Functions
  393. per Port (MFP) and SR-IOV are enabled. An error from i40e is logged that says
  394. "add vsi failed for VF N, aq_err 16". To workaround the issue, enable less than
  395. 64 virtual functions (VFs).
  396. Data Center Bridging (DCB)
  397. --------------------------
  398. DCB is a configuration Quality of Service implementation in hardware. It uses
  399. the VLAN priority tag (802.1p) to filter traffic. That means that there are 8
  400. different priorities that traffic can be filtered into. It also enables
  401. priority flow control (802.1Qbb) which can limit or eliminate the number of
  402. dropped packets during network stress. Bandwidth can be allocated to each of
  403. these priorities, which is enforced at the hardware level (802.1Qaz).
  404. Adapter firmware implements LLDP and DCBX protocol agents as per 802.1AB and
  405. 802.1Qaz respectively. The firmware based DCBX agent runs in willing mode only
  406. and can accept settings from a DCBX capable peer. Software configuration of
  407. DCBX parameters via dcbtool/lldptool are not supported.
  408. NOTE: Firmware LLDP can be disabled by setting the private flag disable-fw-lldp.
  409. The i40e driver implements the DCB netlink interface layer to allow user-space
  410. to communicate with the driver and query DCB configuration for the port.
  411. NOTE:
  412. The kernel assumes that TC0 is available, and will disable Priority Flow
  413. Control (PFC) on the device if TC0 is not available. To fix this, ensure TC0 is
  414. enabled when setting up DCB on your switch.
  415. Interrupt Rate Limiting
  416. -----------------------
  417. :Valid Range: 0-235 (0=no limit)
  418. The Intel(R) Ethernet Controller XL710 family supports an interrupt rate
  419. limiting mechanism. The user can control, via ethtool, the number of
  420. microseconds between interrupts.
  421. Syntax::
  422. # ethtool -C ethX rx-usecs-high N
  423. The range of 0-235 microseconds provides an effective range of 4,310 to 250,000
  424. interrupts per second. The value of rx-usecs-high can be set independently of
  425. rx-usecs and tx-usecs in the same ethtool command, and is also independent of
  426. the adaptive interrupt moderation algorithm. The underlying hardware supports
  427. granularity in 4-microsecond intervals, so adjacent values may result in the
  428. same interrupt rate.
  429. One possible use case is the following::
  430. # ethtool -C ethX adaptive-rx off adaptive-tx off rx-usecs-high 20 rx-usecs \
  431. 5 tx-usecs 5
  432. The above command would disable adaptive interrupt moderation, and allow a
  433. maximum of 5 microseconds before indicating a receive or transmit was complete.
  434. However, instead of resulting in as many as 200,000 interrupts per second, it
  435. limits total interrupts per second to 50,000 via the rx-usecs-high parameter.
  436. Performance Optimization
  437. ========================
  438. Driver defaults are meant to fit a wide variety of workloads, but if further
  439. optimization is required we recommend experimenting with the following settings.
  440. NOTE: For better performance when processing small (64B) frame sizes, try
  441. enabling Hyper threading in the BIOS in order to increase the number of logical
  442. cores in the system and subsequently increase the number of queues available to
  443. the adapter.
  444. Virtualized Environments
  445. ------------------------
  446. 1. Disable XPS on both ends by using the included virt_perf_default script
  447. or by running the following command as root::
  448. for file in `ls /sys/class/net/<ethX>/queues/tx-*/xps_cpus`;
  449. do echo 0 > $file; done
  450. 2. Using the appropriate mechanism (vcpupin) in the vm, pin the cpu's to
  451. individual lcpu's, making sure to use a set of cpu's included in the
  452. device's local_cpulist: /sys/class/net/<ethX>/device/local_cpulist.
  453. 3. Configure as many Rx/Tx queues in the VM as available. Do not rely on
  454. the default setting of 1.
  455. Non-virtualized Environments
  456. ----------------------------
  457. Pin the adapter's IRQs to specific cores by disabling the irqbalance service
  458. and using the included set_irq_affinity script. Please see the script's help
  459. text for further options.
  460. - The following settings will distribute the IRQs across all the cores evenly::
  461. # scripts/set_irq_affinity -x all <interface1> , [ <interface2>, ... ]
  462. - The following settings will distribute the IRQs across all the cores that are
  463. local to the adapter (same NUMA node)::
  464. # scripts/set_irq_affinity -x local <interface1> ,[ <interface2>, ... ]
  465. For very CPU intensive workloads, we recommend pinning the IRQs to all cores.
  466. For IP Forwarding: Disable Adaptive ITR and lower Rx and Tx interrupts per
  467. queue using ethtool.
  468. - Setting rx-usecs and tx-usecs to 125 will limit interrupts to about 8000
  469. interrupts per second per queue.
  470. ::
  471. # ethtool -C <interface> adaptive-rx off adaptive-tx off rx-usecs 125 \
  472. tx-usecs 125
  473. For lower CPU utilization: Disable Adaptive ITR and lower Rx and Tx interrupts
  474. per queue using ethtool.
  475. - Setting rx-usecs and tx-usecs to 250 will limit interrupts to about 4000
  476. interrupts per second per queue.
  477. ::
  478. # ethtool -C <interface> adaptive-rx off adaptive-tx off rx-usecs 250 \
  479. tx-usecs 250
  480. For lower latency: Disable Adaptive ITR and ITR by setting Rx and Tx to 0 using
  481. ethtool.
  482. ::
  483. # ethtool -C <interface> adaptive-rx off adaptive-tx off rx-usecs 0 \
  484. tx-usecs 0
  485. Application Device Queues (ADq)
  486. -------------------------------
  487. Application Device Queues (ADq) allows you to dedicate one or more queues to a
  488. specific application. This can reduce latency for the specified application,
  489. and allow Tx traffic to be rate limited per application. Follow the steps below
  490. to set ADq.
  491. 1. Create traffic classes (TCs). Maximum of 8 TCs can be created per interface.
  492. The shaper bw_rlimit parameter is optional.
  493. Example: Sets up two tcs, tc0 and tc1, with 16 queues each and max tx rate set
  494. to 1Gbit for tc0 and 3Gbit for tc1.
  495. ::
  496. # tc qdisc add dev <interface> root mqprio num_tc 2 map 0 0 0 0 1 1 1 1
  497. queues 16@0 16@16 hw 1 mode channel shaper bw_rlimit min_rate 1Gbit 2Gbit
  498. max_rate 1Gbit 3Gbit
  499. map: priority mapping for up to 16 priorities to tcs (e.g. map 0 0 0 0 1 1 1 1
  500. sets priorities 0-3 to use tc0 and 4-7 to use tc1)
  501. queues: for each tc, <num queues>@<offset> (e.g. queues 16@0 16@16 assigns
  502. 16 queues to tc0 at offset 0 and 16 queues to tc1 at offset 16. Max total
  503. number of queues for all tcs is 64 or number of cores, whichever is lower.)
  504. hw 1 mode channel: ‘channel’ with ‘hw’ set to 1 is a new new hardware
  505. offload mode in mqprio that makes full use of the mqprio options, the
  506. TCs, the queue configurations, and the QoS parameters.
  507. shaper bw_rlimit: for each tc, sets minimum and maximum bandwidth rates.
  508. Totals must be equal or less than port speed.
  509. For example: min_rate 1Gbit 3Gbit: Verify bandwidth limit using network
  510. monitoring tools such as `ifstat` or `sar -n DEV [interval] [number of samples]`
  511. 2. Enable HW TC offload on interface::
  512. # ethtool -K <interface> hw-tc-offload on
  513. 3. Apply TCs to ingress (RX) flow of interface::
  514. # tc qdisc add dev <interface> ingress
  515. NOTES:
  516. - Run all tc commands from the iproute2 <pathtoiproute2>/tc/ directory.
  517. - ADq is not compatible with cloud filters.
  518. - Setting up channels via ethtool (ethtool -L) is not supported when the
  519. TCs are configured using mqprio.
  520. - You must have iproute2 latest version
  521. - NVM version 6.01 or later is required.
  522. - ADq cannot be enabled when any the following features are enabled: Data
  523. Center Bridging (DCB), Multiple Functions per Port (MFP), or Sideband
  524. Filters.
  525. - If another driver (for example, DPDK) has set cloud filters, you cannot
  526. enable ADq.
  527. - Tunnel filters are not supported in ADq. If encapsulated packets do
  528. arrive in non-tunnel mode, filtering will be done on the inner headers.
  529. For example, for VXLAN traffic in non-tunnel mode, PCTYPE is identified
  530. as a VXLAN encapsulated packet, outer headers are ignored. Therefore,
  531. inner headers are matched.
  532. - If a TC filter on a PF matches traffic over a VF (on the PF), that
  533. traffic will be routed to the appropriate queue of the PF, and will
  534. not be passed on the VF. Such traffic will end up getting dropped higher
  535. up in the TCP/IP stack as it does not match PF address data.
  536. - If traffic matches multiple TC filters that point to different TCs,
  537. that traffic will be duplicated and sent to all matching TC queues.
  538. The hardware switch mirrors the packet to a VSI list when multiple
  539. filters are matched.
  540. Known Issues/Troubleshooting
  541. ============================
  542. NOTE: 1 Gb devices based on the Intel(R) Ethernet Network Connection X722 do
  543. not support the following features:
  544. * Data Center Bridging (DCB)
  545. * QOS
  546. * VMQ
  547. * SR-IOV
  548. * Task Encapsulation offload (VXLAN, NVGRE)
  549. * Energy Efficient Ethernet (EEE)
  550. * Auto-media detect
  551. Unexpected Issues when the device driver and DPDK share a device
  552. ----------------------------------------------------------------
  553. Unexpected issues may result when an i40e device is in multi driver mode and
  554. the kernel driver and DPDK driver are sharing the device. This is because
  555. access to the global NIC resources is not synchronized between multiple
  556. drivers. Any change to the global NIC configuration (writing to a global
  557. register, setting global configuration by AQ, or changing switch modes) will
  558. affect all ports and drivers on the device. Loading DPDK with the
  559. "multi-driver" module parameter may mitigate some of the issues.
  560. TC0 must be enabled when setting up DCB on a switch
  561. ---------------------------------------------------
  562. The kernel assumes that TC0 is available, and will disable Priority Flow
  563. Control (PFC) on the device if TC0 is not available. To fix this, ensure TC0 is
  564. enabled when setting up DCB on your switch.
  565. Support
  566. =======
  567. For general information, go to the Intel support website at:
  568. https://www.intel.com/support/
  569. If an issue is identified with the released source code on a supported kernel
  570. with a supported adapter, email the specific information related to the issue
  571. to intel-wired-lan@lists.osuosl.org.