fm10k: setup Rx interrupt for PF and VF
[dpdk.git] / doc / guides / nics / fm10k.rst
1 ..  BSD LICENSE
2     Copyright(c) 2015 Intel Corporation. All rights reserved.
3     All rights reserved.
4
5     Redistribution and use in source and binary forms, with or without
6     modification, are permitted provided that the following conditions
7     are met:
8
9     * Redistributions of source code must retain the above copyright
10     notice, this list of conditions and the following disclaimer.
11     * Redistributions in binary form must reproduce the above copyright
12     notice, this list of conditions and the following disclaimer in
13     the documentation and/or other materials provided with the
14     distribution.
15     * Neither the name of Intel Corporation nor the names of its
16     contributors may be used to endorse or promote products derived
17     from this software without specific prior written permission.
18
19     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20     "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22     A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23     OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25     LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31 FM10K Poll Mode Driver
32 ======================
33
34 The FM10K poll mode driver library provides support for the Intel FM10000
35 (FM10K) family of 40GbE/100GbE adapters.
36
37
38 Vector PMD for FM10K
39 --------------------
40
41 Vector PMD (vPMD) uses IntelĀ® SIMD instructions to optimize packet I/O.
42 It improves load/store bandwidth efficiency of L1 data cache by using a wider
43 SSE/AVX ''register (1)''.
44 The wider register gives space to hold multiple packet buffers so as to save
45 on the number of instructions when bulk processing packets.
46
47 There is no change to the PMD API. The RX/TX handlers are the only two entries for
48 vPMD packet I/O. They are transparently registered at runtime RX/TX execution
49 if all required conditions are met.
50
51 1.  To date, only an SSE version of FM10K vPMD is available.
52     To ensure that vPMD is in the binary code, set
53     ``CONFIG_RTE_LIBRTE_FM10K_INC_VECTOR=y`` in the configure file.
54
55 Some constraints apply as pre-conditions for specific optimizations on bulk
56 packet transfers. The following sections explain RX and TX constraints in the
57 vPMD.
58
59
60 RX Constraints
61 ~~~~~~~~~~~~~~
62
63
64 Prerequisites and Pre-conditions
65 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
67 For Vector RX it is assumed that the number of descriptor rings will be a power
68 of 2. With this pre-condition, the ring pointer can easily scroll back to the
69 head after hitting the tail without a conditional check. In addition Vector RX
70 can use this assumption to do a bit mask using ``ring_size - 1``.
71
72
73 Features not Supported by Vector RX PMD
74 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75
76 Some features are not supported when trying to increase the throughput in
77 vPMD. They are:
78
79 *   IEEE1588
80
81 *   Flow director
82
83 *   Header split
84
85 *   RX checksum offload
86
87 Other features are supported using optional MACRO configuration. They include:
88
89 *   HW VLAN strip
90
91 *   L3/L4 packet type
92
93 To enable via ``RX_OLFLAGS`` use ``RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE=y``.
94
95 To guarantee the constraint, the following configuration flags in ``dev_conf.rxmode``
96 will be checked:
97
98 *   ``hw_vlan_extend``
99
100 *   ``hw_ip_checksum``
101
102 *   ``header_split``
103
104 *   ``fdir_conf->mode``
105
106
107 RX Burst Size
108 ^^^^^^^^^^^^^
109
110 As vPMD is focused on high throughput, it processes 4 packets at a time. So it assumes
111 that the RX burst should be greater than 4 packets per burst. It returns zero if using
112 ``nb_pkt`` < 4 in the receive handler. If ``nb_pkt`` is not a multiple of 4, a
113 floor alignment will be applied.
114
115
116 TX Constraint
117 ~~~~~~~~~~~~~
118
119 Features not Supported by TX Vector PMD
120 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121
122 TX vPMD only works when ``txq_flags`` is set to ``FM10K_SIMPLE_TX_FLAG``.
123 This means that it does not support TX multi-segment, VLAN offload or TX csum
124 offload. The following MACROs are used for these three features:
125
126 *   ``ETH_TXQ_FLAGS_NOMULTSEGS``
127
128 *   ``ETH_TXQ_FLAGS_NOVLANOFFL``
129
130 *   ``ETH_TXQ_FLAGS_NOXSUMSCTP``
131
132 *   ``ETH_TXQ_FLAGS_NOXSUMUDP``
133
134 *   ``ETH_TXQ_FLAGS_NOXSUMTCP``
135
136 Limitations
137 -----------
138
139
140 Switch manager
141 ~~~~~~~~~~~~~~
142
143 The Intel FM10000 family of NICs integrate a hardware switch and multiple host
144 interfaces. The FM10000 PMD driver only manages host interfaces. For the
145 switch component another switch driver has to be loaded prior to to the
146 FM10000 PMD driver.  The switch driver can be acquired for Intel support or
147 from the `Match Interface <https://github.com/match-interface>`_ project.
148 Only Testpoint is validated with DPDK, the latest version that has been
149 validated with DPDK2.2 is 4.1.6.
150
151 CRC striping
152 ~~~~~~~~~~~~
153
154 The FM10000 family of NICs strip the CRC for every packets coming into the
155 host interface.  So, CRC will be stripped even when the
156 ``rxmode.hw_strip_crc`` member is set to 0 in ``struct rte_eth_conf``.
157
158
159 Maximum packet length
160 ~~~~~~~~~~~~~~~~~~~~~
161
162 The FM10000 family of NICS support a maximum of a 15K jumbo frame. The value
163 is fixed and cannot be changed. So, even when the ``rxmode.max_rx_pkt_len``
164 member of ``struct rte_eth_conf`` is set to a value lower than 15364, frames
165 up to 15364 bytes can still reach the host interface.
166
167 Statistic Polling Frequency
168 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
169
170 The FM10000 NICs expose a set of statistics via the PCI BARs. These statistics
171 are read from the hardware registers when ``rte_eth_stats_get()`` or
172 ``rte_eth_xstats_get()`` is called. The packet counting registers are 32 bits
173 while the byte counting registers are 48 bits. As a result, the statistics must
174 be polled regularly in order to ensure the consistency of the returned reads.
175
176 Given the PCIe Gen3 x8, about 50Gbps of traffic can occur. With 64 byte packets
177 this gives almost 100 million packets/second, causing 32 bit integer overflow
178 after approx 40 seconds. To ensure these overflows are detected and accounted
179 for in the statistics, it is necessary to read statistic regularly. It is
180 suggested to read stats every 20 seconds, which will ensure the statistics
181 are accurate.
182
183
184 Interrupt mode
185 ~~~~~~~~~~~~~~
186
187 The FM10000 family of NICS need one separate interrupt for mailbox. So only
188 drivers which support multiple interrupt vectors e.g. vfio-pci can work
189 for fm10k interrupt mode.