From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C47E9A0C5D; Thu, 4 Nov 2021 19:24:37 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B35E54276E; Thu, 4 Nov 2021 19:24:37 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id A5B304276D for ; Thu, 4 Nov 2021 19:24:35 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10158"; a="230486408" X-IronPort-AV: E=Sophos;i="5.87,209,1631602800"; d="scan'208";a="230486408" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2021 11:24:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,209,1631602800"; d="scan'208";a="729370114" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga006.fm.intel.com with ESMTP; 04 Nov 2021 11:24:34 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 4 Nov 2021 11:24:33 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 4 Nov 2021 11:24:33 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 4 Nov 2021 11:24:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=huSyP8owl+9ThA8iEhWvt8XvJKFTEe4I8r51Wjqt/9HYePHkDKi7V7FoIhWtyGiuH3jQRX7+sgFhAjT+9vzlSZG8loesbxgzjXI0M4TV7Ft8tzoFOp4vjSXDOsAznOpkBITqMo+FeuniQq8NgHH89fMKnzBaO6blVjUIH0pv18fEY1k2Aw1twfUaqEEOHIZsBxVmWLNfv1UEeHRE50xHAgeE3h+uKi06qUPGBhE8QLG+imsJLgYzeUmM/SQsahdCwC0d6AjipXqNumFHmNKZS4MMyb+xXsecEqWZ6+DS6sLatIIrFc96FcZvXA4dKT9BtHlacjF+09mO9KmNB5mE3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QUd3MbN/4Uz+1fidpCPOW+g8ILDom41K9qoAJlTNGe0=; b=GFX4nHiMArnmpaMep40iJyBMqTHNtGwQYdtC8sOSxMkuOBI+Fl6rXoKjrW4dZPJ8nY+naZeFttwMJgwHTUdrIIVDTp+Ex/nmkTg4rv4Tv9n14MstDAZSXaIan8MYjZLuwtiydScIPne2bgrXZDAKhfUhV+u7jPBs/gucT0f6dx9aH4AQzgyIuTKtaSIsxRlsXMW9nDhTK37Q8ZL9WKLgMSdywean31aNd5pN+49B4Hah4O2Mjht0CPB0d8PdtbumNemriWB6xTwYHWgqpyx4/Eh6XqZVj3D8KqGhCHJ3nOj0prPnRkIkjA59GRj3gBuXWgVFNK6FMw9PSCdWO7bCUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QUd3MbN/4Uz+1fidpCPOW+g8ILDom41K9qoAJlTNGe0=; b=YdO+Gq9pQS8wAMwBbm8VkQsHDFC3Mtx2mP7A/nXyXjthqbqDVEzivXSrhDb3ULJ71lw+TTGuCGW/cQOYu3+zmzX6gBM0wXCC8J+Lo2RUFrJeEGLjq9/0VnY2p03KZAo81eB+Mhw8mVc41CLNeqO7vazNi/UGohyU0QXHc8b+Zy8= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4775.namprd11.prod.outlook.com (2603:10b6:510:34::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10; Thu, 4 Nov 2021 18:24:31 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%7]) with mapi id 15.20.4669.011; Thu, 4 Nov 2021 18:24:31 +0000 Message-ID: <0d4a783d-3776-1a4f-ff63-e9ad6fa08bdd@intel.com> Date: Thu, 4 Nov 2021 18:24:25 +0000 Content-Language: en-US To: Apeksha Gupta , , CC: , , References: <20211021044700.12370-2-apeksha.gupta@nxp.com> <20211103192045.22240-1-apeksha.gupta@nxp.com> <20211103192045.22240-2-apeksha.gupta@nxp.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20211103192045.22240-2-apeksha.gupta@nxp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0491.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:13a::16) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by LO2P265CA0491.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:13a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Thu, 4 Nov 2021 18:24:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f723b70b-5ab1-44a0-468c-08d99fc05863 X-MS-TrafficTypeDiagnostic: PH0PR11MB4775: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zKyUb1MCICo4IntKgFbmPynS4rT0E165gieBwrSTsmZWzjo9OdNmgBFGmcjL6b/9Y8ZXTCHGwrR4WkHsFcWyyUjWTRKPgIRLKpKdnM+mWBuGNYU+rT/kccPA2dwZYRXgJyC1NxcvUrok7+HnSXG1nK3/6uhpr4ae85kUo1oQ52r8SEfBFKPFUoJ9UgVdgN3S0P10mhB3gHawAEMiVje/PK9xZoLbWzISsLcRKCkT97TNbPdkg63ETK8qwtFletghbYHhlJiOSBVuasH5xITJnYR9GWiwsY0I42TSOQAz6evKXOawCcXbLOjZaqwGbImj0Lw38P0qDnv1IBoficDmvif3Ti3NnmY7FsgN6fOBVPDvB6wWlqh+0iKvfFxgi/5N+rpNP8JxBNc+lutI2cK3h2YSs/Yfs6checAZsorSrycfQRUwAGtAjY9g52VZ1n49SYRho7RyOllB5VFb8ZZUCxLNy4W2Or1HuIlRsuMMZY/QAPg7GlNcQGhNn5QRBgAyH7mDKMixXBNzGsJa8ienTE2S6deqbcQV20FYNzuxkm2p8kEnSpu5cYPwi9pN1L4fi8asegmAPaaGAz3jD3QpC7BRJGlczcsZqtYuhQBi6w3ZUG1yVrZl48u7QtCnrqg/ah/8GvqDoriSPeZzeu3j8TZopH30VoanHtN0wQvsqAYzrntViI8FeZrm3w/i73cWAECajkoIUkzLVy66j6WeNoe89dqB5m7JtV14oP/lczoz93WgjEyijwYeGPqBgYyO4j8UTU9kJibb100B6qYuuNdtLdTsWTdDJgUYodpepZe6j2kPEZ1PcPQN+9Dq6TZ+pGnoQH5LG7JpIrjFpT6kBQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(36756003)(26005)(956004)(6486002)(66556008)(508600001)(4326008)(86362001)(6666004)(66476007)(44832011)(66946007)(2616005)(38100700002)(83380400001)(31686004)(53546011)(316002)(31696002)(16576012)(186003)(8936002)(30864003)(2906002)(8676002)(82960400001)(5660300002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eURWeTdBbmV0eGIyc012a0FpZlNSK0pYUFFJT1RCUGhBeUhZRkt0UWdhZG9h?= =?utf-8?B?MzgzdGs4N3FWcVV0VkN5Vzk1Ukd2RWlEcHAwSUpjeWVNbmFteUJ5NnJxU0Rm?= =?utf-8?B?ZXE4RUVyRkUxSmNCNEtTOTRIYmdsZEJTYTVqZzNlcGovWDRZSk0vVU9mNDRH?= =?utf-8?B?UlZoUWxPUVdzMDJrL1lweHR2b2h3QmxUbTU0UjEyc0NIVWtodWRHWGRjUlpq?= =?utf-8?B?VjZsTUo3cVYrUWJtc1FPOFF2cjhmQjlWQzNZd2o0UFRrZVJkZU50YzFrMGlu?= =?utf-8?B?UDhBMklWdldjUmhnRDhPT0tZeUNLcEYwTW04REo4S29lblFmTkNhbTVoYStD?= =?utf-8?B?WUR5dzJRUWZYazZZOTR4ejlk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HZkRpTkora3do?= =?utf-8?Q?3GDmNWpUem8otTM3K7euH1M=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: f723b70b-5ab1-44a0-468c-08d99fc05863 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2021 18:24:31.8180 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IMHUAkv+x/PvaSuc2OZi2OawWiLMu4ObUUi5zbuIJ/gXhfNdDnObMFXlUSFs9ECqS8/pikc9ca4ijk4ObHTLCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4775 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v7 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 11/3/2021 7:20 PM, Apeksha Gupta wrote: > ENETFEC (Fast Ethernet Controller) is a network poll mode driver > for NXP SoC i.MX 8M Mini. > > This patch adds skeleton for enetfec driver with probe function. > > Signed-off-by: Sachin Saxena > Signed-off-by: Apeksha Gupta > --- > v7: > - Fix compilation > - code cleanup > > v6: > - Fix document build errors > --- > MAINTAINERS | 7 ++ > doc/guides/nics/enetfec.rst | 131 +++++++++++++++++++++++++ > doc/guides/nics/features/enetfec.ini | 9 ++ > doc/guides/nics/index.rst | 1 + > doc/guides/rel_notes/release_21_11.rst | 6 +- > drivers/net/enetfec/enet_ethdev.c | 85 ++++++++++++++++ > drivers/net/enetfec/enet_ethdev.h | 58 +++++++++++ > drivers/net/enetfec/enet_pmd_logs.h | 31 ++++++ > drivers/net/enetfec/meson.build | 9 ++ > drivers/net/enetfec/version.map | 3 + > drivers/net/meson.build | 2 +- > 11 files changed, 340 insertions(+), 2 deletions(-) > create mode 100644 doc/guides/nics/enetfec.rst > create mode 100644 doc/guides/nics/features/enetfec.ini > create mode 100644 drivers/net/enetfec/enet_ethdev.c > create mode 100644 drivers/net/enetfec/enet_ethdev.h > create mode 100644 drivers/net/enetfec/enet_pmd_logs.h > create mode 100644 drivers/net/enetfec/meson.build > create mode 100644 drivers/net/enetfec/version.map > > diff --git a/MAINTAINERS b/MAINTAINERS > index 0e5951f8f1..d000eb81af 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -882,6 +882,13 @@ F: drivers/net/enetc/ > F: doc/guides/nics/enetc.rst > F: doc/guides/nics/features/enetc.ini > > +NXP enetfec > +M: Apeksha Gupta > +M: Sachin Saxena > +F: drivers/net/enetfec/ > +F: doc/guides/nics/enetfec.rst > +F: doc/guides/nics/features/enetfec.ini > + > NXP pfe > M: Gagandeep Singh > F: doc/guides/nics/pfe.rst > diff --git a/doc/guides/nics/enetfec.rst b/doc/guides/nics/enetfec.rst > new file mode 100644 > index 0000000000..dfcd032098 > --- /dev/null > +++ b/doc/guides/nics/enetfec.rst > @@ -0,0 +1,131 @@ > +.. SPDX-License-Identifier: BSD-3-Clause > + Copyright 2021 NXP > + > +ENETFEC Poll Mode Driver > +======================== > + > +The ENETFEC NIC PMD (**librte_net_enetfec**) provides poll mode driver > +support for the inbuilt NIC found in the ** NXP i.MX 8M Mini** SoC. > + > +More information can be found at NXP Official Website > + > + > +ENETFEC > +------- > + > +This section provides an overview of the NXP ENETFEC and how it is > +integrated into the DPDK. > + > +Contents summary > + > +- ENETFEC overview > +- ENETFEC features > +- Supported ENETFEC SoCs > +- Prerequisites > +- Driver compilation and testing > +- Limitations > + > +ENETFEC Overview > +~~~~~~~~~~~~~~~~ > +The i.MX 8M Mini Media Applications Processor is built to achieve both > +high performance and low power consumption. ENETFEC PMD is a hardware > +programmable packet forwarding engine to provide high performance > +Ethernet interface. It has only 1 GB Ethernet interface with RJ45 > +connector. > + > +The diagram below shows a system level overview of ENETFEC: > + > + .. code-block:: console > + > + ===================================================== > + Userspace > + +-----------------------------------------+ > + | ENETFEC Driver | > + | +-------------------------+ | > + | | virtual ethernet device | | > + +-----------------------------------------+ > + ^ | > + | | > + | | > + RXQ | | TXQ > + | | > + | v > + ===================================================== > + Kernel Space > + +---------+ > + | fec-uio | > + ====================+=========+====================== > + Hardware > + +-----------------------------------------+ > + | i.MX 8M MINI EVK | > + | +-----+ | > + | | MAC | | > + +---------------+-----+-------------------+ > + | PHY | > + +-----+ > + > +ENETFEC Ethernet driver is traditional DPDK PMD driver running in the > +userspace.'fec-uio' is the kernel driver. The MAC and PHY are the hardware > +blocks. ENETFEC PMD uses standard UIO interface to access kernel for PHY > +initialisation and for mapping the allocated memory of register & buffer > +descriptor with DPDK which gives access to non-cacheable memory for buffer > +descriptor. net_enetfec is logical Ethernet interface, created by ENETFEC > +driver. > + > +- ENETFEC driver registers the device in virtual device driver. > +- RTE framework scans and will invoke the probe function of ENETFEC driver. > +- The probe function will set the basic device registers and also setups BD rings. > +- On packet Rx the respective BD Ring status bit is set which is then used for > + packet processing. > +- Then Tx is done first followed by Rx via logical interfaces. > + > +ENETFEC Features > +~~~~~~~~~~~~~~~~~ > + > +- Linux > +- ARMv8 > + > +Supported ENETFEC SoCs > +~~~~~~~~~~~~~~~~~~~~~~ > + > +- i.MX 8M Mini > + > +Prerequisites > +~~~~~~~~~~~~~ > + > +There are three main pre-requisites for executing ENETFEC PMD on a i.MX 8M Mini > +compatible board: > + > +1. **ARM 64 Tool Chain** > + > + For example, the `*aarch64* Linaro Toolchain `_. > + > +2. **Linux Kernel** > + > + It can be obtained from `NXP's Github hosting `_. > + > + .. note:: > + > + Branch is 'lf-5.10.y' > + > +3. **Rootfile system** > + > + Any *aarch64* supporting filesystem can be used. For example, > + Ubuntu 18.04 LTS (Bionic) or 20.04 LTS(Focal) userland which can be obtained > + from `here `_. > + > +4. The Ethernet device will be registered as virtual device, so ENETFEC has dependency on > + **rte_bus_vdev** library and it is mandatory to use `--vdev` with value `net_enetfec` to > + run DPDK application. > + > +Driver compilation and testing > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +Follow instructions available in the document > +:ref:`compiling and testing a PMD for a NIC ` > +to launch **dpdk-testpmd** > + > +Limitations > +~~~~~~~~~~~ > + > +- Multi queue is not supported. The question on the above limitation is went unanswered in previous version, instead of not replying and sending a new version, it would be better if you can answer the questions to have some common understanding. Back to the question, in 'enetfec_eth_info()', 'max_rx_queues'/'max_tx_queues' set to 'ENETFEC_MAX_Q' and #define ENETFEC_MAX_Q 3 Also file comment says: * ENETFEC with AVB IP can support maximum 3 rx and tx queues. The device reports and documents 3 queues are supported, but there is a limitation documented saying multi queue is not supported, which one is correct? > diff --git a/doc/guides/nics/features/enetfec.ini b/doc/guides/nics/features/enetfec.ini > new file mode 100644 > index 0000000000..bdfbdbd9d4 > --- /dev/null > +++ b/doc/guides/nics/features/enetfec.ini > @@ -0,0 +1,9 @@ > +; > +; Supported features of the 'enetfec' network poll mode driver. > +; > +; Refer to default.ini for the full list of available PMD features. > +; > +[Features] > +Linux = Y > +ARMv8 = Y > +Usage doc = Y > diff --git a/doc/guides/nics/index.rst b/doc/guides/nics/index.rst > index 784d5d39f6..777fdab4a0 100644 > --- a/doc/guides/nics/index.rst > +++ b/doc/guides/nics/index.rst > @@ -26,6 +26,7 @@ Network Interface Controller Drivers > e1000em > ena > enetc > + enetfec > enic > fm10k > hinic > diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst > index 502cc5ceb2..aed380c21f 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -20,7 +20,6 @@ DPDK Release 21.11 > ninja -C build doc > xdg-open build/doc/guides/html/rel_notes/release_21_11.html > > - unrelated change. > New Features > ------------ > > @@ -135,6 +134,11 @@ New Features > > Added an ethdev API which can help users get device configuration. > > +* **Added NXP ENETFEC PMD.** > + > + Added the new ENETFEC driver for the NXP IMX8MMEVK platform. See the > + :doc:`../nics/enetfec` NIC driver guide for more details on this new driver. > + PMDs are ordered by vendor name, can you pleae move this block below 'Mellanox' PMD update. > * **Updated AF_XDP PMD.** > > * Disabled secondary process support. > diff --git a/drivers/net/enetfec/enet_ethdev.c b/drivers/net/enetfec/enet_ethdev.c > new file mode 100644 > index 0000000000..a6c4bcbf2e > --- /dev/null > +++ b/drivers/net/enetfec/enet_ethdev.c > @@ -0,0 +1,85 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright 2020-2021 NXP > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include "enet_pmd_logs.h" > +#include "enet_ethdev.h" > + > +#define ENETFEC_NAME_PMD net_enetfec > +#define ENETFEC_CDEV_INVALID_FD -1 Is this macro used at all? > + > +static int > +enetfec_eth_init(struct rte_eth_dev *dev) > +{ > + rte_eth_dev_probing_finish(dev); > + return 0; > +} > + > +static int > +pmd_enetfec_probe(struct rte_vdev_device *vdev) > +{ > + struct rte_eth_dev *dev = NULL; > + struct enetfec_private *fep; > + const char *name; > + int rc; > + > + name = rte_vdev_device_name(vdev); > + if (name == NULL) > + return -EINVAL; At this function 'name' shouldn't be null, I think you can drop the check. But can you pleae double check to be sure? > + ENETFEC_PMD_LOG(INFO, "Initializing pmd_fec for %s", name); > + > + dev = rte_eth_vdev_allocate(vdev, sizeof(*fep)); > + if (dev == NULL) > + return -ENOMEM; > + > + /* setup board info structure */ > + fep = dev->data->dev_private; > + fep->dev = dev; > + rc = enetfec_eth_init(dev); > + if (rc) > + goto failed_init; > + > + return 0; > + > +failed_init: > + ENETFEC_PMD_ERR("Failed to init"); > + return rc; > +} > + > +static int > +pmd_enetfec_remove(struct rte_vdev_device *vdev) > +{ > + struct rte_eth_dev *eth_dev = NULL; > + int ret; > + > + /* find the ethdev entry */ > + eth_dev = rte_eth_dev_allocated(rte_vdev_device_name(vdev)); > + if (eth_dev == NULL) > + return -ENODEV; > + > + ret = rte_eth_dev_release_port(eth_dev); > + if (ret != 0) > + return -EINVAL; > + > + ENETFEC_PMD_INFO("Release enetfec sw device"); > + return 0; > +} > + > +static struct rte_vdev_driver pmd_enetfec_drv = { > + .probe = pmd_enetfec_probe, > + .remove = pmd_enetfec_remove, > +}; > + > +RTE_PMD_REGISTER_VDEV(ENETFEC_NAME_PMD, pmd_enetfec_drv); > +RTE_LOG_REGISTER_DEFAULT(enetfec_logtype_pmd, NOTICE); > diff --git a/drivers/net/enetfec/enet_ethdev.h b/drivers/net/enetfec/enet_ethdev.h > new file mode 100644 > index 0000000000..0e4558dd86 > --- /dev/null > +++ b/drivers/net/enetfec/enet_ethdev.h > @@ -0,0 +1,58 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright 2020-2021 NXP > + */ > + > +#ifndef __ENETFEC_ETHDEV_H__ > +#define __ENETFEC_ETHDEV_H__ > + > +/* > + * ENETFEC with AVB IP can support maximum 3 rx and tx queues. > + */ > + > +#define ENETFEC_MAX_Q 3 > + > +/* Buffer descriptors of FEC are used to track the ring buffers. Buffer > + * descriptor base is x_bd_base. Currently available buffer are x_cur > + * and x_cur. where x is rx or tx. Current buffer is tracked by dirty_tx > + * that is sent by the controller. > + * The tx_cur and dirty_tx are same in completely full and empty > + * conditions. Actual condition is determined by empty & ready bits. is above comment correct? Where are mentioned 'x_bd_base', 'rx_cur', 'tx_cur', 'dirty_tx', etc... > + */ > +struct enetfec_private { > + struct rte_eth_dev *dev; > + struct rte_eth_stats stats; > + struct rte_mempool *pool; > + uint16_t max_rx_queues; > + uint16_t max_tx_queues; > + unsigned int total_tx_ring_size; > + unsigned int total_rx_ring_size; > + bool bufdesc_ex; > + unsigned int tx_align; > + unsigned int rx_align; > + int full_duplex; > + unsigned int phy_speed; > + uint32_t quirks; > + int flag_csum; > + int flag_pause; > + int flag_wol; > + bool rgmii_txc_delay; > + bool rgmii_rxc_delay; > + int link; > + void *hw_baseaddr_v; > + uint64_t hw_baseaddr_p; > + void *bd_addr_v; > + uint64_t bd_addr_p; > + uint64_t bd_addr_p_r[ENETFEC_MAX_Q]; > + uint64_t bd_addr_p_t[ENETFEC_MAX_Q]; > + void *dma_baseaddr_r[ENETFEC_MAX_Q]; > + void *dma_baseaddr_t[ENETFEC_MAX_Q]; > + uint64_t cbus_size; > + unsigned int reg_size; > + unsigned int bd_size; > + int hw_ts_rx_en; > + int hw_ts_tx_en; > + struct enetfec_priv_rx_q *rx_queues[ENETFEC_MAX_Q]; > + struct enetfec_priv_tx_q *tx_queues[ENETFEC_MAX_Q]; most of these fields are not used at all, why not construct the struct by adding the fields as you use them? This prevent clutter to remain, like 'flag_wol' above, does it used at all in the driver? > +}; > + > +#endif /*__ENETFEC_ETHDEV_H__*/ > diff --git a/drivers/net/enetfec/enet_pmd_logs.h b/drivers/net/enetfec/enet_pmd_logs.h > new file mode 100644 > index 0000000000..e7b3964a0e > --- /dev/null > +++ b/drivers/net/enetfec/enet_pmd_logs.h > @@ -0,0 +1,31 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright 2020-2021 NXP > + */ > + > +#ifndef _ENETFEC_LOGS_H_ > +#define _ENETFEC_LOGS_H_ > + > +extern int enetfec_logtype_pmd; > + > +/* PMD related logs */ > +#define ENETFEC_PMD_LOG(level, fmt, args...) \ > + rte_log(RTE_LOG_ ## level, enetfec_logtype_pmd, "\nfec_net: %s()" \ > + fmt "\n", __func__, ##args) > + > +#define PMD_INIT_FUNC_TRACE() ENET_PMD_LOG(DEBUG, " >>") > + > +#define ENETFEC_PMD_DEBUG(fmt, args...) \ > + ENETFEC_PMD_LOG(DEBUG, fmt, ## args) > +#define ENETFEC_PMD_ERR(fmt, args...) \ > + ENETFEC_PMD_LOG(ERR, fmt, ## args) > +#define ENETFEC_PMD_INFO(fmt, args...) \ > + ENETFEC_PMD_LOG(INFO, fmt, ## args) > + > +#define ENETFEC_PMD_WARN(fmt, args...) \ > + ENETFEC_PMD_LOG(WARNING, fmt, ## args) > + > +/* DP Logs, toggled out at compile time if level lower than current level */ > +#define ENETFEC_DP_LOG(level, fmt, args...) \ > + RTE_LOG_DP(level, PMD, fmt, ## args) > + > +#endif /* _ENETFEC_LOGS_H_ */ > diff --git a/drivers/net/enetfec/meson.build b/drivers/net/enetfec/meson.build > new file mode 100644 > index 0000000000..6d6c64c94b > --- /dev/null > +++ b/drivers/net/enetfec/meson.build > @@ -0,0 +1,9 @@ > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright 2021 NXP > + > +if not is_linux > + build = false > + reason = 'only supported on linux' > +endif > + > +sources = files('enet_ethdev.c') > diff --git a/drivers/net/enetfec/version.map b/drivers/net/enetfec/version.map > new file mode 100644 > index 0000000000..b66517b171 > --- /dev/null > +++ b/drivers/net/enetfec/version.map > @@ -0,0 +1,3 @@ > +DPDK_22 { > + local: *; > +}; > diff --git a/drivers/net/meson.build b/drivers/net/meson.build > index bcf488f203..ac294d8507 100644 > --- a/drivers/net/meson.build > +++ b/drivers/net/meson.build > @@ -12,13 +12,13 @@ drivers = [ > 'bnx2x', > 'bnxt', > 'bonding', > - 'cnxk', Better to not remove competitor drivers ;) > 'cxgbe', > 'dpaa', > 'dpaa2', > 'e1000', > 'ena', > 'enetc', > + 'enetfec', > 'enic', > 'failsafe', > 'fm10k', >