doc: fix diagram in dpaa2 guide
[dpdk.git] / doc / guides / nics / dpaa.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright 2017,2020 NXP
3
4
5 DPAA Poll Mode Driver
6 =====================
7
8 The DPAA NIC PMD (**librte_pmd_dpaa**) provides poll mode driver
9 support for the inbuilt NIC found in the **NXP DPAA** SoC family.
10
11 More information can be found at `NXP Official Website
12 <http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/qoriq-arm-processors:QORIQ-ARM>`_.
13
14 NXP DPAA (Data Path Acceleration Architecture - Gen 1)
15 ------------------------------------------------------
16
17 This section provides an overview of the NXP DPAA architecture
18 and how it is integrated into the DPDK.
19
20 Contents summary
21
22 - DPAA overview
23 - DPAA driver architecture overview
24 - FMAN configuration tools and library
25
26 .. _dpaa_overview:
27
28 DPAA Overview
29 ~~~~~~~~~~~~~
30
31 Reference: `FSL DPAA Architecture <http://www.nxp.com/assets/documents/data/en/white-papers/QORIQDPAAWP.pdf>`_.
32
33 The QorIQ Data Path Acceleration Architecture (DPAA) is a set of hardware
34 components on specific QorIQ series multicore processors. This architecture
35 provides the infrastructure to support simplified sharing of networking
36 interfaces and accelerators by multiple CPU cores, and the accelerators
37 themselves.
38
39 DPAA includes:
40
41 - Cores
42 - Network and packet I/O
43 - Hardware offload accelerators
44 - Infrastructure required to facilitate flow of packets between the components above
45
46 Infrastructure components are:
47
48 - The Queue Manager (QMan) is a hardware accelerator that manages frame queues.
49   It allows  CPUs and other accelerators connected to the SoC datapath to
50   enqueue and dequeue ethernet frames, thus providing the infrastructure for
51   data exchange among CPUs and datapath accelerators.
52 - The Buffer Manager (BMan) is a hardware buffer pool management block that
53   allows software and accelerators on the datapath to acquire and release
54   buffers in order to build frames.
55
56 Hardware accelerators are:
57
58 - SEC - Cryptographic accelerator
59 - PME - Pattern matching engine
60
61 The Network and packet I/O component:
62
63 - The Frame Manager (FMan) is a key component in the DPAA and makes use of the
64   DPAA infrastructure (QMan and BMan). FMan  is responsible for packet
65   distribution and policing. Each frame can be parsed, classified and results
66   may be attached to the frame. This meta data can be used to select
67   particular QMan queue, which the packet is forwarded to.
68
69
70 DPAA DPDK - Poll Mode Driver Overview
71 -------------------------------------
72
73 This section provides an overview of the drivers for DPAA:
74
75 * Bus driver and associated "DPAA infrastructure" drivers
76 * Functional object drivers (such as Ethernet).
77
78 Brief description of each driver is provided in layout below as well as
79 in the following sections.
80
81 .. code-block:: console
82
83                                        +------------+
84                                        | DPDK DPAA  |
85                                        |    PMD     |
86                                        +-----+------+
87                                              |
88                                        +-----+------+       +---------------+
89                                        :  Ethernet  :.......| DPDK DPAA     |
90                     . . . . . . . . .  :   (FMAN)   :       | Mempool driver|
91                    .                   +---+---+----+       |  (BMAN)       |
92                   .                        ^   |            +-----+---------+
93                  .                         |   |<enqueue,         .
94                 .                          |   | dequeue>         .
95                .                           |   |                  .
96               .                        +---+---V----+             .
97              .      . . . . . . . . . .: Portal drv :             .
98             .      .                   :            :             .
99            .      .                    +-----+------+             .
100           .      .                     :   QMAN     :             .
101          .      .                      :  Driver    :             .
102     +----+------+-------+              +-----+------+             .
103     |   DPDK DPAA Bus   |                    |                    .
104     |   driver          |....................|.....................
105     |   /bus/dpaa       |                    |
106     +-------------------+                    |
107                                              |
108     ========================== HARDWARE =====|========================
109                                             PHY
110     =========================================|========================
111
112 In the above representation, solid lines represent components which interface
113 with DPDK RTE Framework and dotted lines represent DPAA internal components.
114
115 DPAA Bus driver
116 ~~~~~~~~~~~~~~~
117
118 The DPAA bus driver is a ``rte_bus`` driver which scans the platform like bus.
119 Key functions include:
120
121 - Scanning and parsing the various objects and adding them to their respective
122   device list.
123 - Performing probe for available drivers against each scanned device
124 - Creating necessary ethernet instance before passing control to the PMD
125
126 DPAA NIC Driver (PMD)
127 ~~~~~~~~~~~~~~~~~~~~~
128
129 DPAA PMD is traditional DPDK PMD which provides necessary interface between
130 RTE framework and DPAA internal components/drivers.
131
132 - Once devices have been identified by DPAA Bus, each device is associated
133   with the PMD
134 - PMD is responsible for implementing necessary glue layer between RTE APIs
135   and lower level QMan and FMan blocks.
136   The Ethernet driver is bound to a FMAN port and implements the interfaces
137   needed to connect the DPAA network interface to the network stack.
138   Each FMAN Port corresponds to a DPDK network interface.
139
140
141 Features
142 ^^^^^^^^
143
144   Features of the DPAA PMD are:
145
146   - Multiple queues for TX and RX
147   - Receive Side Scaling (RSS)
148   - Packet type information
149   - Checksum offload
150   - Promiscuous mode
151
152 DPAA Mempool Driver
153 ~~~~~~~~~~~~~~~~~~~
154
155 DPAA has a hardware offloaded buffer pool manager, called BMan, or Buffer
156 Manager.
157
158 - Using standard Mempools operations RTE API, the mempool driver interfaces
159   with RTE to service each mempool creation, deletion, buffer allocation and
160   deallocation requests.
161 - Each FMAN instance has a BMan pool attached to it during initialization.
162   Each Tx frame can be automatically released by hardware, if allocated from
163   this pool.
164
165
166 Whitelisting & Blacklisting
167 ---------------------------
168
169 For blacklisting a DPAA device, following commands can be used.
170
171  .. code-block:: console
172
173     <dpdk app> <EAL args> -b "dpaa_bus:fmX-macY" -- ...
174     e.g. "dpaa_bus:fm1-mac4"
175
176 Supported DPAA SoCs
177 -------------------
178
179 - LS1043A/LS1023A
180 - LS1046A/LS1026A
181
182 Prerequisites
183 -------------
184
185 See :doc:`../platform/dpaa` for setup information
186
187
188 - Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>`
189   to setup the basic DPDK environment.
190
191 .. note::
192
193    Some part of dpaa bus code (qbman and fman - library) routines are
194    dual licensed (BSD & GPLv2), however they are used as BSD in DPDK in userspace.
195
196 Pre-Installation Configuration
197 ------------------------------
198
199 Config File Options
200 ~~~~~~~~~~~~~~~~~~~
201
202 The following options can be modified in the ``config`` file.
203 Please note that enabling debugging options may affect system performance.
204
205 - ``CONFIG_RTE_LIBRTE_DPAA_BUS`` (default ``y``)
206
207   Toggle compilation of the ``librte_bus_dpaa`` driver.
208
209 - ``CONFIG_RTE_LIBRTE_DPAA_PMD`` (default ``y``)
210
211   Toggle compilation of the ``librte_pmd_dpaa`` driver.
212
213 - ``CONFIG_RTE_LIBRTE_DPAA_DEBUG_DRIVER`` (default ``n``)
214
215   Toggles display of bus configurations and enables a debugging queue
216   to fetch error (Rx/Tx) packets to driver. By default, packets with errors
217   (like wrong checksum) are dropped by the hardware.
218
219 - ``CONFIG_RTE_LIBRTE_DPAA_HWDEBUG`` (default ``n``)
220
221   Enables debugging of the Queue and Buffer Manager layer which interacts
222   with the DPAA hardware.
223
224
225 Environment Variables
226 ~~~~~~~~~~~~~~~~~~~~~
227
228 DPAA drivers uses the following environment variables to configure its
229 state during application initialization:
230
231 - ``DPAA_NUM_RX_QUEUES`` (default 1)
232
233   This defines the number of Rx queues configured for an application, per
234   port. Hardware would distribute across these many number of queues on Rx
235   of packets.
236   In case the application is configured to use lesser number of queues than
237   configured above, it might result in packet loss (because of distribution).
238
239 - ``DPAA_PUSH_QUEUES_NUMBER`` (default 4)
240
241   This defines the number of High performance queues to be used for ethdev Rx.
242   These queues use one private HW portal per queue configured, so they are
243   limited in the system. The first configured ethdev queues will be
244   automatically be assigned from the these high perf PUSH queues. Any queue
245   configuration beyond that will be standard Rx queues. The application can
246   choose to change their number if HW portals are limited.
247   The valid values are from '0' to '4'. The values shall be set to '0' if the
248   application want to use eventdev with DPAA device.
249   Currently these queues are not used for LS1023/LS1043 platform by default.
250
251
252 Driver compilation and testing
253 ------------------------------
254
255 Refer to the document :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
256 for details.
257
258 #. Running testpmd:
259
260    Follow instructions available in the document
261    :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
262    to run testpmd.
263
264    Example output:
265
266    .. code-block:: console
267
268       ./arm64-dpaa-linux-gcc/testpmd -c 0xff -n 1 \
269         -- -i --portmask=0x3 --nb-cores=1 --no-flush-rx
270
271       .....
272       EAL: Registered [pci] bus.
273       EAL: Registered [dpaa] bus.
274       EAL: Detected 4 lcore(s)
275       .....
276       EAL: dpaa: Bus scan completed
277       .....
278       Configuring Port 0 (socket 0)
279       Port 0: 00:00:00:00:00:01
280       Configuring Port 1 (socket 0)
281       Port 1: 00:00:00:00:00:02
282       .....
283       Checking link statuses...
284       Port 0 Link Up - speed 10000 Mbps - full-duplex
285       Port 1 Link Up - speed 10000 Mbps - full-duplex
286       Done
287       testpmd>
288
289 FMAN Config
290 -----------
291
292 Frame Manager is also responsible for parser, classify and distribute
293 functionality in the DPAA.
294
295    FMAN supports:
296    Packet parsing at wire speed. It supports standard protocols parsing and
297    identification by HW (VLAN/IP/UDP/TCP/SCTP/PPPoE/PPP/MPLS/GRE/IPSec).
298    It supports non-standard UDF header parsing for custom protocols.
299    Classification / Distribution: Coarse classification based on Key generation
300    Hash and exact match lookup
301
302 FMC - FMAN Configuration Tool
303 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
304    This tool is available in User Space. The tool is used to configure FMAN
305    Physical (MAC) or Ephemeral (OH)ports for Parse/Classify/distribute.
306    The PCDs can be hash based where a set of fields are key input for hash
307    generation within FMAN keygen. The hash value is used to generate a FQID for
308    frame. There is a provision to setup exact match lookup too where field
309    values within a packet drives corresponding FQID.
310    Currently it works on XML file inputs.
311
312    Limitations:
313    1.For Dynamic Configuration change, currently no support is available.
314    E.g. enable/disable a port, a operator (set of VLANs and associate rules).
315
316    2.During FMC configuration, port for which policy is being configured is
317    brought down and the policy is flushed on port before new policy is updated
318    for the port. Support is required to add/append/delete etc.
319
320    3.FMC, being a separate user-space application, needs to be invoked from
321    Shell.
322
323
324    The details can be found in FMC Doc at:
325    `Frame Mnager Configuration Tool <https://www.nxp.com/docs/en/application-note/AN4760.pdf>`_.
326
327 FMLIB
328 ~~~~~
329    The Frame Manager library provides an API on top of the Frame Manager driver
330    ioctl calls, that provides a user space application with a simple way to
331    configure driver parameters and PCD (parse - classify - distribute) rules.
332
333    This is an alternate to the FMC based configuration. This library provides
334    direct ioctl based interfaces for FMAN configuration as used by the FMC tool
335    as well. This helps in overcoming the main limitaiton of FMC - i.e. lack
336    of dynamic configuration.
337
338    The location for the fmd driver as used by FMLIB and FMC is as follows:
339    `Kernel FMD Driver
340    <https://source.codeaurora.org/external/qoriq/qoriq-components/linux/tree/drivers/net/ethernet/freescale/sdk_fman?h=linux-4.19-rt>`_.
341
342 VSP (Virtual Storage Profile)
343 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
344    The storage profiled are means to provide virtualized interface. A ranges of
345    storage profiles cab be associated to Ethernet ports.
346    They are selected during classification. Specify how the frame should be
347    written to memory and which buffer pool to select for packet storange in
348    queues. Start and End margin of buffer can also be configured.
349
350 Limitations
351 -----------
352
353 Platform Requirement
354 ~~~~~~~~~~~~~~~~~~~~
355
356 DPAA drivers for DPDK can only work on NXP SoCs as listed in the
357 ``Supported DPAA SoCs``.
358
359 Maximum packet length
360 ~~~~~~~~~~~~~~~~~~~~~
361
362 The DPAA SoC family support a maximum of a 10240 jumbo frame. The value
363 is fixed and cannot be changed. So, even when the ``rxmode.max_rx_pkt_len``
364 member of ``struct rte_eth_conf`` is set to a value lower than 10240, frames
365 up to 10240 bytes can still reach the host interface.
366
367 Multiprocess Support
368 ~~~~~~~~~~~~~~~~~~~~
369
370 Current version of DPAA driver doesn't support multi-process applications
371 where I/O is performed using secondary processes. This feature would be
372 implemented in subsequent versions.