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