0001 .. SPDX-License-Identifier: GPL-2.0+
0002
0003 =================================================================
0004 Linux Base Driver for the Intel(R) Ethernet Controller 800 Series
0005 =================================================================
0006
0007 Intel ice Linux driver.
0008 Copyright(c) 2018-2021 Intel Corporation.
0009
0010 Contents
0011 ========
0012
0013 - Overview
0014 - Identifying Your Adapter
0015 - Important Notes
0016 - Additional Features & Configurations
0017 - Performance Optimization
0018
0019
0020 The associated Virtual Function (VF) driver for this driver is iavf.
0021
0022 Driver information can be obtained using ethtool and lspci.
0023
0024 For questions related to hardware requirements, refer to the documentation
0025 supplied with your Intel adapter. All hardware requirements listed apply to use
0026 with Linux.
0027
0028 This driver supports XDP (Express Data Path) and AF_XDP zero-copy. Note that
0029 XDP is blocked for frame sizes larger than 3KB.
0030
0031
0032 Identifying Your Adapter
0033 ========================
0034 For information on how to identify your adapter, and for the latest Intel
0035 network drivers, refer to the Intel Support website:
0036 https://www.intel.com/support
0037
0038
0039 Important Notes
0040 ===============
0041
0042 Packet drops may occur under receive stress
0043 -------------------------------------------
0044 Devices based on the Intel(R) Ethernet Controller 800 Series are designed to
0045 tolerate a limited amount of system latency during PCIe and DMA transactions.
0046 If these transactions take longer than the tolerated latency, it can impact the
0047 length of time the packets are buffered in the device and associated memory,
0048 which may result in dropped packets. These packets drops typically do not have
0049 a noticeable impact on throughput and performance under standard workloads.
0050
0051 If these packet drops appear to affect your workload, the following may improve
0052 the situation:
0053
0054 1) Make sure that your system's physical memory is in a high-performance
0055 configuration, as recommended by the platform vendor. A common
0056 recommendation is for all channels to be populated with a single DIMM
0057 module.
0058 2) In your system's BIOS/UEFI settings, select the "Performance" profile.
0059 3) Your distribution may provide tools like "tuned," which can help tweak
0060 kernel settings to achieve better standard settings for different workloads.
0061
0062
0063 Configuring SR-IOV for improved network security
0064 ------------------------------------------------
0065 In a virtualized environment, on Intel(R) Ethernet Network Adapters that
0066 support SR-IOV, the virtual function (VF) may be subject to malicious behavior.
0067 Software-generated layer two frames, like IEEE 802.3x (link flow control), IEEE
0068 802.1Qbb (priority based flow-control), and others of this type, are not
0069 expected and can throttle traffic between the host and the virtual switch,
0070 reducing performance. To resolve this issue, and to ensure isolation from
0071 unintended traffic streams, configure all SR-IOV enabled ports for VLAN tagging
0072 from the administrative interface on the PF. This configuration allows
0073 unexpected, and potentially malicious, frames to be dropped.
0074
0075 See "Configuring VLAN Tagging on SR-IOV Enabled Adapter Ports" later in this
0076 README for configuration instructions.
0077
0078
0079 Do not unload port driver if VF with active VM is bound to it
0080 -------------------------------------------------------------
0081 Do not unload a port's driver if a Virtual Function (VF) with an active Virtual
0082 Machine (VM) is bound to it. Doing so will cause the port to appear to hang.
0083 Once the VM shuts down, or otherwise releases the VF, the command will
0084 complete.
0085
0086
0087 Important notes for SR-IOV and Link Aggregation
0088 -----------------------------------------------
0089 Link Aggregation is mutually exclusive with SR-IOV.
0090
0091 - If Link Aggregation is active, SR-IOV VFs cannot be created on the PF.
0092 - If SR-IOV is active, you cannot set up Link Aggregation on the interface.
0093
0094 Bridging and MACVLAN are also affected by this. If you wish to use bridging or
0095 MACVLAN with SR-IOV, you must set up bridging or MACVLAN before enabling
0096 SR-IOV. If you are using bridging or MACVLAN in conjunction with SR-IOV, and
0097 you want to remove the interface from the bridge or MACVLAN, you must follow
0098 these steps:
0099
0100 1. Destroy SR-IOV VFs if they exist
0101 2. Remove the interface from the bridge or MACVLAN
0102 3. Recreate SRIOV VFs as needed
0103
0104
0105 Additional Features and Configurations
0106 ======================================
0107
0108 ethtool
0109 -------
0110 The driver utilizes the ethtool interface for driver configuration and
0111 diagnostics, as well as displaying statistical information. The latest ethtool
0112 version is required for this functionality. Download it at:
0113 https://kernel.org/pub/software/network/ethtool/
0114
0115 NOTE: The rx_bytes value of ethtool does not match the rx_bytes value of
0116 Netdev, due to the 4-byte CRC being stripped by the device. The difference
0117 between the two rx_bytes values will be 4 x the number of Rx packets. For
0118 example, if Rx packets are 10 and Netdev (software statistics) displays
0119 rx_bytes as "X", then ethtool (hardware statistics) will display rx_bytes as
0120 "X+40" (4 bytes CRC x 10 packets).
0121
0122
0123 Viewing Link Messages
0124 ---------------------
0125 Link messages will not be displayed to the console if the distribution is
0126 restricting system messages. In order to see network driver link messages on
0127 your console, set dmesg to eight by entering the following::
0128
0129 # dmesg -n 8
0130
0131 NOTE: This setting is not saved across reboots.
0132
0133
0134 Dynamic Device Personalization
0135 ------------------------------
0136 Dynamic Device Personalization (DDP) allows you to change the packet processing
0137 pipeline of a device by applying a profile package to the device at runtime.
0138 Profiles can be used to, for example, add support for new protocols, change
0139 existing protocols, or change default settings. DDP profiles can also be rolled
0140 back without rebooting the system.
0141
0142 The DDP package loads during device initialization. The driver looks for
0143 ``intel/ice/ddp/ice.pkg`` in your firmware root (typically ``/lib/firmware/``
0144 or ``/lib/firmware/updates/``) and checks that it contains a valid DDP package
0145 file.
0146
0147 NOTE: Your distribution should likely have provided the latest DDP file, but if
0148 ice.pkg is missing, you can find it in the linux-firmware repository or from
0149 intel.com.
0150
0151 If the driver is unable to load the DDP package, the device will enter Safe
0152 Mode. Safe Mode disables advanced and performance features and supports only
0153 basic traffic and minimal functionality, such as updating the NVM or
0154 downloading a new driver or DDP package. Safe Mode only applies to the affected
0155 physical function and does not impact any other PFs. See the "Intel(R) Ethernet
0156 Adapters and Devices User Guide" for more details on DDP and Safe Mode.
0157
0158 NOTES:
0159
0160 - If you encounter issues with the DDP package file, you may need to download
0161 an updated driver or DDP package file. See the log messages for more
0162 information.
0163
0164 - The ice.pkg file is a symbolic link to the default DDP package file.
0165
0166 - You cannot update the DDP package if any PF drivers are already loaded. To
0167 overwrite a package, unload all PFs and then reload the driver with the new
0168 package.
0169
0170 - Only the first loaded PF per device can download a package for that device.
0171
0172 You can install specific DDP package files for different physical devices in
0173 the same system. To install a specific DDP package file:
0174
0175 1. Download the DDP package file you want for your device.
0176
0177 2. Rename the file ice-xxxxxxxxxxxxxxxx.pkg, where 'xxxxxxxxxxxxxxxx' is the
0178 unique 64-bit PCI Express device serial number (in hex) of the device you
0179 want the package downloaded on. The filename must include the complete
0180 serial number (including leading zeros) and be all lowercase. For example,
0181 if the 64-bit serial number is b887a3ffffca0568, then the file name would be
0182 ice-b887a3ffffca0568.pkg.
0183
0184 To find the serial number from the PCI bus address, you can use the
0185 following command::
0186
0187 # lspci -vv -s af:00.0 | grep -i Serial
0188 Capabilities: [150 v1] Device Serial Number b8-87-a3-ff-ff-ca-05-68
0189
0190 You can use the following command to format the serial number without the
0191 dashes::
0192
0193 # lspci -vv -s af:00.0 | grep -i Serial | awk '{print $7}' | sed s/-//g
0194 b887a3ffffca0568
0195
0196 3. Copy the renamed DDP package file to
0197 ``/lib/firmware/updates/intel/ice/ddp/``. If the directory does not yet
0198 exist, create it before copying the file.
0199
0200 4. Unload all of the PFs on the device.
0201
0202 5. Reload the driver with the new package.
0203
0204 NOTE: The presence of a device-specific DDP package file overrides the loading
0205 of the default DDP package file (ice.pkg).
0206
0207
0208 Intel(R) Ethernet Flow Director
0209 -------------------------------
0210 The Intel Ethernet Flow Director performs the following tasks:
0211
0212 - Directs receive packets according to their flows to different queues
0213 - Enables tight control on routing a flow in the platform
0214 - Matches flows and CPU cores for flow affinity
0215
0216 NOTE: This driver supports the following flow types:
0217
0218 - IPv4
0219 - TCPv4
0220 - UDPv4
0221 - SCTPv4
0222 - IPv6
0223 - TCPv6
0224 - UDPv6
0225 - SCTPv6
0226
0227 Each flow type supports valid combinations of IP addresses (source or
0228 destination) and UDP/TCP/SCTP ports (source and destination). You can supply
0229 only a source IP address, a source IP address and a destination port, or any
0230 combination of one or more of these four parameters.
0231
0232 NOTE: This driver allows you to filter traffic based on a user-defined flexible
0233 two-byte pattern and offset by using the ethtool user-def and mask fields. Only
0234 L3 and L4 flow types are supported for user-defined flexible filters. For a
0235 given flow type, you must clear all Intel Ethernet Flow Director filters before
0236 changing the input set (for that flow type).
0237
0238
0239 Flow Director Filters
0240 ---------------------
0241 Flow Director filters are used to direct traffic that matches specified
0242 characteristics. They are enabled through ethtool's ntuple interface. To enable
0243 or disable the Intel Ethernet Flow Director and these filters::
0244
0245 # ethtool -K <ethX> ntuple <off|on>
0246
0247 NOTE: When you disable ntuple filters, all the user programmed filters are
0248 flushed from the driver cache and hardware. All needed filters must be re-added
0249 when ntuple is re-enabled.
0250
0251 To display all of the active filters::
0252
0253 # ethtool -u <ethX>
0254
0255 To add a new filter::
0256
0257 # ethtool -U <ethX> flow-type <type> src-ip <ip> [m <ip_mask>] dst-ip <ip>
0258 [m <ip_mask>] src-port <port> [m <port_mask>] dst-port <port> [m <port_mask>]
0259 action <queue>
0260
0261 Where:
0262 <ethX> - the Ethernet device to program
0263 <type> - can be ip4, tcp4, udp4, sctp4, ip6, tcp6, udp6, sctp6
0264 <ip> - the IP address to match on
0265 <ip_mask> - the IPv4 address to mask on
0266 NOTE: These filters use inverted masks.
0267 <port> - the port number to match on
0268 <port_mask> - the 16-bit integer for masking
0269 NOTE: These filters use inverted masks.
0270 <queue> - the queue to direct traffic toward (-1 discards the
0271 matched traffic)
0272
0273 To delete a filter::
0274
0275 # ethtool -U <ethX> delete <N>
0276
0277 Where <N> is the filter ID displayed when printing all the active filters,
0278 and may also have been specified using "loc <N>" when adding the filter.
0279
0280 EXAMPLES:
0281
0282 To add a filter that directs packet to queue 2::
0283
0284 # ethtool -U <ethX> flow-type tcp4 src-ip 192.168.10.1 dst-ip \
0285 192.168.10.2 src-port 2000 dst-port 2001 action 2 [loc 1]
0286
0287 To set a filter using only the source and destination IP address::
0288
0289 # ethtool -U <ethX> flow-type tcp4 src-ip 192.168.10.1 dst-ip \
0290 192.168.10.2 action 2 [loc 1]
0291
0292 To set a filter based on a user-defined pattern and offset::
0293
0294 # ethtool -U <ethX> flow-type tcp4 src-ip 192.168.10.1 dst-ip \
0295 192.168.10.2 user-def 0x4FFFF action 2 [loc 1]
0296
0297 where the value of the user-def field contains the offset (4 bytes) and
0298 the pattern (0xffff).
0299
0300 To match TCP traffic sent from 192.168.0.1, port 5300, directed to 192.168.0.5,
0301 port 80, and then send it to queue 7::
0302
0303 # ethtool -U enp130s0 flow-type tcp4 src-ip 192.168.0.1 dst-ip 192.168.0.5
0304 src-port 5300 dst-port 80 action 7
0305
0306 To add a TCPv4 filter with a partial mask for a source IP subnet::
0307
0308 # ethtool -U <ethX> flow-type tcp4 src-ip 192.168.0.0 m 0.255.255.255 dst-ip
0309 192.168.5.12 src-port 12600 dst-port 31 action 12
0310
0311 NOTES:
0312
0313 For each flow-type, the programmed filters must all have the same matching
0314 input set. For example, issuing the following two commands is acceptable::
0315
0316 # ethtool -U enp130s0 flow-type ip4 src-ip 192.168.0.1 src-port 5300 action 7
0317 # ethtool -U enp130s0 flow-type ip4 src-ip 192.168.0.5 src-port 55 action 10
0318
0319 Issuing the next two commands, however, is not acceptable, since the first
0320 specifies src-ip and the second specifies dst-ip::
0321
0322 # ethtool -U enp130s0 flow-type ip4 src-ip 192.168.0.1 src-port 5300 action 7
0323 # ethtool -U enp130s0 flow-type ip4 dst-ip 192.168.0.5 src-port 55 action 10
0324
0325 The second command will fail with an error. You may program multiple filters
0326 with the same fields, using different values, but, on one device, you may not
0327 program two tcp4 filters with different matching fields.
0328
0329 The ice driver does not support matching on a subportion of a field, thus
0330 partial mask fields are not supported.
0331
0332
0333 Flex Byte Flow Director Filters
0334 -------------------------------
0335 The driver also supports matching user-defined data within the packet payload.
0336 This flexible data is specified using the "user-def" field of the ethtool
0337 command in the following way:
0338
0339 .. table::
0340
0341 ============================== ============================
0342 ``31 28 24 20 16`` ``15 12 8 4 0``
0343 ``offset into packet payload`` ``2 bytes of flexible data``
0344 ============================== ============================
0345
0346 For example,
0347
0348 ::
0349
0350 ... user-def 0x4FFFF ...
0351
0352 tells the filter to look 4 bytes into the payload and match that value against
0353 0xFFFF. The offset is based on the beginning of the payload, and not the
0354 beginning of the packet. Thus
0355
0356 ::
0357
0358 flow-type tcp4 ... user-def 0x8BEAF ...
0359
0360 would match TCP/IPv4 packets which have the value 0xBEAF 8 bytes into the
0361 TCP/IPv4 payload.
0362
0363 Note that ICMP headers are parsed as 4 bytes of header and 4 bytes of payload.
0364 Thus to match the first byte of the payload, you must actually add 4 bytes to
0365 the offset. Also note that ip4 filters match both ICMP frames as well as raw
0366 (unknown) ip4 frames, where the payload will be the L3 payload of the IP4
0367 frame.
0368
0369 The maximum offset is 64. The hardware will only read up to 64 bytes of data
0370 from the payload. The offset must be even because the flexible data is 2 bytes
0371 long and must be aligned to byte 0 of the packet payload.
0372
0373 The user-defined flexible offset is also considered part of the input set and
0374 cannot be programmed separately for multiple filters of the same type. However,
0375 the flexible data is not part of the input set and multiple filters may use the
0376 same offset but match against different data.
0377
0378
0379 RSS Hash Flow
0380 -------------
0381 Allows you to set the hash bytes per flow type and any combination of one or
0382 more options for Receive Side Scaling (RSS) hash byte configuration.
0383
0384 ::
0385
0386 # ethtool -N <ethX> rx-flow-hash <type> <option>
0387
0388 Where <type> is:
0389 tcp4 signifying TCP over IPv4
0390 udp4 signifying UDP over IPv4
0391 tcp6 signifying TCP over IPv6
0392 udp6 signifying UDP over IPv6
0393 And <option> is one or more of:
0394 s Hash on the IP source address of the Rx packet.
0395 d Hash on the IP destination address of the Rx packet.
0396 f Hash on bytes 0 and 1 of the Layer 4 header of the Rx packet.
0397 n Hash on bytes 2 and 3 of the Layer 4 header of the Rx packet.
0398
0399
0400 Accelerated Receive Flow Steering (aRFS)
0401 ----------------------------------------
0402 Devices based on the Intel(R) Ethernet Controller 800 Series support
0403 Accelerated Receive Flow Steering (aRFS) on the PF. aRFS is a load-balancing
0404 mechanism that allows you to direct packets to the same CPU where an
0405 application is running or consuming the packets in that flow.
0406
0407 NOTES:
0408
0409 - aRFS requires that ntuple filtering is enabled via ethtool.
0410 - aRFS support is limited to the following packet types:
0411
0412 - TCP over IPv4 and IPv6
0413 - UDP over IPv4 and IPv6
0414 - Nonfragmented packets
0415
0416 - aRFS only supports Flow Director filters, which consist of the
0417 source/destination IP addresses and source/destination ports.
0418 - aRFS and ethtool's ntuple interface both use the device's Flow Director. aRFS
0419 and ntuple features can coexist, but you may encounter unexpected results if
0420 there's a conflict between aRFS and ntuple requests. See "Intel(R) Ethernet
0421 Flow Director" for additional information.
0422
0423 To set up aRFS:
0424
0425 1. Enable the Intel Ethernet Flow Director and ntuple filters using ethtool.
0426
0427 ::
0428
0429 # ethtool -K <ethX> ntuple on
0430
0431 2. Set up the number of entries in the global flow table. For example:
0432
0433 ::
0434
0435 # NUM_RPS_ENTRIES=16384
0436 # echo $NUM_RPS_ENTRIES > /proc/sys/net/core/rps_sock_flow_entries
0437
0438 3. Set up the number of entries in the per-queue flow table. For example:
0439
0440 ::
0441
0442 # NUM_RX_QUEUES=64
0443 # for file in /sys/class/net/$IFACE/queues/rx-*/rps_flow_cnt; do
0444 # echo $(($NUM_RPS_ENTRIES/$NUM_RX_QUEUES)) > $file;
0445 # done
0446
0447 4. Disable the IRQ balance daemon (this is only a temporary stop of the service
0448 until the next reboot).
0449
0450 ::
0451
0452 # systemctl stop irqbalance
0453
0454 5. Configure the interrupt affinity.
0455
0456 See ``/Documentation/core-api/irq/irq-affinity.rst``
0457
0458
0459 To disable aRFS using ethtool::
0460
0461 # ethtool -K <ethX> ntuple off
0462
0463 NOTE: This command will disable ntuple filters and clear any aRFS filters in
0464 software and hardware.
0465
0466 Example Use Case:
0467
0468 1. Set the server application on the desired CPU (e.g., CPU 4).
0469
0470 ::
0471
0472 # taskset -c 4 netserver
0473
0474 2. Use netperf to route traffic from the client to CPU 4 on the server with
0475 aRFS configured. This example uses TCP over IPv4.
0476
0477 ::
0478
0479 # netperf -H <Host IPv4 Address> -t TCP_STREAM
0480
0481
0482 Enabling Virtual Functions (VFs)
0483 --------------------------------
0484 Use sysfs to enable virtual functions (VF).
0485
0486 For example, you can create 4 VFs as follows::
0487
0488 # echo 4 > /sys/class/net/<ethX>/device/sriov_numvfs
0489
0490 To disable VFs, write 0 to the same file::
0491
0492 # echo 0 > /sys/class/net/<ethX>/device/sriov_numvfs
0493
0494 The maximum number of VFs for the ice driver is 256 total (all ports). To check
0495 how many VFs each PF supports, use the following command::
0496
0497 # cat /sys/class/net/<ethX>/device/sriov_totalvfs
0498
0499 Note: You cannot use SR-IOV when link aggregation (LAG)/bonding is active, and
0500 vice versa. To enforce this, the driver checks for this mutual exclusion.
0501
0502
0503 Displaying VF Statistics on the PF
0504 ----------------------------------
0505 Use the following command to display the statistics for the PF and its VFs::
0506
0507 # ip -s link show dev <ethX>
0508
0509 NOTE: The output of this command can be very large due to the maximum number of
0510 possible VFs.
0511
0512 The PF driver will display a subset of the statistics for the PF and for all
0513 VFs that are configured. The PF will always print a statistics block for each
0514 of the possible VFs, and it will show zero for all unconfigured VFs.
0515
0516
0517 Configuring VLAN Tagging on SR-IOV Enabled Adapter Ports
0518 --------------------------------------------------------
0519 To configure VLAN tagging for the ports on an SR-IOV enabled adapter, use the
0520 following command. The VLAN configuration should be done before the VF driver
0521 is loaded or the VM is booted. The VF is not aware of the VLAN tag being
0522 inserted on transmit and removed on received frames (sometimes called "port
0523 VLAN" mode).
0524
0525 ::
0526
0527 # ip link set dev <ethX> vf <id> vlan <vlan id>
0528
0529 For example, the following will configure PF eth0 and the first VF on VLAN 10::
0530
0531 # ip link set dev eth0 vf 0 vlan 10
0532
0533
0534 Enabling a VF link if the port is disconnected
0535 ----------------------------------------------
0536 If the physical function (PF) link is down, you can force link up (from the
0537 host PF) on any virtual functions (VF) bound to the PF.
0538
0539 For example, to force link up on VF 0 bound to PF eth0::
0540
0541 # ip link set eth0 vf 0 state enable
0542
0543 Note: If the command does not work, it may not be supported by your system.
0544
0545
0546 Setting the MAC Address for a VF
0547 --------------------------------
0548 To change the MAC address for the specified VF::
0549
0550 # ip link set <ethX> vf 0 mac <address>
0551
0552 For example::
0553
0554 # ip link set <ethX> vf 0 mac 00:01:02:03:04:05
0555
0556 This setting lasts until the PF is reloaded.
0557
0558 NOTE: Assigning a MAC address for a VF from the host will disable any
0559 subsequent requests to change the MAC address from within the VM. This is a
0560 security feature. The VM is not aware of this restriction, so if this is
0561 attempted in the VM, it will trigger MDD events.
0562
0563
0564 Trusted VFs and VF Promiscuous Mode
0565 -----------------------------------
0566 This feature allows you to designate a particular VF as trusted and allows that
0567 trusted VF to request selective promiscuous mode on the Physical Function (PF).
0568
0569 To set a VF as trusted or untrusted, enter the following command in the
0570 Hypervisor::
0571
0572 # ip link set dev <ethX> vf 1 trust [on|off]
0573
0574 NOTE: It's important to set the VF to trusted before setting promiscuous mode.
0575 If the VM is not trusted, the PF will ignore promiscuous mode requests from the
0576 VF. If the VM becomes trusted after the VF driver is loaded, you must make a
0577 new request to set the VF to promiscuous.
0578
0579 Once the VF is designated as trusted, use the following commands in the VM to
0580 set the VF to promiscuous mode.
0581
0582 For promiscuous all::
0583
0584 # ip link set <ethX> promisc on
0585 Where <ethX> is a VF interface in the VM
0586
0587 For promiscuous Multicast::
0588
0589 # ip link set <ethX> allmulticast on
0590 Where <ethX> is a VF interface in the VM
0591
0592 NOTE: By default, the ethtool private flag vf-true-promisc-support is set to
0593 "off," meaning that promiscuous mode for the VF will be limited. To set the
0594 promiscuous mode for the VF to true promiscuous and allow the VF to see all
0595 ingress traffic, use the following command::
0596
0597 # ethtool --set-priv-flags <ethX> vf-true-promisc-support on
0598
0599 The vf-true-promisc-support private flag does not enable promiscuous mode;
0600 rather, it designates which type of promiscuous mode (limited or true) you will
0601 get when you enable promiscuous mode using the ip link commands above. Note
0602 that this is a global setting that affects the entire device. However, the
0603 vf-true-promisc-support private flag is only exposed to the first PF of the
0604 device. The PF remains in limited promiscuous mode regardless of the
0605 vf-true-promisc-support setting.
0606
0607 Next, add a VLAN interface on the VF interface. For example::
0608
0609 # ip link add link eth2 name eth2.100 type vlan id 100
0610
0611 Note that the order in which you set the VF to promiscuous mode and add the
0612 VLAN interface does not matter (you can do either first). The result in this
0613 example is that the VF will get all traffic that is tagged with VLAN 100.
0614
0615
0616 Malicious Driver Detection (MDD) for VFs
0617 ----------------------------------------
0618 Some Intel Ethernet devices use Malicious Driver Detection (MDD) to detect
0619 malicious traffic from the VF and disable Tx/Rx queues or drop the offending
0620 packet until a VF driver reset occurs. You can view MDD messages in the PF's
0621 system log using the dmesg command.
0622
0623 - If the PF driver logs MDD events from the VF, confirm that the correct VF
0624 driver is installed.
0625 - To restore functionality, you can manually reload the VF or VM or enable
0626 automatic VF resets.
0627 - When automatic VF resets are enabled, the PF driver will immediately reset
0628 the VF and reenable queues when it detects MDD events on the receive path.
0629 - If automatic VF resets are disabled, the PF will not automatically reset the
0630 VF when it detects MDD events.
0631
0632 To enable or disable automatic VF resets, use the following command::
0633
0634 # ethtool --set-priv-flags <ethX> mdd-auto-reset-vf on|off
0635
0636
0637 MAC and VLAN Anti-Spoofing Feature for VFs
0638 ------------------------------------------
0639 When a malicious driver on a Virtual Function (VF) interface attempts to send a
0640 spoofed packet, it is dropped by the hardware and not transmitted.
0641
0642 NOTE: This feature can be disabled for a specific VF::
0643
0644 # ip link set <ethX> vf <vf id> spoofchk {off|on}
0645
0646
0647 Jumbo Frames
0648 ------------
0649 Jumbo Frames support is enabled by changing the Maximum Transmission Unit (MTU)
0650 to a value larger than the default value of 1500.
0651
0652 Use the ifconfig command to increase the MTU size. For example, enter the
0653 following where <ethX> is the interface number::
0654
0655 # ifconfig <ethX> mtu 9000 up
0656
0657 Alternatively, you can use the ip command as follows::
0658
0659 # ip link set mtu 9000 dev <ethX>
0660 # ip link set up dev <ethX>
0661
0662 This setting is not saved across reboots.
0663
0664
0665 NOTE: The maximum MTU setting for jumbo frames is 9702. This corresponds to the
0666 maximum jumbo frame size of 9728 bytes.
0667
0668 NOTE: This driver will attempt to use multiple page sized buffers to receive
0669 each jumbo packet. This should help to avoid buffer starvation issues when
0670 allocating receive packets.
0671
0672 NOTE: Packet loss may have a greater impact on throughput when you use jumbo
0673 frames. If you observe a drop in performance after enabling jumbo frames,
0674 enabling flow control may mitigate the issue.
0675
0676
0677 Speed and Duplex Configuration
0678 ------------------------------
0679 In addressing speed and duplex configuration issues, you need to distinguish
0680 between copper-based adapters and fiber-based adapters.
0681
0682 In the default mode, an Intel(R) Ethernet Network Adapter using copper
0683 connections will attempt to auto-negotiate with its link partner to determine
0684 the best setting. If the adapter cannot establish link with the link partner
0685 using auto-negotiation, you may need to manually configure the adapter and link
0686 partner to identical settings to establish link and pass packets. This should
0687 only be needed when attempting to link with an older switch that does not
0688 support auto-negotiation or one that has been forced to a specific speed or
0689 duplex mode. Your link partner must match the setting you choose. 1 Gbps speeds
0690 and higher cannot be forced. Use the autonegotiation advertising setting to
0691 manually set devices for 1 Gbps and higher.
0692
0693 Speed, duplex, and autonegotiation advertising are configured through the
0694 ethtool utility. For the latest version, download and install ethtool from the
0695 following website:
0696
0697 https://kernel.org/pub/software/network/ethtool/
0698
0699 To see the speed configurations your device supports, run the following::
0700
0701 # ethtool <ethX>
0702
0703 Caution: Only experienced network administrators should force speed and duplex
0704 or change autonegotiation advertising manually. The settings at the switch must
0705 always match the adapter settings. Adapter performance may suffer or your
0706 adapter may not operate if you configure the adapter differently from your
0707 switch.
0708
0709
0710 Data Center Bridging (DCB)
0711 --------------------------
0712 NOTE: The kernel assumes that TC0 is available, and will disable Priority Flow
0713 Control (PFC) on the device if TC0 is not available. To fix this, ensure TC0 is
0714 enabled when setting up DCB on your switch.
0715
0716 DCB is a configuration Quality of Service implementation in hardware. It uses
0717 the VLAN priority tag (802.1p) to filter traffic. That means that there are 8
0718 different priorities that traffic can be filtered into. It also enables
0719 priority flow control (802.1Qbb) which can limit or eliminate the number of
0720 dropped packets during network stress. Bandwidth can be allocated to each of
0721 these priorities, which is enforced at the hardware level (802.1Qaz).
0722
0723 DCB is normally configured on the network using the DCBX protocol (802.1Qaz), a
0724 specialization of LLDP (802.1AB). The ice driver supports the following
0725 mutually exclusive variants of DCBX support:
0726
0727 1) Firmware-based LLDP Agent
0728 2) Software-based LLDP Agent
0729
0730 In firmware-based mode, firmware intercepts all LLDP traffic and handles DCBX
0731 negotiation transparently for the user. In this mode, the adapter operates in
0732 "willing" DCBX mode, receiving DCB settings from the link partner (typically a
0733 switch). The local user can only query the negotiated DCB configuration. For
0734 information on configuring DCBX parameters on a switch, please consult the
0735 switch manufacturer's documentation.
0736
0737 In software-based mode, LLDP traffic is forwarded to the network stack and user
0738 space, where a software agent can handle it. In this mode, the adapter can
0739 operate in either "willing" or "nonwilling" DCBX mode and DCB configuration can
0740 be both queried and set locally. This mode requires the FW-based LLDP Agent to
0741 be disabled.
0742
0743 NOTE:
0744
0745 - You can enable and disable the firmware-based LLDP Agent using an ethtool
0746 private flag. Refer to the "FW-LLDP (Firmware Link Layer Discovery Protocol)"
0747 section in this README for more information.
0748 - In software-based DCBX mode, you can configure DCB parameters using software
0749 LLDP/DCBX agents that interface with the Linux kernel's DCB Netlink API. We
0750 recommend using OpenLLDP as the DCBX agent when running in software mode. For
0751 more information, see the OpenLLDP man pages and
0752 https://github.com/intel/openlldp.
0753 - The driver implements the DCB netlink interface layer to allow the user space
0754 to communicate with the driver and query DCB configuration for the port.
0755 - iSCSI with DCB is not supported.
0756
0757
0758 FW-LLDP (Firmware Link Layer Discovery Protocol)
0759 ------------------------------------------------
0760 Use ethtool to change FW-LLDP settings. The FW-LLDP setting is per port and
0761 persists across boots.
0762
0763 To enable LLDP::
0764
0765 # ethtool --set-priv-flags <ethX> fw-lldp-agent on
0766
0767 To disable LLDP::
0768
0769 # ethtool --set-priv-flags <ethX> fw-lldp-agent off
0770
0771 To check the current LLDP setting::
0772
0773 # ethtool --show-priv-flags <ethX>
0774
0775 NOTE: You must enable the UEFI HII "LLDP Agent" attribute for this setting to
0776 take effect. If "LLDP AGENT" is set to disabled, you cannot enable it from the
0777 OS.
0778
0779
0780 Flow Control
0781 ------------
0782 Ethernet Flow Control (IEEE 802.3x) can be configured with ethtool to enable
0783 receiving and transmitting pause frames for ice. When transmit is enabled,
0784 pause frames are generated when the receive packet buffer crosses a predefined
0785 threshold. When receive is enabled, the transmit unit will halt for the time
0786 delay specified when a pause frame is received.
0787
0788 NOTE: You must have a flow control capable link partner.
0789
0790 Flow Control is disabled by default.
0791
0792 Use ethtool to change the flow control settings.
0793
0794 To enable or disable Rx or Tx Flow Control::
0795
0796 # ethtool -A <ethX> rx <on|off> tx <on|off>
0797
0798 Note: This command only enables or disables Flow Control if auto-negotiation is
0799 disabled. If auto-negotiation is enabled, this command changes the parameters
0800 used for auto-negotiation with the link partner.
0801
0802 Note: Flow Control auto-negotiation is part of link auto-negotiation. Depending
0803 on your device, you may not be able to change the auto-negotiation setting.
0804
0805 NOTE:
0806
0807 - The ice driver requires flow control on both the port and link partner. If
0808 flow control is disabled on one of the sides, the port may appear to hang on
0809 heavy traffic.
0810 - You may encounter issues with link-level flow control (LFC) after disabling
0811 DCB. The LFC status may show as enabled but traffic is not paused. To resolve
0812 this issue, disable and reenable LFC using ethtool::
0813
0814 # ethtool -A <ethX> rx off tx off
0815 # ethtool -A <ethX> rx on tx on
0816
0817
0818 NAPI
0819 ----
0820 This driver supports NAPI (Rx polling mode).
0821 For more information on NAPI, see
0822 https://www.linuxfoundation.org/collaborate/workgroups/networking/napi
0823
0824
0825 MACVLAN
0826 -------
0827 This driver supports MACVLAN. Kernel support for MACVLAN can be tested by
0828 checking if the MACVLAN driver is loaded. You can run 'lsmod | grep macvlan' to
0829 see if the MACVLAN driver is loaded or run 'modprobe macvlan' to try to load
0830 the MACVLAN driver.
0831
0832 NOTE:
0833
0834 - In passthru mode, you can only set up one MACVLAN device. It will inherit the
0835 MAC address of the underlying PF (Physical Function) device.
0836
0837
0838 IEEE 802.1ad (QinQ) Support
0839 ---------------------------
0840 The IEEE 802.1ad standard, informally known as QinQ, allows for multiple VLAN
0841 IDs within a single Ethernet frame. VLAN IDs are sometimes referred to as
0842 "tags," and multiple VLAN IDs are thus referred to as a "tag stack." Tag stacks
0843 allow L2 tunneling and the ability to segregate traffic within a particular
0844 VLAN ID, among other uses.
0845
0846 NOTES:
0847
0848 - Receive checksum offloads and VLAN acceleration are not supported for 802.1ad
0849 (QinQ) packets.
0850
0851 - 0x88A8 traffic will not be received unless VLAN stripping is disabled with
0852 the following command::
0853
0854 # ethtool -K <ethX> rxvlan off
0855
0856 - 0x88A8/0x8100 double VLANs cannot be used with 0x8100 or 0x8100/0x8100 VLANS
0857 configured on the same port. 0x88a8/0x8100 traffic will not be received if
0858 0x8100 VLANs are configured.
0859
0860 - The VF can only transmit 0x88A8/0x8100 (i.e., 802.1ad/802.1Q) traffic if:
0861
0862 1) The VF is not assigned a port VLAN.
0863 2) spoofchk is disabled from the PF. If you enable spoofchk, the VF will
0864 not transmit 0x88A8/0x8100 traffic.
0865
0866 - The VF may not receive all network traffic based on the Inner VLAN header
0867 when VF true promiscuous mode (vf-true-promisc-support) and double VLANs are
0868 enabled in SR-IOV mode.
0869
0870 The following are examples of how to configure 802.1ad (QinQ)::
0871
0872 # ip link add link eth0 eth0.24 type vlan proto 802.1ad id 24
0873 # ip link add link eth0.24 eth0.24.371 type vlan proto 802.1Q id 371
0874
0875 Where "24" and "371" are example VLAN IDs.
0876
0877
0878 Tunnel/Overlay Stateless Offloads
0879 ---------------------------------
0880 Supported tunnels and overlays include VXLAN, GENEVE, and others depending on
0881 hardware and software configuration. Stateless offloads are enabled by default.
0882
0883 To view the current state of all offloads::
0884
0885 # ethtool -k <ethX>
0886
0887
0888 UDP Segmentation Offload
0889 ------------------------
0890 Allows the adapter to offload transmit segmentation of UDP packets with
0891 payloads up to 64K into valid Ethernet frames. Because the adapter hardware is
0892 able to complete data segmentation much faster than operating system software,
0893 this feature may improve transmission performance.
0894 In addition, the adapter may use fewer CPU resources.
0895
0896 NOTE:
0897
0898 - The application sending UDP packets must support UDP segmentation offload.
0899
0900 To enable/disable UDP Segmentation Offload, issue the following command::
0901
0902 # ethtool -K <ethX> tx-udp-segmentation [off|on]
0903
0904 GNSS module
0905 -----------
0906 Allows user to read messages from the GNSS module and write supported commands.
0907 If the module is physically present, driver creates 2 TTYs for each supported
0908 device in /dev, ttyGNSS_<device>:<function>_0 and _1. First one (_0) is RW and
0909 the second one is RO.
0910 The protocol of write commands is dependent on the GNSS module as the driver
0911 writes raw bytes from the TTY to the GNSS i2c. Please refer to the module
0912 documentation for details.
0913
0914 Performance Optimization
0915 ========================
0916 Driver defaults are meant to fit a wide variety of workloads, but if further
0917 optimization is required, we recommend experimenting with the following
0918 settings.
0919
0920
0921 Rx Descriptor Ring Size
0922 -----------------------
0923 To reduce the number of Rx packet discards, increase the number of Rx
0924 descriptors for each Rx ring using ethtool.
0925
0926 Check if the interface is dropping Rx packets due to buffers being full
0927 (rx_dropped.nic can mean that there is no PCIe bandwidth)::
0928
0929 # ethtool -S <ethX> | grep "rx_dropped"
0930
0931 If the previous command shows drops on queues, it may help to increase
0932 the number of descriptors using 'ethtool -G'::
0933
0934 # ethtool -G <ethX> rx <N>
0935 Where <N> is the desired number of ring entries/descriptors
0936
0937 This can provide temporary buffering for issues that create latency while
0938 the CPUs process descriptors.
0939
0940
0941 Interrupt Rate Limiting
0942 -----------------------
0943 This driver supports an adaptive interrupt throttle rate (ITR) mechanism that
0944 is tuned for general workloads. The user can customize the interrupt rate
0945 control for specific workloads, via ethtool, adjusting the number of
0946 microseconds between interrupts.
0947
0948 To set the interrupt rate manually, you must disable adaptive mode::
0949
0950 # ethtool -C <ethX> adaptive-rx off adaptive-tx off
0951
0952 For lower CPU utilization:
0953
0954 Disable adaptive ITR and lower Rx and Tx interrupts. The examples below
0955 affect every queue of the specified interface.
0956
0957 Setting rx-usecs and tx-usecs to 80 will limit interrupts to about
0958 12,500 interrupts per second per queue::
0959
0960 # ethtool -C <ethX> adaptive-rx off adaptive-tx off rx-usecs 80 tx-usecs 80
0961
0962 For reduced latency:
0963
0964 Disable adaptive ITR and ITR by setting rx-usecs and tx-usecs to 0
0965 using ethtool::
0966
0967 # ethtool -C <ethX> adaptive-rx off adaptive-tx off rx-usecs 0 tx-usecs 0
0968
0969 Per-queue interrupt rate settings:
0970
0971 The following examples are for queues 1 and 3, but you can adjust other
0972 queues.
0973
0974 To disable Rx adaptive ITR and set static Rx ITR to 10 microseconds or
0975 about 100,000 interrupts/second, for queues 1 and 3::
0976
0977 # ethtool --per-queue <ethX> queue_mask 0xa --coalesce adaptive-rx off
0978 rx-usecs 10
0979
0980 To show the current coalesce settings for queues 1 and 3::
0981
0982 # ethtool --per-queue <ethX> queue_mask 0xa --show-coalesce
0983
0984 Bounding interrupt rates using rx-usecs-high:
0985
0986 :Valid Range: 0-236 (0=no limit)
0987
0988 The range of 0-236 microseconds provides an effective range of 4,237 to
0989 250,000 interrupts per second. The value of rx-usecs-high can be set
0990 independently of rx-usecs and tx-usecs in the same ethtool command, and is
0991 also independent of the adaptive interrupt moderation algorithm. The
0992 underlying hardware supports granularity in 4-microsecond intervals, so
0993 adjacent values may result in the same interrupt rate.
0994
0995 The following command would disable adaptive interrupt moderation, and allow
0996 a maximum of 5 microseconds before indicating a receive or transmit was
0997 complete. However, instead of resulting in as many as 200,000 interrupts per
0998 second, it limits total interrupts per second to 50,000 via the rx-usecs-high
0999 parameter.
1000
1001 ::
1002
1003 # ethtool -C <ethX> adaptive-rx off adaptive-tx off rx-usecs-high 20
1004 rx-usecs 5 tx-usecs 5
1005
1006
1007 Virtualized Environments
1008 ------------------------
1009 In addition to the other suggestions in this section, the following may be
1010 helpful to optimize performance in VMs.
1011
1012 Using the appropriate mechanism (vcpupin) in the VM, pin the CPUs to
1013 individual LCPUs, making sure to use a set of CPUs included in the
1014 device's local_cpulist: ``/sys/class/net/<ethX>/device/local_cpulist``.
1015
1016 Configure as many Rx/Tx queues in the VM as available. (See the iavf driver
1017 documentation for the number of queues supported.) For example::
1018
1019 # ethtool -L <virt_interface> rx <max> tx <max>
1020
1021
1022 Support
1023 =======
1024 For general information, go to the Intel support website at:
1025 https://www.intel.com/support/
1026
1027 or the Intel Wired Networking project hosted by Sourceforge at:
1028 https://sourceforge.net/projects/e1000
1029
1030 If an issue is identified with the released source code on a supported kernel
1031 with a supported adapter, email the specific information related to the issue
1032 to e1000-devel@lists.sf.net.
1033
1034
1035 Trademarks
1036 ==========
1037 Intel is a trademark or registered trademark of Intel Corporation or its
1038 subsidiaries in the United States and/or other countries.
1039
1040 * Other names and brands may be claimed as the property of others.