4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions
8 * Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in
12 the documentation and/or other materials provided with the
14 * Neither the name of NXP nor the names of its
15 contributors may be used to endorse or promote products derived
16 from this software without specific prior written permission.
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 The DPAA NIC PMD (**librte_pmd_dpaa**) provides poll mode driver
34 support for the inbuilt NIC found in the **NXP DPAA** SoC family.
36 More information can be found at `NXP Official Website
37 <http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/qoriq-arm-processors:QORIQ-ARM>`_.
39 NXP DPAA (Data Path Acceleration Architecture - Gen 1)
40 ------------------------------------------------------
42 This section provides an overview of the NXP DPAA architecture
43 and how it is integrated into the DPDK.
48 - DPAA driver architecture overview
55 Reference: `FSL DPAA Architecture <http://www.nxp.com/assets/documents/data/en/white-papers/QORIQDPAAWP.pdf>`_.
57 The QorIQ Data Path Acceleration Architecture (DPAA) is a set of hardware
58 components on specific QorIQ series multicore processors. This architecture
59 provides the infrastructure to support simplified sharing of networking
60 interfaces and accelerators by multiple CPU cores, and the accelerators
66 - Network and packet I/O
67 - Hardware offload accelerators
68 - Infrastructure required to facilitate flow of packets between the components above
70 Infrastructure components are:
72 - The Queue Manager (QMan) is a hardware accelerator that manages frame queues.
73 It allows CPUs and other accelerators connected to the SoC datapath to
74 enqueue and dequeue ethernet frames, thus providing the infrastructure for
75 data exchange among CPUs and datapath accelerators.
76 - The Buffer Manager (BMan) is a hardware buffer pool management block that
77 allows software and accelerators on the datapath to acquire and release
78 buffers in order to build frames.
80 Hardware accelerators are:
82 - SEC - Cryptographic accelerator
83 - PME - Pattern matching engine
85 The Network and packet I/O component:
87 - The Frame Manager (FMan) is a key component in the DPAA and makes use of the
88 DPAA infrastructure (QMan and BMan). FMan is responsible for packet
89 distribution and policing. Each frame can be parsed, classified and results
90 may be attached to the frame. This meta data can be used to select
91 particular QMan queue, which the packet is forwarded to.
94 DPAA DPDK - Poll Mode Driver Overview
95 -------------------------------------
97 This section provides an overview of the drivers for DPAA:
99 * Bus driver and associated "DPAA infrastructure" drivers
100 * Functional object drivers (such as Ethernet).
102 Brief description of each driver is provided in layout below as well as
103 in the following sections.
105 .. code-block:: console
112 +-----+------+ +---------------+
113 : Ethernet :.......| DPDK DPAA |
114 . . . . . . . . . : (FMAN) : | Mempool driver|
115 . +---+---+----+ | (BMAN) |
116 . ^ | +-----+---------+
121 . . . . . . . . . . .: Portal drv : .
126 +----+------+-------+ +-----+------+ .
127 | DPDK DPAA Bus | | .
128 | driver |....................|.....................
130 +-------------------+ |
132 ========================== HARDWARE =====|========================
134 =========================================|========================
136 In the above representation, solid lines represent components which interface
137 with DPDK RTE Framework and dotted lines represent DPAA internal components.
142 The DPAA bus driver is a ``rte_bus`` driver which scans the platform like bus.
143 Key functions include:
145 - Scanning and parsing the various objects and adding them to their respective
147 - Performing probe for available drivers against each scanned device
148 - Creating necessary ethernet instance before passing control to the PMD
150 DPAA NIC Driver (PMD)
151 ~~~~~~~~~~~~~~~~~~~~~
153 DPAA PMD is traditional DPDK PMD which provides necessary interface between
154 RTE framework and DPAA internal components/drivers.
156 - Once devices have been identified by DPAA Bus, each device is associated
158 - PMD is responsible for implementing necessary glue layer between RTE APIs
159 and lower level QMan and FMan blocks.
160 The Ethernet driver is bound to a FMAN port and implements the interfaces
161 needed to connect the DPAA network interface to the network stack.
162 Each FMAN Port corresponds to a DPDK network interface.
168 Features of the DPAA PMD are:
170 - Multiple queues for TX and RX
171 - Receive Side Scaling (RSS)
172 - Packet type information
179 DPAA has a hardware offloaded buffer pool manager, called BMan, or Buffer
182 - Using standard Mempools operations RTE API, the mempool driver interfaces
183 with RTE to service each mempool creation, deletion, buffer allocation and
184 deallocation requests.
185 - Each FMAN instance has a BMan pool attached to it during initialization.
186 Each Tx frame can be automatically released by hardware, if allocated from
199 There are three main pre-requisities for executing DPAA PMD on a DPAA
202 1. **ARM 64 Tool Chain**
204 For example, the `*aarch64* Linaro Toolchain <https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/aarch64-linux-gnu>`_.
208 It can be obtained from `NXP's Github hosting <https://github.com/qoriq-open-source/linux>`_.
210 3. **Rootfile system**
212 Any *aarch64* supporting filesystem can be used. For example,
213 Ubuntu 15.10 (Wily) or 16.04 LTS (Xenial) userland which can be obtained
214 from `here <http://cdimage.ubuntu.com/ubuntu-base/releases/16.04/release/ubuntu-base-16.04.1-base-arm64.tar.gz>`_.
218 Before any DPDK application can be executed, the Frame Manager Configuration
219 Tool (FMC) need to be executed to set the configurations of the queues. This
220 includes the queue state, RSS and other policies.
221 This tool can be obtained from `NXP (Freescale) Public Git Repository <http://git.freescale.com/git/cgit.cgi/ppc/sdk/fmc.git>`_.
222 This tool needs configuration files which are available in the
223 :ref:`DPDK Extra Scripts <extra_scripts>`, described below.
225 As an alternative method, DPAA PMD can also be executed using images provided
226 as part of SDK from NXP. The SDK includes all the above prerequisites necessary
227 to bring up a DPAA board.
229 The following dependencies are not part of DPDK and must be installed
234 NXP Linux software development kit (SDK) includes support for family
235 of QorIQ® ARM-Architecture-based system on chip (SoC) processors
236 and corresponding boards.
238 It includes the Linux board support packages (BSPs) for NXP SoCs,
239 a fully operational tool chain, kernel and board specific modules.
241 SDK and related information can be obtained from: `NXP QorIQ SDK <http://www.nxp.com/products/software-and-tools/run-time-software/linux-sdk/linux-sdk-for-qoriq-processors:SDKLINUX>`_.
246 - **DPDK Extra Scripts**
248 DPAA based resources can be configured easily with the help of ready scripts
249 as provided in the DPDK Extra repository.
251 `DPDK Extras Scripts <https://github.com/qoriq-open-source/dpdk-extras>`_.
253 Currently supported by DPDK:
256 - Supported architectures: **arm64 LE**.
258 - Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>`
259 to setup the basic DPDK environment.
263 Some part of dpaa bus code (qbman and fman - library) routines are
264 dual licensed (BSD & GPLv2).
266 Pre-Installation Configuration
267 ------------------------------
272 The following options can be modified in the ``config`` file.
273 Please note that enabling debugging options may affect system performance.
275 - ``CONFIG_RTE_LIBRTE_DPAA_BUS`` (default ``n``)
277 By default it is enabled only for defconfig_arm64-dpaa-* config.
278 Toggle compilation of the ``librte_bus_dpaa`` driver.
280 - ``CONFIG_RTE_LIBRTE_DPAA_PMD`` (default ``n``)
282 By default it is enabled only for defconfig_arm64-dpaa-* config.
283 Toggle compilation of the ``librte_pmd_dpaa`` driver.
285 - ``CONFIG_RTE_LIBRTE_DPAA_DEBUG_DRIVER`` (default ``n``)
287 Toggles display of bus configurations and enables a debugging queue
288 to fetch error (Rx/Tx) packets to driver. By default, packets with errors
289 (like wrong checksum) are dropped by the hardware.
291 - ``CONFIG_RTE_LIBRTE_DPAA_HWDEBUG`` (default ``n``)
293 Enables debugging of the Queue and Buffer Manager layer which interacts
294 with the DPAA hardware.
296 - ``CONFIG_RTE_MBUF_DEFAULT_MEMPOOL_OPS`` (default ``dpaa``)
298 This is not a DPAA specific configuration - it is a generic RTE config.
299 For optimal performance and hardware utilization, it is expected that DPAA
300 Mempool driver is used for mempools. For that, this configuration needs to
303 Environment Variables
304 ~~~~~~~~~~~~~~~~~~~~~
306 DPAA drivers uses the following environment variables to configure its
307 state during application initialization:
309 - ``DPAA_NUM_RX_QUEUES`` (default 1)
311 This defines the number of Rx queues configured for an application, per
312 port. Hardware would distribute across these many number of queues on Rx
314 In case the application is configured to use lesser number of queues than
315 configured above, it might result in packet loss (because of distribution).
318 Driver compilation and testing
319 ------------------------------
321 Refer to the document :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
326 Follow instructions available in the document
327 :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
332 .. code-block:: console
334 ./arm64-dpaa-linuxapp-gcc/testpmd -c 0xff -n 1 \
335 -- -i --portmask=0x3 --nb-cores=1 --no-flush-rx
338 EAL: Registered [pci] bus.
339 EAL: Registered [dpaa] bus.
340 EAL: Detected 4 lcore(s)
342 EAL: dpaa: Bus scan completed
344 Configuring Port 0 (socket 0)
345 Port 0: 00:00:00:00:00:01
346 Configuring Port 1 (socket 0)
347 Port 1: 00:00:00:00:00:02
349 Checking link statuses...
350 Port 0 Link Up - speed 10000 Mbps - full-duplex
351 Port 1 Link Up - speed 10000 Mbps - full-duplex
361 DPAA drivers for DPDK can only work on NXP SoCs as listed in the
362 ``Supported DPAA SoCs``.
364 Maximum packet length
365 ~~~~~~~~~~~~~~~~~~~~~
367 The DPAA SoC family support a maximum of a 10240 jumbo frame. The value
368 is fixed and cannot be changed. So, even when the ``rxmode.max_rx_pkt_len``
369 member of ``struct rte_eth_conf`` is set to a value lower than 10240, frames
370 up to 10240 bytes can still reach the host interface.
375 Current version of DPAA driver doesn't support multi-process applications
376 where I/O is performed using secondary processes. This feature would be
377 implemented in subsequent versions.