xref: /f-stack/dpdk/doc/guides/nics/fm10k.rst (revision 2d9fd380)
1..  SPDX-License-Identifier: BSD-3-Clause
2    Copyright(c) 2015-2016 Intel Corporation.
3
4FM10K Poll Mode Driver
5======================
6
7The FM10K poll mode driver library provides support for the Intel FM10000
8(FM10K) family of 40GbE/100GbE adapters.
9
10FTAG Based Forwarding of FM10K
11------------------------------
12
13FTAG Based Forwarding is a unique feature of FM10K. The FM10K family of NICs
14support the addition of a Fabric Tag (FTAG) to carry special information.
15The FTAG is placed at the beginning of the frame, it contains information
16such as where the packet comes from and goes, and the vlan tag. In FTAG based
17forwarding mode, the switch logic forwards packets according to glort (global
18resource tag) information, rather than the mac and vlan table. Currently this
19feature works only on PF.
20
21To enable this feature, the user should pass a devargs parameter to the eal
22like "-a 84:00.0,enable_ftag=1", and the application should make sure an
23appropriate FTAG is inserted for every frame on TX side.
24
25Vector PMD for FM10K
26--------------------
27
28Vector PMD (vPMD) uses Intel® SIMD instructions to optimize packet I/O.
29It improves load/store bandwidth efficiency of L1 data cache by using a wider
30SSE/AVX ''register (1)''.
31The wider register gives space to hold multiple packet buffers so as to save
32on the number of instructions when bulk processing packets.
33
34There is no change to the PMD API. The RX/TX handlers are the only two entries for
35vPMD packet I/O. They are transparently registered at runtime RX/TX execution
36if all required conditions are met.
37
38Some constraints apply as pre-conditions for specific optimizations on bulk
39packet transfers. The following sections explain RX and TX constraints in the
40vPMD.
41
42
43RX Constraints
44~~~~~~~~~~~~~~
45
46
47Prerequisites and Pre-conditions
48^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49
50For Vector RX it is assumed that the number of descriptor rings will be a power
51of 2. With this pre-condition, the ring pointer can easily scroll back to the
52head after hitting the tail without a conditional check. In addition Vector RX
53can use this assumption to do a bit mask using ``ring_size - 1``.
54
55
56Features not Supported by Vector RX PMD
57^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58
59Some features are not supported when trying to increase the throughput in
60vPMD. They are:
61
62*   IEEE1588
63
64*   Flow director
65
66*   Header split
67
68*   RX checksum offload
69
70Other features are supported using optional MACRO configuration. They include:
71
72*   HW VLAN strip
73
74*   L3/L4 packet type
75
76To enable via ``RX_OLFLAGS`` use ``RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE=y``.
77
78To guarantee the constraint, the following capabilities in ``dev_conf.rxmode.offloads``
79will be checked:
80
81*   ``DEV_RX_OFFLOAD_VLAN_EXTEND``
82
83*   ``DEV_RX_OFFLOAD_CHECKSUM``
84
85*   ``DEV_RX_OFFLOAD_HEADER_SPLIT``
86
87*   ``fdir_conf->mode``
88
89
90RX Burst Size
91^^^^^^^^^^^^^
92
93As vPMD is focused on high throughput, it processes 4 packets at a time. So it assumes
94that the RX burst should be greater than 4 packets per burst. It returns zero if using
95``nb_pkt`` < 4 in the receive handler. If ``nb_pkt`` is not a multiple of 4, a
96floor alignment will be applied.
97
98
99TX Constraint
100~~~~~~~~~~~~~
101
102Features not Supported by TX Vector PMD
103^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
105TX vPMD only works when offloads is set to 0
106
107This means that it does not support any TX offload.
108
109Limitations
110-----------
111
112
113Switch manager
114~~~~~~~~~~~~~~
115
116The Intel FM10000 family of NICs integrate a hardware switch and multiple host
117interfaces. The FM10000 PMD driver only manages host interfaces. For the
118switch component another switch driver has to be loaded prior to the
119FM10000 PMD driver. The switch driver can be acquired from Intel support.
120Only Testpoint is validated with DPDK, the latest version that has been
121validated with DPDK is 4.1.6.
122
123Support for Switch Restart
124~~~~~~~~~~~~~~~~~~~~~~~~~~
125
126For FM10000 multi host based design a DPDK app running in the VM or host needs
127to be aware of the switch's state since it may undergo a quit-restart. When
128the switch goes down the DPDK app will receive a LSC event indicating link
129status down, and the app should stop the worker threads that are polling on
130the Rx/Tx queues. When switch comes up, a LSC event indicating ``LINK_UP`` is
131sent to the app, which can then restart the FM10000 port to resume network
132processing.
133
134CRC stripping
135~~~~~~~~~~~~~
136
137The FM10000 family of NICs strip the CRC for every packets coming into the
138host interface. So, keeping CRC is not supported.
139
140Maximum packet length
141~~~~~~~~~~~~~~~~~~~~~
142
143The FM10000 family of NICS support a maximum of a 15K jumbo frame. The value
144is fixed and cannot be changed. So, even when the ``rxmode.max_rx_pkt_len``
145member of ``struct rte_eth_conf`` is set to a value lower than 15364, frames
146up to 15364 bytes can still reach the host interface.
147
148Statistic Polling Frequency
149~~~~~~~~~~~~~~~~~~~~~~~~~~~
150
151The FM10000 NICs expose a set of statistics via the PCI BARs. These statistics
152are read from the hardware registers when ``rte_eth_stats_get()`` or
153``rte_eth_xstats_get()`` is called. The packet counting registers are 32 bits
154while the byte counting registers are 48 bits. As a result, the statistics must
155be polled regularly in order to ensure the consistency of the returned reads.
156
157Given the PCIe Gen3 x8, about 50Gbps of traffic can occur. With 64 byte packets
158this gives almost 100 million packets/second, causing 32 bit integer overflow
159after approx 40 seconds. To ensure these overflows are detected and accounted
160for in the statistics, it is necessary to read statistic regularly. It is
161suggested to read stats every 20 seconds, which will ensure the statistics
162are accurate.
163
164
165Interrupt mode
166~~~~~~~~~~~~~~
167
168The FM10000 family of NICS need one separate interrupt for mailbox. So only
169drivers which support multiple interrupt vectors e.g. vfio-pci can work
170for fm10k interrupt mode.
171