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