xref: /dpdk/doc/guides/nics/pfe.rst (revision 443b949e17953a1094f80532d600a1ee540f2ba4)
1.. SPDX-License-Identifier: BSD-3-Clause
2   Copyright 2019 NXP
3
4PFE Poll Mode Driver
5======================
6
7The PFE NIC PMD (**librte_net_pfe**) provides poll mode driver
8support for the inbuilt NIC found in the **NXP LS1012** SoC.
9
10More information can be found at `NXP Official Website
11<https://nxp.com/ls1012a>`_.
12
13This section provides an overview of the NXP PFE
14and how it is integrated into the DPDK.
15
16Contents summary
17
18- PFE overview
19- Supported PFE SoCs
20- PFE features
21- Prerequisites
22- Driver compilation and testing
23- Limitations
24
25PFE Overview
26------------
27
28PFE is a hardware programmable packet forwarding engine to provide
29high performance Ethernet interfaces. The diagram below shows a
30system level overview of PFE:
31
32.. code-block:: console
33
34   ====================================================+===============
35   US   +-----------------------------------------+    | Kernel Space
36        |                                         |    |
37        |           PFE Ethernet Driver           |    |
38        +-----------------------------------------+    |
39                  ^   |          ^     |               |
40   PFE         RXQ|   |TXQ    RXQ|     |TXQ            |
41   PMD            |   |          |     |               |
42                  |   v          |     v               |   +----------+
43               +---------+     +----------+            |   | pfe.ko   |
44               | net_pfe0|     | net_pfe1 |            |   +----------+
45               +---------+     +----------+            |
46                  ^   |          ^     |               |
47               TXQ|   |RXQ    TXQ|     |RXQ            |
48                  |   |          |     |               |
49                  |   v          |     v               |
50                 +------------------------+            |
51                 |                        |            |
52                 |      PFE HIF driver    |            |
53                 +------------------------+            |
54                       ^         |                     |
55                    RX |      TX |                     |
56                   RING|     RING|                     |
57                       |         v                     |
58                     +--------------+                  |
59                     |              |                  |
60   ==================|    HIF       |==================+===============
61         +-----------+              +--------------+
62         |           |              |              |        HW
63         |  PFE      +--------------+              |
64         |       +-----+                +-----+    |
65         |       | MAC |                | MAC |    |
66         |       |     |                |     |    |
67         +-------+-----+----------------+-----+----+
68                 | PHY |                | PHY |
69                 +-----+                +-----+
70
71
72The HIF, PFE, MAC and PHY are the hardware blocks, the pfe.ko is a kernel
73module, the PFE HIF driver and the PFE ethernet driver combined represent
74as DPDK PFE poll mode driver are running in the userspace.
75
76The PFE hardware supports one HIF (host interface) RX ring and one TX ring
77to send and receive packets through packet forwarding engine. Both network
78interface traffic is multiplexed and send over HIF queue.
79
80net_pfe0 and net_pfe1 are logical ethernet interfaces, created by HIF client
81driver. HIF driver is responsible for send and receive packets between
82host interface and these logical interfaces. PFE ethernet driver is a
83hardware independent and register with the HIF client driver to transmit and
84receive packets from HIF via logical interfaces.
85
86pfe.ko is required for PHY initialisation and also responsible for creating
87the character device "pfe_us_cdev" which will be used for interacting with
88the kernel layer for link status.
89
90Supported PFE SoCs
91------------------
92
93- LS1012
94
95PFE Features
96------------
97
98- L3/L4 checksum offload
99- Packet type parsing
100- Basic stats
101- MTU update
102- Promiscuous mode
103- Allmulticast mode
104- Link status
105- ARMv8
106
107Prerequisites
108-------------
109
110Below are some pre-requisites for executing PFE PMD on a PFE
111compatible board:
112
113#. **ARM 64 Tool Chain**
114
115   For example, the `*aarch64* Linaro Toolchain <https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-i686_aarch64-linux-gnu.tar.xz>`_.
116
117#. **Linux Kernel**
118
119   It can be obtained from `NXP's Github hosting <https://source.codeaurora.org/external/qoriq/qoriq-components/linux>`_.
120
121#. **Rootfile system**
122
123   Any *aarch64* supporting filesystem can be used. For example,
124   Ubuntu 16.04 LTS (Xenial) or 18.04 (Bionic) userland which can be obtained
125   from `here <http://cdimage.ubuntu.com/ubuntu-base/releases/18.04/release/ubuntu-base-18.04.1-base-arm64.tar.gz>`_.
126
127#. The ethernet device will be registered as virtual device, so pfe has dependency on
128   **rte_bus_vdev** library and it is mandatory to use `--vdev` with value `net_pfe` to
129   run DPDK application.
130
131The following dependencies are not part of DPDK and must be installed
132separately:
133
134- **NXP Linux LSDK**
135
136  NXP Layerscape software development kit (LSDK) includes support for family
137  of QorIQ® ARM-Architecture-based system on chip (SoC) processors
138  and corresponding boards.
139
140  It includes the Linux board support packages (BSPs) for NXP SoCs,
141  a fully operational tool chain, kernel and board specific modules.
142
143  LSDK and related information can be obtained from:  `LSDK <https://www.nxp.com/support/developer-resources/run-time-software/linux-software-and-development-tools/layerscape-software-development-kit:LAYERSCAPE-SDK>`_
144
145- **pfe kernel module**
146
147  pfe kernel module can be obtained from NXP Layerscape software development kit at
148  location `/lib/modules/<kernel version>/kernel/drivers/staging/fsl_ppfe` in rootfs.
149  Module should be loaded using below command:
150
151  .. code-block:: console
152
153     insmod pfe.ko us=1
154
155
156Driver compilation and testing
157------------------------------
158
159Follow instructions available in the document
160:ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
161to launch **testpmd**
162
163Additionally, PFE driver needs `--vdev` as an input with value `net_pfe`
164to execute DPDK application. There is an optional parameter `intf` available
165to specify port ID. PFE driver supports only two interfaces, so valid values
166for `intf` are 0 and 1.
167see the command below:
168
169 .. code-block:: console
170
171    <dpdk app> <EAL args> --vdev="net_pfe0,intf=0" --vdev="net_pfe1,intf=1" -- ...
172
173
174Limitations
175-----------
176
177- Multi buffer pool cannot be supported.
178