get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/97837/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 97837,
    "url": "http://patches.dpdk.org/api/patches/97837/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210902175955.9202-2-apeksha.gupta@nxp.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210902175955.9202-2-apeksha.gupta@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210902175955.9202-2-apeksha.gupta@nxp.com",
    "date": "2021-09-02T17:59:51",
    "name": "[v2,1/5] net/enetfec: introduce NXP ENETFEC driver",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "aec59ca214e414589bbf425a9d5c27fcc1ddc937",
    "submitter": {
        "id": 1570,
        "url": "http://patches.dpdk.org/api/people/1570/?format=api",
        "name": "Apeksha Gupta",
        "email": "apeksha.gupta@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210902175955.9202-2-apeksha.gupta@nxp.com/mbox/",
    "series": [
        {
            "id": 18636,
            "url": "http://patches.dpdk.org/api/series/18636/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=18636",
            "date": "2021-09-02T17:59:50",
            "name": "drivers/net: add NXP ENETFEC driver",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/18636/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/97837/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/97837/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B0D7BA0C4C;\n\tThu,  2 Sep 2021 20:01:01 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 990594003E;\n\tThu,  2 Sep 2021 20:01:01 +0200 (CEST)",
            "from inva020.nxp.com (inva020.nxp.com [92.121.34.13])\n by mails.dpdk.org (Postfix) with ESMTP id D5D1B4003C\n for <dev@dpdk.org>; Thu,  2 Sep 2021 20:00:59 +0200 (CEST)",
            "from inva020.nxp.com (localhost [127.0.0.1])\n by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A84C21A1F28;\n Thu,  2 Sep 2021 20:00:59 +0200 (CEST)",
            "from aprdc01srsp001v.ap-rdc01.nxp.com\n (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16])\n by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 43A251A1F22;\n Thu,  2 Sep 2021 20:00:59 +0200 (CEST)",
            "from lsv03186.swis.in-blr01.nxp.com (lsv03186.swis.in-blr01.nxp.com\n [92.120.146.182])\n by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 4685A183AC8B;\n Fri,  3 Sep 2021 02:00:58 +0800 (+08)"
        ],
        "From": "Apeksha Gupta <apeksha.gupta@nxp.com>",
        "To": "andrew.rybchenko@oktetlabs.ru,\n\tferruh.yigit@intel.com",
        "Cc": "dev@dpdk.org, hemant.agrawal@nxp.com, sachin.saxena@nxp.com,\n Apeksha Gupta <apeksha.gupta@nxp.com>",
        "Date": "Thu,  2 Sep 2021 23:29:51 +0530",
        "Message-Id": "<20210902175955.9202-2-apeksha.gupta@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20210902175955.9202-1-apeksha.gupta@nxp.com>",
        "References": "<20210902175955.9202-1-apeksha.gupta@nxp.com>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "Subject": "[dpdk-dev] [PATCH v2 1/5] net/enetfec: introduce NXP ENETFEC driver",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "ENETFEC (Fast Ethernet Controller) is a network poll mode driver\nfor NXP SoC i.MX 8M Mini.\n\nThis patch adds skeleton for enetfec driver with probe function.\n\nSigned-off-by: Sachin Saxena <sachin.saxena@nxp.com>\nSigned-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>\n---\n doc/guides/nics/enetfec.rst          | 121 ++++++++++++++++++++\n doc/guides/nics/features/enetfec.ini |   8 ++\n doc/guides/nics/index.rst            |   1 +\n drivers/net/enetfec/enet_ethdev.c    |  95 ++++++++++++++++\n drivers/net/enetfec/enet_ethdev.h    | 160 +++++++++++++++++++++++++++\n drivers/net/enetfec/enet_pmd_logs.h  |  31 ++++++\n drivers/net/enetfec/meson.build      |  15 +++\n drivers/net/enetfec/version.map      |   3 +\n drivers/net/meson.build              |   1 +\n 9 files changed, 435 insertions(+)\n create mode 100644 doc/guides/nics/enetfec.rst\n create mode 100644 doc/guides/nics/features/enetfec.ini\n create mode 100644 drivers/net/enetfec/enet_ethdev.c\n create mode 100644 drivers/net/enetfec/enet_ethdev.h\n create mode 100644 drivers/net/enetfec/enet_pmd_logs.h\n create mode 100644 drivers/net/enetfec/meson.build\n create mode 100644 drivers/net/enetfec/version.map",
    "diff": "diff --git a/doc/guides/nics/enetfec.rst b/doc/guides/nics/enetfec.rst\nnew file mode 100644\nindex 0000000000..f151bb26c4\n--- /dev/null\n+++ b/doc/guides/nics/enetfec.rst\n@@ -0,0 +1,121 @@\n+.. SPDX-License-Identifier: BSD-3-Clause\n+   Copyright 2021 NXP\n+\n+ENETFEC Poll Mode Driver\n+========================\n+\n+The ENETFEC NIC PMD (**librte_net_enetfec**) provides poll mode driver\n+support for the inbuilt NIC found in the ** NXP i.MX 8M Mini** SoC.\n+\n+More information can be found at NXP Official Website\n+<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>\n+\n+ENETFEC\n+-------\n+\n+This section provides an overview of the NXP ENETFEC and how it is\n+integrated into the DPDK.\n+\n+Contents summary\n+\n+- ENETFEC overview\n+- ENETFEC features\n+- Supported ENETFEC SoCs\n+- Prerequisites\n+- Driver compilation and testing\n+- Limitations\n+\n+ENETFEC Overview\n+~~~~~~~~~~~~~~~~\n+The i.MX 8M Mini Media Applications Processor is built to achieve both high\n+performance and low power consumption. ENETFEC is a hardware programmable\n+packet forwarding engine to provide high performance Ethernet interface.\n+The diagram below shows a system level overview of ENETFEC:\n+\n+   ====================================================+===============\n+   US   +-----------------------------------------+    | Kernel Space\n+        |                                         |    |\n+        |              ENETFEC Driver             |    |\n+        +-----------------------------------------+    |\n+                          ^   |                        |\n+   ENETFEC            RXQ |   | TXQ\t\t       |\n+   PMD                    |   |         \t       |\n+                          |   v      \t\t       |   +----------+\n+                     +-------------+                   |   | fec-uio  |\n+                     | net_enetfec |                   |   +----------+\n+                     +-------------+                   |\n+                          ^   |                        |\n+                      TXQ |   | RXQ                    |\n+                          |   |                        |\n+                          |   v                        |\n+    ===================================================+===============\n+         +----------------------------------------+\n+         |                                        |        HW\n+         |  i.MX 8M MINI EVK                      |\n+         |               +-----+                  |\n+         |               | MAC |                  |\n+         +---------------+-----+------------------+\n+\t\t\t | PHY |\n+\t\t\t +-----+\n+\n+ENETFEC Ethernet driver is traditional DPDK PMD driver running in the userspace.\n+The MAC and PHY are the hardware blocks. 'fec-uio' is the UIO driver, ENETFEC PMD\n+uses UIO interface to interact with kernel for PHY initialisation and for mapping\n+the allocated memory of register & BD in kernel with DPDK which gives access to\n+non-cacheable memory for BD. net_enetfec is logical Ethernet interface, created by\n+ENETFEC driver.\n+\n+- ENETFEC driver registers the device in virtual device driver.\n+- RTE framework scans and will invoke the probe function of ENETFEC driver.\n+- The probe function will set the basic device registers and also setups BD rings.\n+- On packet Rx the respective BD Ring status bit is set which is then used for\n+  packet processing.\n+- Then Tx is done first followed by Rx via logical interfaces.\n+\n+ENETFEC Features\n+~~~~~~~~~~~~~~~~~\n+\n+- ARMv8\n+\n+Supported ENETFEC SoCs\n+~~~~~~~~~~~~~~~~~~~~~~\n+\n+- i.MX 8M Mini\n+\n+Prerequisites\n+~~~~~~~~~~~~~\n+\n+There are three main pre-requisites for executing ENETFEC PMD on a i.MX 8M Mini\n+compatible board:\n+\n+1. **ARM 64 Tool Chain**\n+\n+   For example, the `*aarch64* Linaro Toolchain <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>`_.\n+\n+2. **Linux Kernel**\n+\n+  It can be obtained from `NXP's Github hosting <https://source.codeaurora.org/external/qoriq/qoriq-components/linux>`_.\n+\n+3. **Rootfile system**\n+\n+   Any *aarch64* supporting filesystem can be used. For example,\n+   Ubuntu 18.04 LTS (Bionic) or 20.04 LTS(Focal) userland which can be obtained\n+   from `here <http://cdimage.ubuntu.com/ubuntu-base/releases/18.04/release/ubuntu-base-18.04.1-base-arm64.tar.gz>`_.\n+\n+4. The Ethernet device will be registered as virtual device, so ENETFEC has dependency on\n+   **rte_bus_vdev** library and it is mandatory to use `--vdev` with value `net_enetfec` to\n+   run DPDK application.\n+\n+Driver compilation and testing\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+Follow instructions available in the document\n+:ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`\n+to launch **testpmd**\n+\n+Limitations\n+~~~~~~~~~~~\n+\n+- Multi queue is not supported.\n+- Link status is down always.\n+- Single Ethernet interface.\ndiff --git a/doc/guides/nics/features/enetfec.ini b/doc/guides/nics/features/enetfec.ini\nnew file mode 100644\nindex 0000000000..5700697981\n--- /dev/null\n+++ b/doc/guides/nics/features/enetfec.ini\n@@ -0,0 +1,8 @@\n+;\n+; Supported features of the 'enetfec' network poll mode driver.\n+;\n+; Refer to default.ini for the full list of available PMD features.\n+;\n+[Features]\n+ARMv8                = Y\n+Usage doc            = Y\ndiff --git a/doc/guides/nics/index.rst b/doc/guides/nics/index.rst\nindex 784d5d39f6..777fdab4a0 100644\n--- a/doc/guides/nics/index.rst\n+++ b/doc/guides/nics/index.rst\n@@ -26,6 +26,7 @@ Network Interface Controller Drivers\n     e1000em\n     ena\n     enetc\n+    enetfec\n     enic\n     fm10k\n     hinic\ndiff --git a/drivers/net/enetfec/enet_ethdev.c b/drivers/net/enetfec/enet_ethdev.c\nnew file mode 100644\nindex 0000000000..88774788cf\n--- /dev/null\n+++ b/drivers/net/enetfec/enet_ethdev.c\n@@ -0,0 +1,95 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020-2021 NXP\n+ */\n+\n+#include <stdio.h>\n+#include <fcntl.h>\n+#include <stdlib.h>\n+#include <unistd.h>\n+#include <errno.h>\n+#include <rte_kvargs.h>\n+#include <ethdev_vdev.h>\n+#include <rte_bus_vdev.h>\n+#include <rte_dev.h>\n+#include <rte_ether.h>\n+#include \"enet_ethdev.h\"\n+#include \"enet_pmd_logs.h\"\n+\n+#define ENETFEC_NAME_PMD                net_enetfec\n+#define ENETFEC_VDEV_GEM_ID_ARG         \"intf\"\n+#define ENETFEC_CDEV_INVALID_FD         -1\n+\n+int enetfec_logtype_pmd;\n+\n+static int\n+enetfec_eth_init(struct rte_eth_dev *dev)\n+{\n+\trte_eth_dev_probing_finish(dev);\n+\treturn 0;\n+}\n+\n+static int\n+pmd_enetfec_probe(struct rte_vdev_device *vdev)\n+{\n+\tstruct rte_eth_dev *dev = NULL;\n+\tstruct enetfec_private *fep;\n+\tconst char *name;\n+\tint rc;\n+\n+\tname = rte_vdev_device_name(vdev);\n+\tif (name == NULL)\n+\t\treturn -EINVAL;\n+\tENETFEC_PMD_LOG(INFO, \"Initializing pmd_fec for %s\", name);\n+\n+\tdev = rte_eth_vdev_allocate(vdev, sizeof(*fep));\n+\tif (dev == NULL)\n+\t\treturn -ENOMEM;\n+\n+\t/* setup board info structure */\n+\tfep = dev->data->dev_private;\n+\tfep->dev = dev;\n+\trc = enetfec_eth_init(dev);\n+\tif (rc)\n+\t\tgoto failed_init;\n+\n+\treturn 0;\n+\n+failed_init:\n+\tENETFEC_PMD_ERR(\"Failed to init\");\n+\treturn rc;\n+}\n+\n+static int\n+pmd_enetfec_remove(struct rte_vdev_device *vdev)\n+{\n+\tstruct rte_eth_dev *eth_dev = NULL;\n+\tint ret;\n+\n+\t/* find the ethdev entry */\n+\teth_dev = rte_eth_dev_allocated(rte_vdev_device_name(vdev));\n+\tif (eth_dev == NULL)\n+\t\treturn -ENODEV;\n+\n+\tret = rte_eth_dev_release_port(eth_dev);\n+\tif (ret != 0)\n+\t\treturn -EINVAL;\n+\n+\tENETFEC_PMD_INFO(\"Closing sw device\");\n+\treturn 0;\n+}\n+\n+static struct rte_vdev_driver pmd_enetfec_drv = {\n+\t.probe = pmd_enetfec_probe,\n+\t.remove = pmd_enetfec_remove,\n+};\n+\n+RTE_PMD_REGISTER_VDEV(ENETFEC_NAME_PMD, pmd_enetfec_drv);\n+RTE_PMD_REGISTER_PARAM_STRING(ENETFEC_NAME_PMD, ENETFEC_VDEV_GEM_ID_ARG \"=<int>\");\n+\n+RTE_INIT(enetfec_pmd_init_log)\n+{\n+\tint ret;\n+\tret = rte_log_register_type_and_pick_level(ENETFEC_LOGTYPE_PREFIX \"driver\",\n+\t\t\t\t\t\t   RTE_LOG_NOTICE);\n+\tenetfec_logtype_pmd = (ret < 0) ? RTE_LOGTYPE_PMD : ret;\n+}\ndiff --git a/drivers/net/enetfec/enet_ethdev.h b/drivers/net/enetfec/enet_ethdev.h\nnew file mode 100644\nindex 0000000000..8c61176fb5\n--- /dev/null\n+++ b/drivers/net/enetfec/enet_ethdev.h\n@@ -0,0 +1,160 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020-2021 NXP\n+ */\n+\n+#ifndef __ENETFEC_ETHDEV_H__\n+#define __ENETFEC_ETHDEV_H__\n+\n+#include <compat.h>\n+#include <rte_ethdev.h>\n+\n+/* Common log type name prefix */\n+#define ENETFEC_LOGTYPE_PREFIX\t\"pmd.net.enetfec.\"\n+\n+/*\n+ * ENETFEC with AVB IP can support maximum 3 rx and tx queues.\n+ */\n+#define ENETFEC_MAX_Q\t\t3\n+\n+#define BD_LEN\t\t\t49152\n+#define ENETFEC_TX_FR_SIZE\t2048\n+#define MAX_TX_BD_RING_SIZE\t512\t/* It should be power of 2 */\n+#define MAX_RX_BD_RING_SIZE\t512\n+\n+/* full duplex or half duplex */\n+#define HALF_DUPLEX             0x00\n+#define FULL_DUPLEX             0x01\n+#define UNKNOWN_DUPLEX          0xff\n+\n+#define PKT_MAX_BUF_SIZE        1984\n+#define OPT_FRAME_SIZE\t\t(PKT_MAX_BUF_SIZE << 16)\n+#define ETH_ALEN\t\tRTE_ETHER_ADDR_LEN\n+#define ETH_HLEN\t\tRTE_ETHER_HDR_LEN\n+#define VLAN_HLEN\t\t4\n+\n+struct bufdesc {\n+\tuint16_t\t\tbd_datlen;  /* buffer data length */\n+\tuint16_t\t\tbd_sc;\t    /* buffer control & status */\n+\tuint32_t\t\tbd_bufaddr; /* buffer address */\n+};\n+\n+struct bufdesc_ex {\n+\tstruct\t\t\tbufdesc desc;\n+\tuint32_t\t\tbd_esc;\n+\tuint32_t\t\tbd_prot;\n+\tuint32_t\t\tbd_bdu;\n+\tuint32_t\t\tts;\n+\tuint16_t\t\tres0[4];\n+};\n+\n+struct bufdesc_prop {\n+\tint\t\t\tque_id;\n+\t/* Addresses of Tx and Rx buffers */\n+\tstruct bufdesc\t\t*base;\n+\tstruct bufdesc\t\t*last;\n+\tstruct bufdesc\t\t*cur;\n+\tvoid __iomem\t\t*active_reg_desc;\n+\tuint64_t\t\tdescr_baseaddr_p;\n+\tunsigned short\t\tring_size;\n+\tunsigned char\t\td_size;\n+\tunsigned char\t\td_size_log2;\n+};\n+\n+struct enetfec_priv_tx_q {\n+\tstruct bufdesc_prop\tbd;\n+\tstruct rte_mbuf\t\t*tx_mbuf[MAX_TX_BD_RING_SIZE];\n+\tstruct bufdesc\t\t*dirty_tx;\n+\tstruct rte_mempool\t*pool;\n+\tstruct enetfec_private\t*fep;\n+};\n+\n+struct enetfec_priv_rx_q {\n+\tstruct bufdesc_prop\tbd;\n+\tstruct rte_mbuf\t\t*rx_mbuf[MAX_RX_BD_RING_SIZE];\n+\tstruct rte_mempool\t*pool;\n+\tstruct enetfec_private\t*fep;\n+};\n+\n+/* Buffer descriptors of FEC are used to track the ring buffers. Buffer\n+ * descriptor base is x_bd_base. Currently available buffer are x_cur\n+ * and x_cur. where x is rx or tx. Current buffer is tracked by dirty_tx\n+ * that is sent by the controller.\n+ * The tx_cur and dirty_tx are same in completely full and empty\n+ * conditions. Actual condition is determined by empty & ready bits.\n+ */\n+struct enetfec_private {\n+\tstruct rte_eth_dev\t*dev;\n+\tstruct rte_eth_stats\tstats;\n+\tstruct rte_mempool\t*pool;\n+\tuint16_t\t\tmax_rx_queues;\n+\tuint16_t\t\tmax_tx_queues;\n+\tunsigned int\t\ttotal_tx_ring_size;\n+\tunsigned int\t\ttotal_rx_ring_size;\n+\tbool\t\t\tbufdesc_ex;\n+\tunsigned int\t\ttx_align;\n+\tunsigned int\t\trx_align;\n+\tint\t\t\tfull_duplex;\n+\tunsigned int\t\tphy_speed;\n+\tu_int32_t\t\tquirks;\n+\tint\t\t\tflag_csum;\n+\tint\t\t\tflag_pause;\n+\tint\t\t\tflag_wol;\n+\tbool\t\t\trgmii_txc_delay;\n+\tbool\t\t\trgmii_rxc_delay;\n+\tint\t\t\tlink;\n+\tvoid\t\t\t*hw_baseaddr_v;\n+\tuint64_t\t\thw_baseaddr_p;\n+\tvoid\t\t\t*bd_addr_v;\n+\tuint64_t\t\tbd_addr_p;\n+\tuint64_t\t\tbd_addr_p_r[ENETFEC_MAX_Q];\n+\tuint64_t\t\tbd_addr_p_t[ENETFEC_MAX_Q];\n+\tvoid\t\t\t*dma_baseaddr_r[ENETFEC_MAX_Q];\n+\tvoid\t\t\t*dma_baseaddr_t[ENETFEC_MAX_Q];\n+\tuint64_t\t\tcbus_size;\n+\tunsigned int\t\treg_size;\n+\tunsigned int\t\tbd_size;\n+\tint\t\t\thw_ts_rx_en;\n+\tint\t\t\thw_ts_tx_en;\n+\tstruct enetfec_priv_rx_q *rx_queues[ENETFEC_MAX_Q];\n+\tstruct enetfec_priv_tx_q *tx_queues[ENETFEC_MAX_Q];\n+};\n+\n+#define writel(v, p) ({*(volatile unsigned int *)(p) = (v); })\n+#define readl(p) rte_read32(p)\n+\n+static inline struct\n+bufdesc *enet_get_nextdesc(struct bufdesc *bdp, struct bufdesc_prop *bd)\n+{\n+\treturn (bdp >= bd->last) ? bd->base\n+\t\t\t: (struct bufdesc *)(((void *)bdp) + bd->d_size);\n+}\n+\n+static inline struct\n+bufdesc *enet_get_prevdesc(struct bufdesc *bdp, struct bufdesc_prop *bd)\n+{\n+\treturn (bdp <= bd->base) ? bd->last\n+\t\t\t: (struct bufdesc *)(((void *)bdp) - bd->d_size);\n+}\n+\n+static inline int\n+enet_get_bd_index(struct bufdesc *bdp, struct bufdesc_prop *bd)\n+{\n+\treturn ((const char *)bdp - (const char *)bd->base) >> bd->d_size_log2;\n+}\n+\n+static inline int\n+fls64(unsigned long word)\n+{\n+\treturn (64 - __builtin_clzl(word)) - 1;\n+}\n+\n+uint16_t enetfec_recv_pkts(void *rxq1, __rte_unused struct rte_mbuf **rx_pkts,\n+\t\tuint16_t nb_pkts);\n+uint16_t enetfec_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n+\t\tuint16_t nb_pkts);\n+struct bufdesc *enet_get_nextdesc(struct bufdesc *bdp,\n+\t\tstruct bufdesc_prop *bd);\n+int enet_new_rxbdp(struct enetfec_private *fep, struct bufdesc *bdp,\n+\t\tstruct rte_mbuf *mbuf);\n+\n+#endif /*__ENETFEC_ETHDEV_H__*/\ndiff --git a/drivers/net/enetfec/enet_pmd_logs.h b/drivers/net/enetfec/enet_pmd_logs.h\nnew file mode 100644\nindex 0000000000..e7b3964a0e\n--- /dev/null\n+++ b/drivers/net/enetfec/enet_pmd_logs.h\n@@ -0,0 +1,31 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020-2021 NXP\n+ */\n+\n+#ifndef _ENETFEC_LOGS_H_\n+#define _ENETFEC_LOGS_H_\n+\n+extern int enetfec_logtype_pmd;\n+\n+/* PMD related logs */\n+#define ENETFEC_PMD_LOG(level, fmt, args...) \\\n+\trte_log(RTE_LOG_ ## level, enetfec_logtype_pmd, \"\\nfec_net: %s()\" \\\n+\t\tfmt \"\\n\", __func__, ##args)\n+\n+#define PMD_INIT_FUNC_TRACE() ENET_PMD_LOG(DEBUG, \" >>\")\n+\n+#define ENETFEC_PMD_DEBUG(fmt, args...) \\\n+\tENETFEC_PMD_LOG(DEBUG, fmt, ## args)\n+#define ENETFEC_PMD_ERR(fmt, args...) \\\n+\tENETFEC_PMD_LOG(ERR, fmt, ## args)\n+#define ENETFEC_PMD_INFO(fmt, args...) \\\n+\tENETFEC_PMD_LOG(INFO, fmt, ## args)\n+\n+#define ENETFEC_PMD_WARN(fmt, args...) \\\n+\tENETFEC_PMD_LOG(WARNING, fmt, ## args)\n+\n+/* DP Logs, toggled out at compile time if level lower than current level */\n+#define ENETFEC_DP_LOG(level, fmt, args...) \\\n+\tRTE_LOG_DP(level, PMD, fmt, ## args)\n+\n+#endif /* _ENETFEC_LOGS_H_ */\ndiff --git a/drivers/net/enetfec/meson.build b/drivers/net/enetfec/meson.build\nnew file mode 100644\nindex 0000000000..252bf83309\n--- /dev/null\n+++ b/drivers/net/enetfec/meson.build\n@@ -0,0 +1,15 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright 2021 NXP\n+\n+if not is_linux\n+\tbuild = false\n+\treason = 'only supported on linux'\n+endif\n+\n+deps += ['common_dpaax']\n+\n+sources = files('enet_ethdev.c')\n+\n+if cc.has_argument('-Wno-pointer-arith')\n+\tcflags += '-Wno-pointer-arith'\n+endif\ndiff --git a/drivers/net/enetfec/version.map b/drivers/net/enetfec/version.map\nnew file mode 100644\nindex 0000000000..170c04fe53\n--- /dev/null\n+++ b/drivers/net/enetfec/version.map\n@@ -0,0 +1,3 @@\n+DPDK_20.0 {\n+        local: *;\n+};\ndiff --git a/drivers/net/meson.build b/drivers/net/meson.build\nindex bcf488f203..92f433d5e8 100644\n--- a/drivers/net/meson.build\n+++ b/drivers/net/meson.build\n@@ -19,6 +19,7 @@ drivers = [\n         'e1000',\n         'ena',\n         'enetc',\n+\t'enetfec',\n         'enic',\n         'failsafe',\n         'fm10k',\n",
    "prefixes": [
        "v2",
        "1/5"
    ]
}