167fc3ff9SGagandeep Singh.. SPDX-License-Identifier: BSD-3-Clause 267fc3ff9SGagandeep Singh Copyright 2019 NXP 367fc3ff9SGagandeep Singh 467fc3ff9SGagandeep SinghPFE Poll Mode Driver 567fc3ff9SGagandeep Singh====================== 667fc3ff9SGagandeep Singh 78809f78cSBruce RichardsonThe PFE NIC PMD (**librte_net_pfe**) provides poll mode driver 867fc3ff9SGagandeep Singhsupport for the inbuilt NIC found in the **NXP LS1012** SoC. 967fc3ff9SGagandeep Singh 1067fc3ff9SGagandeep SinghMore information can be found at `NXP Official Website 1167fc3ff9SGagandeep Singh<https://nxp.com/ls1012a>`_. 1267fc3ff9SGagandeep Singh 1367fc3ff9SGagandeep SinghThis section provides an overview of the NXP PFE 1467fc3ff9SGagandeep Singhand how it is integrated into the DPDK. 1567fc3ff9SGagandeep Singh 1667fc3ff9SGagandeep SinghContents summary 1767fc3ff9SGagandeep Singh 1867fc3ff9SGagandeep Singh- PFE overview 1967fc3ff9SGagandeep Singh- Supported PFE SoCs 20b583b9a1SFerruh Yigit- PFE features 2167fc3ff9SGagandeep Singh- Prerequisites 2267fc3ff9SGagandeep Singh- Driver compilation and testing 2367fc3ff9SGagandeep Singh- Limitations 2467fc3ff9SGagandeep Singh 2567fc3ff9SGagandeep SinghPFE Overview 26b583b9a1SFerruh Yigit------------ 2767fc3ff9SGagandeep Singh 2867fc3ff9SGagandeep SinghPFE is a hardware programmable packet forwarding engine to provide 2967fc3ff9SGagandeep Singhhigh performance Ethernet interfaces. The diagram below shows a 3067fc3ff9SGagandeep Singhsystem level overview of PFE: 3167fc3ff9SGagandeep Singh 3267fc3ff9SGagandeep Singh.. code-block:: console 3367fc3ff9SGagandeep Singh 3467fc3ff9SGagandeep Singh ====================================================+=============== 3567fc3ff9SGagandeep Singh US +-----------------------------------------+ | Kernel Space 3667fc3ff9SGagandeep Singh | | | 3767fc3ff9SGagandeep Singh | PFE Ethernet Driver | | 3867fc3ff9SGagandeep Singh +-----------------------------------------+ | 3967fc3ff9SGagandeep Singh ^ | ^ | | 4067fc3ff9SGagandeep Singh PFE RXQ| |TXQ RXQ| |TXQ | 4167fc3ff9SGagandeep Singh PMD | | | | | 4267fc3ff9SGagandeep Singh | v | v | +----------+ 4367fc3ff9SGagandeep Singh +---------+ +----------+ | | pfe.ko | 4467fc3ff9SGagandeep Singh | net_pfe0| | net_pfe1 | | +----------+ 4567fc3ff9SGagandeep Singh +---------+ +----------+ | 4667fc3ff9SGagandeep Singh ^ | ^ | | 4767fc3ff9SGagandeep Singh TXQ| |RXQ TXQ| |RXQ | 4867fc3ff9SGagandeep Singh | | | | | 4967fc3ff9SGagandeep Singh | v | v | 5067fc3ff9SGagandeep Singh +------------------------+ | 5167fc3ff9SGagandeep Singh | | | 5267fc3ff9SGagandeep Singh | PFE HIF driver | | 5367fc3ff9SGagandeep Singh +------------------------+ | 5467fc3ff9SGagandeep Singh ^ | | 5567fc3ff9SGagandeep Singh RX | TX | | 5667fc3ff9SGagandeep Singh RING| RING| | 5767fc3ff9SGagandeep Singh | v | 5867fc3ff9SGagandeep Singh +--------------+ | 5967fc3ff9SGagandeep Singh | | | 6067fc3ff9SGagandeep Singh ==================| HIF |==================+=============== 6167fc3ff9SGagandeep Singh +-----------+ +--------------+ 6267fc3ff9SGagandeep Singh | | | | HW 6367fc3ff9SGagandeep Singh | PFE +--------------+ | 6467fc3ff9SGagandeep Singh | +-----+ +-----+ | 6567fc3ff9SGagandeep Singh | | MAC | | MAC | | 6667fc3ff9SGagandeep Singh | | | | | | 6767fc3ff9SGagandeep Singh +-------+-----+----------------+-----+----+ 6867fc3ff9SGagandeep Singh | PHY | | PHY | 6967fc3ff9SGagandeep Singh +-----+ +-----+ 7067fc3ff9SGagandeep Singh 7167fc3ff9SGagandeep Singh 7267fc3ff9SGagandeep SinghThe HIF, PFE, MAC and PHY are the hardware blocks, the pfe.ko is a kernel 7367fc3ff9SGagandeep Singhmodule, the PFE HIF driver and the PFE ethernet driver combined represent 7467fc3ff9SGagandeep Singhas DPDK PFE poll mode driver are running in the userspace. 7567fc3ff9SGagandeep Singh 7667fc3ff9SGagandeep SinghThe PFE hardware supports one HIF (host interface) RX ring and one TX ring 7767fc3ff9SGagandeep Singhto send and receive packets through packet forwarding engine. Both network 7867fc3ff9SGagandeep Singhinterface traffic is multiplexed and send over HIF queue. 7967fc3ff9SGagandeep Singh 8067fc3ff9SGagandeep Singhnet_pfe0 and net_pfe1 are logical ethernet interfaces, created by HIF client 8167fc3ff9SGagandeep Singhdriver. HIF driver is responsible for send and receive packets between 8267fc3ff9SGagandeep Singhhost interface and these logical interfaces. PFE ethernet driver is a 8367fc3ff9SGagandeep Singhhardware independent and register with the HIF client driver to transmit and 8467fc3ff9SGagandeep Singhreceive packets from HIF via logical interfaces. 8567fc3ff9SGagandeep Singh 8667fc3ff9SGagandeep Singhpfe.ko is required for PHY initialisation and also responsible for creating 8767fc3ff9SGagandeep Singhthe character device "pfe_us_cdev" which will be used for interacting with 8867fc3ff9SGagandeep Singhthe kernel layer for link status. 8967fc3ff9SGagandeep Singh 90b583b9a1SFerruh YigitSupported PFE SoCs 91b583b9a1SFerruh Yigit------------------ 92b583b9a1SFerruh Yigit 93b583b9a1SFerruh Yigit- LS1012 94b583b9a1SFerruh Yigit 9567fc3ff9SGagandeep SinghPFE Features 96b583b9a1SFerruh Yigit------------ 9767fc3ff9SGagandeep Singh 98592041a0SGagandeep Singh- L3/L4 checksum offload 99659b494dSGagandeep Singh- Packet type parsing 100659b494dSGagandeep Singh- Basic stats 101320ae324SGagandeep Singh- MTU update 102ff64beabSGagandeep Singh- Promiscuous mode 103ff64beabSGagandeep Singh- Allmulticast mode 104acd4818eSGagandeep Singh- Link status 10567fc3ff9SGagandeep Singh- ARMv8 10667fc3ff9SGagandeep Singh 10767fc3ff9SGagandeep SinghPrerequisites 108b583b9a1SFerruh Yigit------------- 10967fc3ff9SGagandeep Singh 11067fc3ff9SGagandeep SinghBelow are some pre-requisites for executing PFE PMD on a PFE 11167fc3ff9SGagandeep Singhcompatible board: 11267fc3ff9SGagandeep Singh 113*443b949eSDavid Marchand#. **ARM 64 Tool Chain** 11467fc3ff9SGagandeep Singh 11567fc3ff9SGagandeep Singh 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>`_. 11667fc3ff9SGagandeep Singh 117*443b949eSDavid Marchand#. **Linux Kernel** 11867fc3ff9SGagandeep Singh 11967fc3ff9SGagandeep Singh It can be obtained from `NXP's Github hosting <https://source.codeaurora.org/external/qoriq/qoriq-components/linux>`_. 12067fc3ff9SGagandeep Singh 121*443b949eSDavid Marchand#. **Rootfile system** 12267fc3ff9SGagandeep Singh 12367fc3ff9SGagandeep Singh Any *aarch64* supporting filesystem can be used. For example, 12467fc3ff9SGagandeep Singh Ubuntu 16.04 LTS (Xenial) or 18.04 (Bionic) userland which can be obtained 12567fc3ff9SGagandeep Singh from `here <http://cdimage.ubuntu.com/ubuntu-base/releases/18.04/release/ubuntu-base-18.04.1-base-arm64.tar.gz>`_. 12667fc3ff9SGagandeep Singh 127*443b949eSDavid Marchand#. The ethernet device will be registered as virtual device, so pfe has dependency on 12867fc3ff9SGagandeep Singh **rte_bus_vdev** library and it is mandatory to use `--vdev` with value `net_pfe` to 12967fc3ff9SGagandeep Singh run DPDK application. 13067fc3ff9SGagandeep Singh 13167fc3ff9SGagandeep SinghThe following dependencies are not part of DPDK and must be installed 13267fc3ff9SGagandeep Singhseparately: 13367fc3ff9SGagandeep Singh 13467fc3ff9SGagandeep Singh- **NXP Linux LSDK** 13567fc3ff9SGagandeep Singh 13667fc3ff9SGagandeep Singh NXP Layerscape software development kit (LSDK) includes support for family 13767fc3ff9SGagandeep Singh of QorIQ® ARM-Architecture-based system on chip (SoC) processors 13867fc3ff9SGagandeep Singh and corresponding boards. 13967fc3ff9SGagandeep Singh 14067fc3ff9SGagandeep Singh It includes the Linux board support packages (BSPs) for NXP SoCs, 14167fc3ff9SGagandeep Singh a fully operational tool chain, kernel and board specific modules. 14267fc3ff9SGagandeep Singh 14367fc3ff9SGagandeep Singh 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>`_ 14467fc3ff9SGagandeep Singh 14567fc3ff9SGagandeep Singh- **pfe kernel module** 14667fc3ff9SGagandeep Singh 14767fc3ff9SGagandeep Singh pfe kernel module can be obtained from NXP Layerscape software development kit at 14867fc3ff9SGagandeep Singh location `/lib/modules/<kernel version>/kernel/drivers/staging/fsl_ppfe` in rootfs. 14967fc3ff9SGagandeep Singh Module should be loaded using below command: 15067fc3ff9SGagandeep Singh 15167fc3ff9SGagandeep Singh .. code-block:: console 15267fc3ff9SGagandeep Singh 15367fc3ff9SGagandeep Singh insmod pfe.ko us=1 15467fc3ff9SGagandeep Singh 15567fc3ff9SGagandeep Singh 15667fc3ff9SGagandeep SinghDriver compilation and testing 157b583b9a1SFerruh Yigit------------------------------ 15867fc3ff9SGagandeep Singh 15967fc3ff9SGagandeep SinghFollow instructions available in the document 16067fc3ff9SGagandeep Singh:ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>` 16167fc3ff9SGagandeep Singhto launch **testpmd** 16267fc3ff9SGagandeep Singh 16367fc3ff9SGagandeep SinghAdditionally, PFE driver needs `--vdev` as an input with value `net_pfe` 16467fc3ff9SGagandeep Singhto execute DPDK application. There is an optional parameter `intf` available 16567fc3ff9SGagandeep Singhto specify port ID. PFE driver supports only two interfaces, so valid values 16667fc3ff9SGagandeep Singhfor `intf` are 0 and 1. 16767fc3ff9SGagandeep Singhsee the command below: 16867fc3ff9SGagandeep Singh 16967fc3ff9SGagandeep Singh .. code-block:: console 17067fc3ff9SGagandeep Singh 17167fc3ff9SGagandeep Singh <dpdk app> <EAL args> --vdev="net_pfe0,intf=0" --vdev="net_pfe1,intf=1" -- ... 17267fc3ff9SGagandeep Singh 17367fc3ff9SGagandeep Singh 17467fc3ff9SGagandeep SinghLimitations 175b583b9a1SFerruh Yigit----------- 17667fc3ff9SGagandeep Singh 17767fc3ff9SGagandeep Singh- Multi buffer pool cannot be supported. 178