1fc0ec740SApeksha Gupta.. SPDX-License-Identifier: BSD-3-Clause 2fc0ec740SApeksha Gupta Copyright 2021 NXP 3fc0ec740SApeksha Gupta 4fc0ec740SApeksha GuptaENETFEC Poll Mode Driver 5fc0ec740SApeksha Gupta======================== 6fc0ec740SApeksha Gupta 7fc0ec740SApeksha GuptaThe ENETFEC NIC PMD (**librte_net_enetfec**) provides poll mode driver 8fc0ec740SApeksha Guptasupport for the inbuilt NIC found in the ** NXP i.MX 8M Mini** SoC. 9fc0ec740SApeksha Gupta 10fc0ec740SApeksha GuptaMore information can be found at NXP Official Website 11fc0ec740SApeksha Gupta<https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i-mx-applications-processors/i-mx-8-processors/i-mx-8m-mini-arm-cortex-a53-cortex-m4-audio-voice-video:i.MX8MMINI> 12fc0ec740SApeksha Gupta 13fc0ec740SApeksha GuptaThis section provides an overview of the NXP ENETFEC 14fc0ec740SApeksha Guptaand how it is integrated into the DPDK. 15fc0ec740SApeksha GuptaDriver is taken as **experimental** 16fc0ec740SApeksha Guptaas driver depends on a Linux kernel module 'enetfec-uio', 17fc0ec740SApeksha Guptawhich is not upstreamed yet. 18fc0ec740SApeksha Gupta 19fc0ec740SApeksha GuptaContents summary 20fc0ec740SApeksha Gupta 21fc0ec740SApeksha Gupta- ENETFEC overview 22fc0ec740SApeksha Gupta- Supported ENETFEC SoCs 23b583b9a1SFerruh Yigit- ENETFEC features 24fc0ec740SApeksha Gupta- Prerequisites 25fc0ec740SApeksha Gupta- Driver compilation and testing 26fc0ec740SApeksha Gupta- Limitations 27fc0ec740SApeksha Gupta 28fc0ec740SApeksha GuptaENETFEC Overview 29fc0ec740SApeksha Gupta---------------- 30fc0ec740SApeksha Gupta 31fc0ec740SApeksha GuptaThe i.MX 8M Mini Media Applications Processor is built 32fc0ec740SApeksha Guptato achieve both high performance and low power consumption. 33fc0ec740SApeksha GuptaENETFEC PMD is a hardware programmable packet forwarding engine 34fc0ec740SApeksha Guptato provide high performance Ethernet interface. 35fc0ec740SApeksha GuptaIt has only 1 GB Ethernet interface with RJ45 connector. 36fc0ec740SApeksha Gupta 37fc0ec740SApeksha GuptaThe diagram below shows a system level overview of ENETFEC: 38fc0ec740SApeksha Gupta 39fc0ec740SApeksha Gupta .. code-block:: console 40fc0ec740SApeksha Gupta 41fc0ec740SApeksha Gupta ===================================================== 42fc0ec740SApeksha Gupta Userspace 43fc0ec740SApeksha Gupta +-----------------------------------------+ 44fc0ec740SApeksha Gupta | ENETFEC Driver | 45fc0ec740SApeksha Gupta | +-------------------------+ | 46fc0ec740SApeksha Gupta | | virtual ethernet device | | 47fc0ec740SApeksha Gupta +-----------------------------------------+ 48fc0ec740SApeksha Gupta ^ | 49fc0ec740SApeksha Gupta | | 50fc0ec740SApeksha Gupta | | 51fc0ec740SApeksha Gupta RXQ | | TXQ 52fc0ec740SApeksha Gupta | | 53fc0ec740SApeksha Gupta | v 54fc0ec740SApeksha Gupta ===================================================== 55fc0ec740SApeksha Gupta Kernel Space 56fc0ec740SApeksha Gupta +---------+ 57fc0ec740SApeksha Gupta | fec-uio | 58fc0ec740SApeksha Gupta ====================+=========+====================== 59fc0ec740SApeksha Gupta Hardware 60fc0ec740SApeksha Gupta +-----------------------------------------+ 61fc0ec740SApeksha Gupta | i.MX 8M MINI EVK | 62fc0ec740SApeksha Gupta | +-----+ | 63fc0ec740SApeksha Gupta | | MAC | | 64fc0ec740SApeksha Gupta +---------------+-----+-------------------+ 65fc0ec740SApeksha Gupta | PHY | 66fc0ec740SApeksha Gupta +-----+ 67fc0ec740SApeksha Gupta 68f8dbaebbSSean MorrisseyENETFEC Ethernet driver is traditional DPDK PMD running in userspace. 69fc0ec740SApeksha Gupta'fec-uio' is the kernel driver. 70fc0ec740SApeksha GuptaThe MAC and PHY are the hardware blocks. 71fc0ec740SApeksha GuptaENETFEC PMD uses standard UIO interface to access kernel 72fc0ec740SApeksha Guptafor PHY initialisation and for mapping the allocated memory 73fc0ec740SApeksha Guptaof register & buffer descriptor with DPDK 74fc0ec740SApeksha Guptawhich gives access to non-cacheable memory for buffer descriptor. 75fc0ec740SApeksha Guptanet_enetfec is logical Ethernet interface, created by ENETFEC driver. 76fc0ec740SApeksha Gupta 77fc0ec740SApeksha Gupta- ENETFEC driver registers the device in virtual device driver. 78fc0ec740SApeksha Gupta- RTE framework scans and will invoke the probe function of ENETFEC driver. 79fc0ec740SApeksha Gupta- The probe function will set the basic device registers and also setups BD rings. 80fc0ec740SApeksha Gupta- On packet Rx the respective BD Ring status bit is set which is then used for 81fc0ec740SApeksha Gupta packet processing. 82fc0ec740SApeksha Gupta- Then Tx is done first followed by Rx via logical interfaces. 83fc0ec740SApeksha Gupta 84b583b9a1SFerruh YigitSupported ENETFEC SoCs 85b583b9a1SFerruh Yigit---------------------- 86b583b9a1SFerruh Yigit 87b583b9a1SFerruh Yigit- i.MX 8M Mini 88b583b9a1SFerruh Yigit 89fc0ec740SApeksha GuptaENETFEC Features 90fc0ec740SApeksha Gupta---------------- 91fc0ec740SApeksha Gupta 92ecae7157SApeksha Gupta- Basic stats 93ecae7157SApeksha Gupta- Promiscuous 94c75b9c3aSApeksha Gupta- VLAN offload 95c75b9c3aSApeksha Gupta- L3/L4 checksum offload 96fc0ec740SApeksha Gupta- Linux 97fc0ec740SApeksha Gupta- ARMv8 98fc0ec740SApeksha Gupta 99fc0ec740SApeksha GuptaPrerequisites 100fc0ec740SApeksha Gupta------------- 101fc0ec740SApeksha Gupta 102fc0ec740SApeksha GuptaThere are three main pre-requisites for executing ENETFEC PMD on a i.MX 8M Mini 103fc0ec740SApeksha Guptacompatible board: 104fc0ec740SApeksha Gupta 105*443b949eSDavid Marchand#. **ARM 64 Tool Chain** 106fc0ec740SApeksha Gupta 107fc0ec740SApeksha Gupta For example, the `*aarch64* Linaro Toolchain 108fc0ec740SApeksha Gupta <https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/aarch64-linux-gnu/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz>`_. 109fc0ec740SApeksha Gupta 110*443b949eSDavid Marchand#. **Linux Kernel** 111fc0ec740SApeksha Gupta 112fc0ec740SApeksha Gupta It can be obtained from `NXP's Github hosting 113fc0ec740SApeksha Gupta <https://source.codeaurora.org/external/qoriq/qoriq-components/linux>`_. 114fc0ec740SApeksha Gupta 115fc0ec740SApeksha Gupta .. note:: 116fc0ec740SApeksha Gupta 117fc0ec740SApeksha Gupta Branch is 'lf-5.10.y' 118fc0ec740SApeksha Gupta 119*443b949eSDavid Marchand#. **Rootfile system** 120fc0ec740SApeksha Gupta 121fc0ec740SApeksha Gupta Any *aarch64* supporting filesystem can be used. 122fc0ec740SApeksha Gupta For example, Ubuntu 18.04 LTS (Bionic) or 20.04 LTS(Focal) userland 123fc0ec740SApeksha Gupta which can be obtained from `here 124fc0ec740SApeksha Gupta <http://cdimage.ubuntu.com/ubuntu-base/releases/18.04/release/ubuntu-base-18.04.1-base-arm64.tar.gz>`_. 125fc0ec740SApeksha Gupta 126*443b949eSDavid Marchand#. The Ethernet device will be registered as virtual device, 127fc0ec740SApeksha Gupta so ENETFEC has dependency on **rte_bus_vdev** library 128fc0ec740SApeksha Gupta and it is mandatory to use `--vdev` with value `net_enetfec` 129fc0ec740SApeksha Gupta to run DPDK application. 130fc0ec740SApeksha Gupta 131fc0ec740SApeksha GuptaDriver compilation and testing 132fc0ec740SApeksha Gupta------------------------------ 133fc0ec740SApeksha Gupta 134fc0ec740SApeksha GuptaFollow instructions available in the document :doc:`build_and_test` 135fc0ec740SApeksha Guptato launch **dpdk-testpmd**. 136fc0ec740SApeksha Gupta 137fc0ec740SApeksha GuptaLimitations 138fc0ec740SApeksha Gupta----------- 139fc0ec740SApeksha Gupta 140fc0ec740SApeksha Gupta- Multi queue is not supported. 141