arm64: dts: qcom: sm8550: add TRNG node
[linux-modified.git] / Documentation / networking / device_drivers / ethernet / intel / ice.rst
1 .. SPDX-License-Identifier: GPL-2.0+
2
3 =================================================================
4 Linux Base Driver for the Intel(R) Ethernet Controller 800 Series
5 =================================================================
6
7 Intel ice Linux driver.
8 Copyright(c) 2018-2021 Intel Corporation.
9
10 Contents
11 ========
12
13 - Overview
14 - Identifying Your Adapter
15 - Important Notes
16 - Additional Features & Configurations
17 - Performance Optimization
18
19
20 The associated Virtual Function (VF) driver for this driver is iavf.
21
22 Driver information can be obtained using ethtool and lspci.
23
24 For questions related to hardware requirements, refer to the documentation
25 supplied with your Intel adapter. All hardware requirements listed apply to use
26 with Linux.
27
28 This driver supports XDP (Express Data Path) and AF_XDP zero-copy. Note that
29 XDP is blocked for frame sizes larger than 3KB.
30
31
32 Identifying Your Adapter
33 ========================
34 For information on how to identify your adapter, and for the latest Intel
35 network drivers, refer to the Intel Support website:
36 https://www.intel.com/support
37
38
39 Important Notes
40 ===============
41
42 Packet drops may occur under receive stress
43 -------------------------------------------
44 Devices based on the Intel(R) Ethernet Controller 800 Series are designed to
45 tolerate a limited amount of system latency during PCIe and DMA transactions.
46 If these transactions take longer than the tolerated latency, it can impact the
47 length of time the packets are buffered in the device and associated memory,
48 which may result in dropped packets. These packets drops typically do not have
49 a noticeable impact on throughput and performance under standard workloads.
50
51 If these packet drops appear to affect your workload, the following may improve
52 the situation:
53
54 1) Make sure that your system's physical memory is in a high-performance
55    configuration, as recommended by the platform vendor. A common
56    recommendation is for all channels to be populated with a single DIMM
57    module.
58 2) In your system's BIOS/UEFI settings, select the "Performance" profile.
59 3) Your distribution may provide tools like "tuned," which can help tweak
60    kernel settings to achieve better standard settings for different workloads.
61
62
63 Configuring SR-IOV for improved network security
64 ------------------------------------------------
65 In a virtualized environment, on Intel(R) Ethernet Network Adapters that
66 support SR-IOV, the virtual function (VF) may be subject to malicious behavior.
67 Software-generated layer two frames, like IEEE 802.3x (link flow control), IEEE
68 802.1Qbb (priority based flow-control), and others of this type, are not
69 expected and can throttle traffic between the host and the virtual switch,
70 reducing performance. To resolve this issue, and to ensure isolation from
71 unintended traffic streams, configure all SR-IOV enabled ports for VLAN tagging
72 from the administrative interface on the PF. This configuration allows
73 unexpected, and potentially malicious, frames to be dropped.
74
75 See "Configuring VLAN Tagging on SR-IOV Enabled Adapter Ports" later in this
76 README for configuration instructions.
77
78
79 Do not unload port driver if VF with active VM is bound to it
80 -------------------------------------------------------------
81 Do not unload a port's driver if a Virtual Function (VF) with an active Virtual
82 Machine (VM) is bound to it. Doing so will cause the port to appear to hang.
83 Once the VM shuts down, or otherwise releases the VF, the command will
84 complete.
85
86
87 Additional Features and Configurations
88 ======================================
89
90 ethtool
91 -------
92 The driver utilizes the ethtool interface for driver configuration and
93 diagnostics, as well as displaying statistical information. The latest ethtool
94 version is required for this functionality. Download it at:
95 https://kernel.org/pub/software/network/ethtool/
96
97 NOTE: The rx_bytes value of ethtool does not match the rx_bytes value of
98 Netdev, due to the 4-byte CRC being stripped by the device. The difference
99 between the two rx_bytes values will be 4 x the number of Rx packets. For
100 example, if Rx packets are 10 and Netdev (software statistics) displays
101 rx_bytes as "X", then ethtool (hardware statistics) will display rx_bytes as
102 "X+40" (4 bytes CRC x 10 packets).
103
104
105 Viewing Link Messages
106 ---------------------
107 Link messages will not be displayed to the console if the distribution is
108 restricting system messages. In order to see network driver link messages on
109 your console, set dmesg to eight by entering the following::
110
111   # dmesg -n 8
112
113 NOTE: This setting is not saved across reboots.
114
115
116 /*(DEBLOBBED)*/
117
118
119 Intel(R) Ethernet Flow Director
120 -------------------------------
121 The Intel Ethernet Flow Director performs the following tasks:
122
123 - Directs receive packets according to their flows to different queues
124 - Enables tight control on routing a flow in the platform
125 - Matches flows and CPU cores for flow affinity
126
127 NOTE: This driver supports the following flow types:
128
129 - IPv4
130 - TCPv4
131 - UDPv4
132 - SCTPv4
133 - IPv6
134 - TCPv6
135 - UDPv6
136 - SCTPv6
137
138 Each flow type supports valid combinations of IP addresses (source or
139 destination) and UDP/TCP/SCTP ports (source and destination). You can supply
140 only a source IP address, a source IP address and a destination port, or any
141 combination of one or more of these four parameters.
142
143 NOTE: This driver allows you to filter traffic based on a user-defined flexible
144 two-byte pattern and offset by using the ethtool user-def and mask fields. Only
145 L3 and L4 flow types are supported for user-defined flexible filters. For a
146 given flow type, you must clear all Intel Ethernet Flow Director filters before
147 changing the input set (for that flow type).
148
149
150 Flow Director Filters
151 ---------------------
152 Flow Director filters are used to direct traffic that matches specified
153 characteristics. They are enabled through ethtool's ntuple interface. To enable
154 or disable the Intel Ethernet Flow Director and these filters::
155
156   # ethtool -K <ethX> ntuple <off|on>
157
158 NOTE: When you disable ntuple filters, all the user programmed filters are
159 flushed from the driver cache and hardware. All needed filters must be re-added
160 when ntuple is re-enabled.
161
162 To display all of the active filters::
163
164   # ethtool -u <ethX>
165
166 To add a new filter::
167
168   # ethtool -U <ethX> flow-type <type> src-ip <ip> [m <ip_mask>] dst-ip <ip>
169   [m <ip_mask>] src-port <port> [m <port_mask>] dst-port <port> [m <port_mask>]
170   action <queue>
171
172   Where:
173     <ethX> - the Ethernet device to program
174     <type> - can be ip4, tcp4, udp4, sctp4, ip6, tcp6, udp6, sctp6
175     <ip> - the IP address to match on
176     <ip_mask> - the IPv4 address to mask on
177               NOTE: These filters use inverted masks.
178     <port> - the port number to match on
179     <port_mask> - the 16-bit integer for masking
180               NOTE: These filters use inverted masks.
181     <queue> - the queue to direct traffic toward (-1 discards the
182               matched traffic)
183
184 To delete a filter::
185
186   # ethtool -U <ethX> delete <N>
187
188   Where <N> is the filter ID displayed when printing all the active filters,
189   and may also have been specified using "loc <N>" when adding the filter.
190
191 EXAMPLES:
192
193 To add a filter that directs packet to queue 2::
194
195   # ethtool -U <ethX> flow-type tcp4 src-ip 192.168.10.1 dst-ip \
196   192.168.10.2 src-port 2000 dst-port 2001 action 2 [loc 1]
197
198 To set a filter using only the source and destination IP address::
199
200   # ethtool -U <ethX> flow-type tcp4 src-ip 192.168.10.1 dst-ip \
201   192.168.10.2 action 2 [loc 1]
202
203 To set a filter based on a user-defined pattern and offset::
204
205   # ethtool -U <ethX> flow-type tcp4 src-ip 192.168.10.1 dst-ip \
206   192.168.10.2 user-def 0x4FFFF action 2 [loc 1]
207
208   where the value of the user-def field contains the offset (4 bytes) and
209   the pattern (0xffff).
210
211 To match TCP traffic sent from 192.168.0.1, port 5300, directed to 192.168.0.5,
212 port 80, and then send it to queue 7::
213
214   # ethtool -U enp130s0 flow-type tcp4 src-ip 192.168.0.1 dst-ip 192.168.0.5
215   src-port 5300 dst-port 80 action 7
216
217 To add a TCPv4 filter with a partial mask for a source IP subnet::
218
219   # ethtool -U <ethX> flow-type tcp4 src-ip 192.168.0.0 m 0.255.255.255 dst-ip
220   192.168.5.12 src-port 12600 dst-port 31 action 12
221
222 NOTES:
223
224 For each flow-type, the programmed filters must all have the same matching
225 input set. For example, issuing the following two commands is acceptable::
226
227   # ethtool -U enp130s0 flow-type ip4 src-ip 192.168.0.1 src-port 5300 action 7
228   # ethtool -U enp130s0 flow-type ip4 src-ip 192.168.0.5 src-port 55 action 10
229
230 Issuing the next two commands, however, is not acceptable, since the first
231 specifies src-ip and the second specifies dst-ip::
232
233   # ethtool -U enp130s0 flow-type ip4 src-ip 192.168.0.1 src-port 5300 action 7
234   # ethtool -U enp130s0 flow-type ip4 dst-ip 192.168.0.5 src-port 55 action 10
235
236 The second command will fail with an error. You may program multiple filters
237 with the same fields, using different values, but, on one device, you may not
238 program two tcp4 filters with different matching fields.
239
240 The ice driver does not support matching on a subportion of a field, thus
241 partial mask fields are not supported.
242
243
244 Flex Byte Flow Director Filters
245 -------------------------------
246 The driver also supports matching user-defined data within the packet payload.
247 This flexible data is specified using the "user-def" field of the ethtool
248 command in the following way:
249
250 .. table::
251
252     ============================== ============================
253     ``31    28    24    20    16`` ``15    12    8    4    0``
254     ``offset into packet payload`` ``2 bytes of flexible data``
255     ============================== ============================
256
257 For example,
258
259 ::
260
261   ... user-def 0x4FFFF ...
262
263 tells the filter to look 4 bytes into the payload and match that value against
264 0xFFFF. The offset is based on the beginning of the payload, and not the
265 beginning of the packet. Thus
266
267 ::
268
269   flow-type tcp4 ... user-def 0x8BEAF ...
270
271 would match TCP/IPv4 packets which have the value 0xBEAF 8 bytes into the
272 TCP/IPv4 payload.
273
274 Note that ICMP headers are parsed as 4 bytes of header and 4 bytes of payload.
275 Thus to match the first byte of the payload, you must actually add 4 bytes to
276 the offset. Also note that ip4 filters match both ICMP frames as well as raw
277 (unknown) ip4 frames, where the payload will be the L3 payload of the IP4
278 frame.
279
280 The maximum offset is 64. The hardware will only read up to 64 bytes of data
281 from the payload. The offset must be even because the flexible data is 2 bytes
282 long and must be aligned to byte 0 of the packet payload.
283
284 The user-defined flexible offset is also considered part of the input set and
285 cannot be programmed separately for multiple filters of the same type. However,
286 the flexible data is not part of the input set and multiple filters may use the
287 same offset but match against different data.
288
289
290 RSS Hash Flow
291 -------------
292 Allows you to set the hash bytes per flow type and any combination of one or
293 more options for Receive Side Scaling (RSS) hash byte configuration.
294
295 ::
296
297   # ethtool -N <ethX> rx-flow-hash <type> <option>
298
299   Where <type> is:
300     tcp4  signifying TCP over IPv4
301     udp4  signifying UDP over IPv4
302     tcp6  signifying TCP over IPv6
303     udp6  signifying UDP over IPv6
304   And <option> is one or more of:
305     s     Hash on the IP source address of the Rx packet.
306     d     Hash on the IP destination address of the Rx packet.
307     f     Hash on bytes 0 and 1 of the Layer 4 header of the Rx packet.
308     n     Hash on bytes 2 and 3 of the Layer 4 header of the Rx packet.
309
310
311 Accelerated Receive Flow Steering (aRFS)
312 ----------------------------------------
313 Devices based on the Intel(R) Ethernet Controller 800 Series support
314 Accelerated Receive Flow Steering (aRFS) on the PF. aRFS is a load-balancing
315 mechanism that allows you to direct packets to the same CPU where an
316 application is running or consuming the packets in that flow.
317
318 NOTES:
319
320 - aRFS requires that ntuple filtering is enabled via ethtool.
321 - aRFS support is limited to the following packet types:
322
323     - TCP over IPv4 and IPv6
324     - UDP over IPv4 and IPv6
325     - Nonfragmented packets
326
327 - aRFS only supports Flow Director filters, which consist of the
328   source/destination IP addresses and source/destination ports.
329 - aRFS and ethtool's ntuple interface both use the device's Flow Director. aRFS
330   and ntuple features can coexist, but you may encounter unexpected results if
331   there's a conflict between aRFS and ntuple requests. See "Intel(R) Ethernet
332   Flow Director" for additional information.
333
334 To set up aRFS:
335
336 1. Enable the Intel Ethernet Flow Director and ntuple filters using ethtool.
337
338 ::
339
340    # ethtool -K <ethX> ntuple on
341
342 2. Set up the number of entries in the global flow table. For example:
343
344 ::
345
346    # NUM_RPS_ENTRIES=16384
347    # echo $NUM_RPS_ENTRIES > /proc/sys/net/core/rps_sock_flow_entries
348
349 3. Set up the number of entries in the per-queue flow table. For example:
350
351 ::
352
353    # NUM_RX_QUEUES=64
354    # for file in /sys/class/net/$IFACE/queues/rx-*/rps_flow_cnt; do
355    # echo $(($NUM_RPS_ENTRIES/$NUM_RX_QUEUES)) > $file;
356    # done
357
358 4. Disable the IRQ balance daemon (this is only a temporary stop of the service
359    until the next reboot).
360
361 ::
362
363    # systemctl stop irqbalance
364
365 5. Configure the interrupt affinity.
366
367    See ``/Documentation/core-api/irq/irq-affinity.rst``
368
369
370 To disable aRFS using ethtool::
371
372   # ethtool -K <ethX> ntuple off
373
374 NOTE: This command will disable ntuple filters and clear any aRFS filters in
375 software and hardware.
376
377 Example Use Case:
378
379 1. Set the server application on the desired CPU (e.g., CPU 4).
380
381 ::
382
383    # taskset -c 4 netserver
384
385 2. Use netperf to route traffic from the client to CPU 4 on the server with
386    aRFS configured. This example uses TCP over IPv4.
387
388 ::
389
390    # netperf -H <Host IPv4 Address> -t TCP_STREAM
391
392
393 Enabling Virtual Functions (VFs)
394 --------------------------------
395 Use sysfs to enable virtual functions (VF).
396
397 For example, you can create 4 VFs as follows::
398
399   # echo 4 > /sys/class/net/<ethX>/device/sriov_numvfs
400
401 To disable VFs, write 0 to the same file::
402
403   # echo 0 > /sys/class/net/<ethX>/device/sriov_numvfs
404
405 The maximum number of VFs for the ice driver is 256 total (all ports). To check
406 how many VFs each PF supports, use the following command::
407
408   # cat /sys/class/net/<ethX>/device/sriov_totalvfs
409
410 Note: You cannot use SR-IOV when link aggregation (LAG)/bonding is active, and
411 vice versa. To enforce this, the driver checks for this mutual exclusion.
412
413
414 Displaying VF Statistics on the PF
415 ----------------------------------
416 Use the following command to display the statistics for the PF and its VFs::
417
418   # ip -s link show dev <ethX>
419
420 NOTE: The output of this command can be very large due to the maximum number of
421 possible VFs.
422
423 The PF driver will display a subset of the statistics for the PF and for all
424 VFs that are configured. The PF will always print a statistics block for each
425 of the possible VFs, and it will show zero for all unconfigured VFs.
426
427
428 Configuring VLAN Tagging on SR-IOV Enabled Adapter Ports
429 --------------------------------------------------------
430 To configure VLAN tagging for the ports on an SR-IOV enabled adapter, use the
431 following command. The VLAN configuration should be done before the VF driver
432 is loaded or the VM is booted. The VF is not aware of the VLAN tag being
433 inserted on transmit and removed on received frames (sometimes called "port
434 VLAN" mode).
435
436 ::
437
438   # ip link set dev <ethX> vf <id> vlan <vlan id>
439
440 For example, the following will configure PF eth0 and the first VF on VLAN 10::
441
442   # ip link set dev eth0 vf 0 vlan 10
443
444
445 Enabling a VF link if the port is disconnected
446 ----------------------------------------------
447 If the physical function (PF) link is down, you can force link up (from the
448 host PF) on any virtual functions (VF) bound to the PF.
449
450 For example, to force link up on VF 0 bound to PF eth0::
451
452   # ip link set eth0 vf 0 state enable
453
454 Note: If the command does not work, it may not be supported by your system.
455
456
457 Setting the MAC Address for a VF
458 --------------------------------
459 To change the MAC address for the specified VF::
460
461   # ip link set <ethX> vf 0 mac <address>
462
463 For example::
464
465   # ip link set <ethX> vf 0 mac 00:01:02:03:04:05
466
467 This setting lasts until the PF is reloaded.
468
469 NOTE: Assigning a MAC address for a VF from the host will disable any
470 subsequent requests to change the MAC address from within the VM. This is a
471 security feature. The VM is not aware of this restriction, so if this is
472 attempted in the VM, it will trigger MDD events.
473
474
475 Trusted VFs and VF Promiscuous Mode
476 -----------------------------------
477 This feature allows you to designate a particular VF as trusted and allows that
478 trusted VF to request selective promiscuous mode on the Physical Function (PF).
479
480 To set a VF as trusted or untrusted, enter the following command in the
481 Hypervisor::
482
483   # ip link set dev <ethX> vf 1 trust [on|off]
484
485 NOTE: It's important to set the VF to trusted before setting promiscuous mode.
486 If the VM is not trusted, the PF will ignore promiscuous mode requests from the
487 VF. If the VM becomes trusted after the VF driver is loaded, you must make a
488 new request to set the VF to promiscuous.
489
490 Once the VF is designated as trusted, use the following commands in the VM to
491 set the VF to promiscuous mode.
492
493 For promiscuous all::
494
495   # ip link set <ethX> promisc on
496   Where <ethX> is a VF interface in the VM
497
498 For promiscuous Multicast::
499
500   # ip link set <ethX> allmulticast on
501   Where <ethX> is a VF interface in the VM
502
503 NOTE: By default, the ethtool private flag vf-true-promisc-support is set to
504 "off," meaning that promiscuous mode for the VF will be limited. To set the
505 promiscuous mode for the VF to true promiscuous and allow the VF to see all
506 ingress traffic, use the following command::
507
508   # ethtool --set-priv-flags <ethX> vf-true-promisc-support on
509
510 The vf-true-promisc-support private flag does not enable promiscuous mode;
511 rather, it designates which type of promiscuous mode (limited or true) you will
512 get when you enable promiscuous mode using the ip link commands above. Note
513 that this is a global setting that affects the entire device. However, the
514 vf-true-promisc-support private flag is only exposed to the first PF of the
515 device. The PF remains in limited promiscuous mode regardless of the
516 vf-true-promisc-support setting.
517
518 Next, add a VLAN interface on the VF interface. For example::
519
520   # ip link add link eth2 name eth2.100 type vlan id 100
521
522 Note that the order in which you set the VF to promiscuous mode and add the
523 VLAN interface does not matter (you can do either first). The result in this
524 example is that the VF will get all traffic that is tagged with VLAN 100.
525
526
527 Malicious Driver Detection (MDD) for VFs
528 ----------------------------------------
529 Some Intel Ethernet devices use Malicious Driver Detection (MDD) to detect
530 malicious traffic from the VF and disable Tx/Rx queues or drop the offending
531 packet until a VF driver reset occurs. You can view MDD messages in the PF's
532 system log using the dmesg command.
533
534 - If the PF driver logs MDD events from the VF, confirm that the correct VF
535   driver is installed.
536 - To restore functionality, you can manually reload the VF or VM or enable
537   automatic VF resets.
538 - When automatic VF resets are enabled, the PF driver will immediately reset
539   the VF and reenable queues when it detects MDD events on the receive path.
540 - If automatic VF resets are disabled, the PF will not automatically reset the
541   VF when it detects MDD events.
542
543 To enable or disable automatic VF resets, use the following command::
544
545   # ethtool --set-priv-flags <ethX> mdd-auto-reset-vf on|off
546
547
548 MAC and VLAN Anti-Spoofing Feature for VFs
549 ------------------------------------------
550 When a malicious driver on a Virtual Function (VF) interface attempts to send a
551 spoofed packet, it is dropped by the hardware and not transmitted.
552
553 NOTE: This feature can be disabled for a specific VF::
554
555   # ip link set <ethX> vf <vf id> spoofchk {off|on}
556
557
558 Jumbo Frames
559 ------------
560 Jumbo Frames support is enabled by changing the Maximum Transmission Unit (MTU)
561 to a value larger than the default value of 1500.
562
563 Use the ifconfig command to increase the MTU size. For example, enter the
564 following where <ethX> is the interface number::
565
566   # ifconfig <ethX> mtu 9000 up
567
568 Alternatively, you can use the ip command as follows::
569
570   # ip link set mtu 9000 dev <ethX>
571   # ip link set up dev <ethX>
572
573 This setting is not saved across reboots.
574
575
576 NOTE: The maximum MTU setting for jumbo frames is 9702. This corresponds to the
577 maximum jumbo frame size of 9728 bytes.
578
579 NOTE: This driver will attempt to use multiple page sized buffers to receive
580 each jumbo packet. This should help to avoid buffer starvation issues when
581 allocating receive packets.
582
583 NOTE: Packet loss may have a greater impact on throughput when you use jumbo
584 frames. If you observe a drop in performance after enabling jumbo frames,
585 enabling flow control may mitigate the issue.
586
587
588 Speed and Duplex Configuration
589 ------------------------------
590 In addressing speed and duplex configuration issues, you need to distinguish
591 between copper-based adapters and fiber-based adapters.
592
593 In the default mode, an Intel(R) Ethernet Network Adapter using copper
594 connections will attempt to auto-negotiate with its link partner to determine
595 the best setting. If the adapter cannot establish link with the link partner
596 using auto-negotiation, you may need to manually configure the adapter and link
597 partner to identical settings to establish link and pass packets. This should
598 only be needed when attempting to link with an older switch that does not
599 support auto-negotiation or one that has been forced to a specific speed or
600 duplex mode. Your link partner must match the setting you choose. 1 Gbps speeds
601 and higher cannot be forced. Use the autonegotiation advertising setting to
602 manually set devices for 1 Gbps and higher.
603
604 Speed, duplex, and autonegotiation advertising are configured through the
605 ethtool utility. For the latest version, download and install ethtool from the
606 following website:
607
608    https://kernel.org/pub/software/network/ethtool/
609
610 To see the speed configurations your device supports, run the following::
611
612   # ethtool <ethX>
613
614 Caution: Only experienced network administrators should force speed and duplex
615 or change autonegotiation advertising manually. The settings at the switch must
616 always match the adapter settings. Adapter performance may suffer or your
617 adapter may not operate if you configure the adapter differently from your
618 switch.
619
620
621 Data Center Bridging (DCB)
622 --------------------------
623 NOTE: The kernel assumes that TC0 is available, and will disable Priority Flow
624 Control (PFC) on the device if TC0 is not available. To fix this, ensure TC0 is
625 enabled when setting up DCB on your switch.
626
627 DCB is a configuration Quality of Service implementation in hardware. It uses
628 the VLAN priority tag (802.1p) to filter traffic. That means that there are 8
629 different priorities that traffic can be filtered into. It also enables
630 priority flow control (802.1Qbb) which can limit or eliminate the number of
631 dropped packets during network stress. Bandwidth can be allocated to each of
632 these priorities, which is enforced at the hardware level (802.1Qaz).
633
634 DCB is normally configured on the network using the DCBX protocol (802.1Qaz), a
635 specialization of LLDP (802.1AB). The ice driver supports the following
636 mutually exclusive variants of DCBX support:
637
638 1) Firmware-based LLDP Agent
639 2) Software-based LLDP Agent
640
641 In firmware-based mode, firmware intercepts all LLDP traffic and handles DCBX
642 negotiation transparently for the user. In this mode, the adapter operates in
643 "willing" DCBX mode, receiving DCB settings from the link partner (typically a
644 switch). The local user can only query the negotiated DCB configuration. For
645 information on configuring DCBX parameters on a switch, please consult the
646 switch manufacturer's documentation.
647
648 In software-based mode, LLDP traffic is forwarded to the network stack and user
649 space, where a software agent can handle it. In this mode, the adapter can
650 operate in either "willing" or "nonwilling" DCBX mode and DCB configuration can
651 be both queried and set locally. This mode requires the FW-based LLDP Agent to
652 be disabled.
653
654 NOTE:
655
656 - You can enable and disable the firmware-based LLDP Agent using an ethtool
657   private flag. Refer to the "FW-LLDP (Firmware Link Layer Discovery Protocol)"
658   section in this README for more information.
659 - In software-based DCBX mode, you can configure DCB parameters using software
660   LLDP/DCBX agents that interface with the Linux kernel's DCB Netlink API. We
661   recommend using OpenLLDP as the DCBX agent when running in software mode. For
662   more information, see the OpenLLDP man pages and
663   https://github.com/intel/openlldp.
664 - The driver implements the DCB netlink interface layer to allow the user space
665   to communicate with the driver and query DCB configuration for the port.
666 - iSCSI with DCB is not supported.
667
668
669 FW-LLDP (Firmware Link Layer Discovery Protocol)
670 ------------------------------------------------
671 Use ethtool to change FW-LLDP settings. The FW-LLDP setting is per port and
672 persists across boots.
673
674 To enable LLDP::
675
676   # ethtool --set-priv-flags <ethX> fw-lldp-agent on
677
678 To disable LLDP::
679
680   # ethtool --set-priv-flags <ethX> fw-lldp-agent off
681
682 To check the current LLDP setting::
683
684   # ethtool --show-priv-flags <ethX>
685
686 NOTE: You must enable the UEFI HII "LLDP Agent" attribute for this setting to
687 take effect. If "LLDP AGENT" is set to disabled, you cannot enable it from the
688 OS.
689
690
691 Flow Control
692 ------------
693 Ethernet Flow Control (IEEE 802.3x) can be configured with ethtool to enable
694 receiving and transmitting pause frames for ice. When transmit is enabled,
695 pause frames are generated when the receive packet buffer crosses a predefined
696 threshold. When receive is enabled, the transmit unit will halt for the time
697 delay specified when a pause frame is received.
698
699 NOTE: You must have a flow control capable link partner.
700
701 Flow Control is disabled by default.
702
703 Use ethtool to change the flow control settings.
704
705 To enable or disable Rx or Tx Flow Control::
706
707   # ethtool -A <ethX> rx <on|off> tx <on|off>
708
709 Note: This command only enables or disables Flow Control if auto-negotiation is
710 disabled. If auto-negotiation is enabled, this command changes the parameters
711 used for auto-negotiation with the link partner.
712
713 Note: Flow Control auto-negotiation is part of link auto-negotiation. Depending
714 on your device, you may not be able to change the auto-negotiation setting.
715
716 NOTE:
717
718 - The ice driver requires flow control on both the port and link partner. If
719   flow control is disabled on one of the sides, the port may appear to hang on
720   heavy traffic.
721 - You may encounter issues with link-level flow control (LFC) after disabling
722   DCB. The LFC status may show as enabled but traffic is not paused. To resolve
723   this issue, disable and reenable LFC using ethtool::
724
725    # ethtool -A <ethX> rx off tx off
726    # ethtool -A <ethX> rx on tx on
727
728
729 NAPI
730 ----
731
732 This driver supports NAPI (Rx polling mode).
733
734 See :ref:`Documentation/networking/napi.rst <napi>` for more information.
735
736 MACVLAN
737 -------
738 This driver supports MACVLAN. Kernel support for MACVLAN can be tested by
739 checking if the MACVLAN driver is loaded. You can run 'lsmod | grep macvlan' to
740 see if the MACVLAN driver is loaded or run 'modprobe macvlan' to try to load
741 the MACVLAN driver.
742
743 NOTE:
744
745 - In passthru mode, you can only set up one MACVLAN device. It will inherit the
746   MAC address of the underlying PF (Physical Function) device.
747
748
749 IEEE 802.1ad (QinQ) Support
750 ---------------------------
751 The IEEE 802.1ad standard, informally known as QinQ, allows for multiple VLAN
752 IDs within a single Ethernet frame. VLAN IDs are sometimes referred to as
753 "tags," and multiple VLAN IDs are thus referred to as a "tag stack." Tag stacks
754 allow L2 tunneling and the ability to segregate traffic within a particular
755 VLAN ID, among other uses.
756
757 NOTES:
758
759 - Receive checksum offloads and VLAN acceleration are not supported for 802.1ad
760   (QinQ) packets.
761
762 - 0x88A8 traffic will not be received unless VLAN stripping is disabled with
763   the following command::
764
765     # ethtool -K <ethX> rxvlan off
766
767 - 0x88A8/0x8100 double VLANs cannot be used with 0x8100 or 0x8100/0x8100 VLANS
768   configured on the same port. 0x88a8/0x8100 traffic will not be received if
769   0x8100 VLANs are configured.
770
771 - The VF can only transmit 0x88A8/0x8100 (i.e., 802.1ad/802.1Q) traffic if:
772
773     1) The VF is not assigned a port VLAN.
774     2) spoofchk is disabled from the PF. If you enable spoofchk, the VF will
775        not transmit 0x88A8/0x8100 traffic.
776
777 - The VF may not receive all network traffic based on the Inner VLAN header
778   when VF true promiscuous mode (vf-true-promisc-support) and double VLANs are
779   enabled in SR-IOV mode.
780
781 The following are examples of how to configure 802.1ad (QinQ)::
782
783   # ip link add link eth0 eth0.24 type vlan proto 802.1ad id 24
784   # ip link add link eth0.24 eth0.24.371 type vlan proto 802.1Q id 371
785
786   Where "24" and "371" are example VLAN IDs.
787
788
789 Tunnel/Overlay Stateless Offloads
790 ---------------------------------
791 Supported tunnels and overlays include VXLAN, GENEVE, and others depending on
792 hardware and software configuration. Stateless offloads are enabled by default.
793
794 To view the current state of all offloads::
795
796   # ethtool -k <ethX>
797
798
799 UDP Segmentation Offload
800 ------------------------
801 Allows the adapter to offload transmit segmentation of UDP packets with
802 payloads up to 64K into valid Ethernet frames. Because the adapter hardware is
803 able to complete data segmentation much faster than operating system software,
804 this feature may improve transmission performance.
805 In addition, the adapter may use fewer CPU resources.
806
807 NOTE:
808
809 - The application sending UDP packets must support UDP segmentation offload.
810
811 To enable/disable UDP Segmentation Offload, issue the following command::
812
813   # ethtool -K <ethX> tx-udp-segmentation [off|on]
814
815
816 GNSS module
817 -----------
818 Requires kernel compiled with CONFIG_GNSS=y or CONFIG_GNSS=m.
819 Allows user to read messages from the GNSS hardware module and write supported
820 commands. If the module is physically present, a GNSS device is spawned:
821 ``/dev/gnss<id>``.
822 The protocol of write command is dependent on the GNSS hardware module as the
823 driver writes raw bytes by the GNSS object to the receiver through i2c. Please
824 refer to the hardware GNSS module documentation for configuration details.
825
826
827 Performance Optimization
828 ========================
829 Driver defaults are meant to fit a wide variety of workloads, but if further
830 optimization is required, we recommend experimenting with the following
831 settings.
832
833
834 Rx Descriptor Ring Size
835 -----------------------
836 To reduce the number of Rx packet discards, increase the number of Rx
837 descriptors for each Rx ring using ethtool.
838
839   Check if the interface is dropping Rx packets due to buffers being full
840   (rx_dropped.nic can mean that there is no PCIe bandwidth)::
841
842     # ethtool -S <ethX> | grep "rx_dropped"
843
844   If the previous command shows drops on queues, it may help to increase
845   the number of descriptors using 'ethtool -G'::
846
847     # ethtool -G <ethX> rx <N>
848     Where <N> is the desired number of ring entries/descriptors
849
850   This can provide temporary buffering for issues that create latency while
851   the CPUs process descriptors.
852
853
854 Interrupt Rate Limiting
855 -----------------------
856 This driver supports an adaptive interrupt throttle rate (ITR) mechanism that
857 is tuned for general workloads. The user can customize the interrupt rate
858 control for specific workloads, via ethtool, adjusting the number of
859 microseconds between interrupts.
860
861 To set the interrupt rate manually, you must disable adaptive mode::
862
863   # ethtool -C <ethX> adaptive-rx off adaptive-tx off
864
865 For lower CPU utilization:
866
867   Disable adaptive ITR and lower Rx and Tx interrupts. The examples below
868   affect every queue of the specified interface.
869
870   Setting rx-usecs and tx-usecs to 80 will limit interrupts to about
871   12,500 interrupts per second per queue::
872
873     # ethtool -C <ethX> adaptive-rx off adaptive-tx off rx-usecs 80 tx-usecs 80
874
875 For reduced latency:
876
877   Disable adaptive ITR and ITR by setting rx-usecs and tx-usecs to 0
878   using ethtool::
879
880     # ethtool -C <ethX> adaptive-rx off adaptive-tx off rx-usecs 0 tx-usecs 0
881
882 Per-queue interrupt rate settings:
883
884   The following examples are for queues 1 and 3, but you can adjust other
885   queues.
886
887   To disable Rx adaptive ITR and set static Rx ITR to 10 microseconds or
888   about 100,000 interrupts/second, for queues 1 and 3::
889
890     # ethtool --per-queue <ethX> queue_mask 0xa --coalesce adaptive-rx off
891     rx-usecs 10
892
893   To show the current coalesce settings for queues 1 and 3::
894
895     # ethtool --per-queue <ethX> queue_mask 0xa --show-coalesce
896
897 Bounding interrupt rates using rx-usecs-high:
898
899   :Valid Range: 0-236 (0=no limit)
900
901    The range of 0-236 microseconds provides an effective range of 4,237 to
902    250,000 interrupts per second. The value of rx-usecs-high can be set
903    independently of rx-usecs and tx-usecs in the same ethtool command, and is
904    also independent of the adaptive interrupt moderation algorithm. The
905    underlying hardware supports granularity in 4-microsecond intervals, so
906    adjacent values may result in the same interrupt rate.
907
908   The following command would disable adaptive interrupt moderation, and allow
909   a maximum of 5 microseconds before indicating a receive or transmit was
910   complete. However, instead of resulting in as many as 200,000 interrupts per
911   second, it limits total interrupts per second to 50,000 via the rx-usecs-high
912   parameter.
913
914   ::
915
916     # ethtool -C <ethX> adaptive-rx off adaptive-tx off rx-usecs-high 20
917     rx-usecs 5 tx-usecs 5
918
919
920 Virtualized Environments
921 ------------------------
922 In addition to the other suggestions in this section, the following may be
923 helpful to optimize performance in VMs.
924
925   Using the appropriate mechanism (vcpupin) in the VM, pin the CPUs to
926   individual LCPUs, making sure to use a set of CPUs included in the
927   device's local_cpulist: ``/sys/class/net/<ethX>/device/local_cpulist``.
928
929   Configure as many Rx/Tx queues in the VM as available. (See the iavf driver
930   documentation for the number of queues supported.) For example::
931
932     # ethtool -L <virt_interface> rx <max> tx <max>
933
934
935 Support
936 =======
937 For general information, go to the Intel support website at:
938 https://www.intel.com/support/
939
940 If an issue is identified with the released source code on a supported kernel
941 with a supported adapter, email the specific information related to the issue
942 to intel-wired-lan@lists.osuosl.org.
943
944
945 Trademarks
946 ==========
947 Intel is a trademark or registered trademark of Intel Corporation or its
948 subsidiaries in the United States and/or other countries.
949
950 * Other names and brands may be claimed as the property of others.