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 651C8A0548; Fri, 10 Sep 2021 05:47:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E15A84003F; Fri, 10 Sep 2021 05:47:38 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70089.outbound.protection.outlook.com [40.107.7.89]) by mails.dpdk.org (Postfix) with ESMTP id 5F74E4003E for ; Fri, 10 Sep 2021 05:47:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J/wbeeJN2CJNNWXMvZi5ftFn/jJ7GG7RcqCoCjximaEIq5eE/4866NWN/kI67ogf2wobwhtFdxTA0MkZ0hFP/mnAB46VYjhmQoGVzjSd//WkyUV1R+Z4e/d3Nr1B+F2FHBJ0zSytmI+4P/WDYEYfGTO3hQBCgSGht5fDArlV47F9LoCbySQM5J6d7J+QChjhEJj6VjqIMp3KWCNBO1Ns/HxXMFF3aKIrgDY+VBwRWcwyP1uFcFe2LlgOdv9o2fwPw35e+plHybkoVTzgAYQk6Ks7qcm3DDczBKYEL5xviHOYSNlgy4eHaZdDxv3uuIFzXW/Z89asviDVt4RqYwGYPQ== 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; bh=c1P0RcQnj4CSn30yRR6Y/w+QnXmqXAUaSYlwAqmznHQ=; b=O8lMQLAkUyqjxSYU8pICxt4HF7+0hh3SXv4wAF8JOmUZPlsQKfJI9OED3ZdVpYQcpIPxbgF30Fxr5F7a3G3LH2YqA+RtCK9J4Ksor3uWAMAYEj9ZHaUchnRFwR3yFCyUtsoU3/gm/J6NA1LO3E/CpOpWYNJN1OZPQQ3jITv0UE0RyuvY+BA2xpXSBu74DeTge34sdYBksHJAbFcw3NZfxhXMJUirJl0ePrKZh9AVZdnq0o+otxCrRzCH6ZbxT7iDErs7LhqVmBNpBEptT8m/SQ88GEpLJ8loa1JBV7x8I7PONdByuitFzXGYtlTKb49oq2xd+ajF7hlJVPxhe1SnFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c1P0RcQnj4CSn30yRR6Y/w+QnXmqXAUaSYlwAqmznHQ=; b=g8QZvAL++6+1awwEfKpkY1at6HBY9HD559Z49OiZ4SR/fv4K/CqwqGccb/dZJr8RrqWABpfjZx5WPqt13EItgBzntZv2JT19yM2Qhkxr6IyvbYCMgoxFPU/CVj3Uv1wzuZjB31169cVkCHiI1xbXVxE9lbdVoRJPTa67J1Ejpj0= Received: from VI1PR04MB6816.eurprd04.prod.outlook.com (2603:10a6:803:12d::18) by VI1PR04MB4655.eurprd04.prod.outlook.com (2603:10a6:803:72::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.22; Fri, 10 Sep 2021 03:47:35 +0000 Received: from VI1PR04MB6816.eurprd04.prod.outlook.com ([fe80::19a4:1404:5f97:ff4d]) by VI1PR04MB6816.eurprd04.prod.outlook.com ([fe80::19a4:1404:5f97:ff4d%8]) with mapi id 15.20.4500.017; Fri, 10 Sep 2021 03:47:35 +0000 From: Apeksha Gupta To: David Marchand CC: Andrew Rybchenko , "Yigit, Ferruh" , dev , Hemant Agrawal , Sachin Saxena Thread-Topic: [EXT] Re: [dpdk-dev] [PATCH v2 1/5] net/enetfec: introduce NXP ENETFEC driver Thread-Index: AQHXoCR9b6oDxKZzyEenIo30VH7/TauR5mgAgAg2TMA= Date: Fri, 10 Sep 2021 03:47:35 +0000 Message-ID: References: <20210902175955.9202-1-apeksha.gupta@nxp.com> <20210902175955.9202-2-apeksha.gupta@nxp.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1e1186ba-ad62-4902-5f00-08d9740db9e5 x-ms-traffictypediagnostic: VI1PR04MB4655: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1360; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cGRrQix/aBI9PNdHTz2ZBmJSEkiV1jI3cjbs9OsQu1PEDJ744e8yJXh1sivCFTL+SxABMsSKDUWiDrOc5HwwvwdRfcYhaAuLNxM8AcczdPM1xX4MIIv/gkoOXXQ5Fx9jxe8ZT2E5ISTcYx2G85KJEb2T2ukeXVxEgw9x6kszuc5OCZg47DM0GBLSVYClMjDmNWCah3CzMOJg0ny8VMHn/576kFxmIht55QWd5k5ycw8m7iC5+jjkrh3eilQDNkFJi0tq4jEKV67EvC2Xm8UP9e74pPeYyOvFXTzkC16qK2cgOZN9kr98e3Hv/Gsd/3q4VBA3h21F6QlKNfsUzFenBDgF29wdaCQOkgItTA2dXUe6c6pBUG7bDMZZa4hwG6ovTZp3Pu/Tb/ikvNf5tMs3LekV6zkbZ+1UhcUnbIGsoI+SfBQ8J6wFosLMW9pJPcbsTXVN4g3sHjIopC+0BaQcQ8Wg8wHIwl6Zyop0EmNKHFNasIiJdvDndCMJr11rNii3xpyFJ2xOW7aVBgk7jlaI9zsesn0NFmrwU0W5Hn4CBnhglp7b6WjsKCHs0SJFPpnCVQ9EL5R8x0mEFXF5s6+cPar5xjnJSD5AMyNPpHS5qZpolG9Ja/8Z8FhlcOovMlGMJY4uuRFW+pJwzAxzEO1mTK18lVUafWqNx1nNrFip7BrwrRRBtKrj3VTjtkLXXmrlhJPm9fonMxzAMQAdLZjxckXuny5uZTcMEfbXDE0hca9mVImdb9deilzczERjMWV/lTPCqnjjiltEK899luqTfpFKysWZHT/upeeDNqYKs2ZSF8n/6RHhQCCsrUO0s0Y3Kp4aXUe/3mEdOrs0VZMseQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB6816.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(39860400002)(136003)(346002)(396003)(376002)(71200400001)(26005)(30864003)(316002)(122000001)(38070700005)(83380400001)(478600001)(5660300002)(55016002)(38100700002)(8936002)(76116006)(2906002)(52536014)(86362001)(54906003)(4326008)(33656002)(53546011)(9686003)(6916009)(66446008)(64756008)(66946007)(66476007)(186003)(66556008)(7696005)(8676002)(6506007)(44832011)(579004); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?vHvO69/nKHREB56KkUj5mCSsh6rwekSlCxKZd2Qr+HByjmmoySBEHfpmIOaV?= =?us-ascii?Q?b9nF/HwpeYXlfgDb64e2yRC+Vmdh0UoXCpXYe3ILxvYHz5RRxhtQeHeQ53tc?= =?us-ascii?Q?9dykhc3hiGqOyRXfYh3S+fIDafhwznkLX5zJVv7Mu3K7lqj1u24PEp/FI5UP?= =?us-ascii?Q?LDE2d9XXOUa64odHtvO1ca8vnsglwgloHPZqbsiwLk9YNF3bYQ0tDiYK00EJ?= =?us-ascii?Q?vcxfNfZ815+e3pbPRuCxO7MIGtG0eMIdIrlAwcB11uvxgiyKglvMgf8p78dK?= =?us-ascii?Q?Mnu9Z16gDOtDb0ZOlLEdEv0KX+1bt6+ejD5KdIWJLu12mBoFWpRBXJxRZA8b?= =?us-ascii?Q?CHsmWUVG3bRuVnyjgFbGzotH6rKQDlnNBFvflBwgpWLx42XkOXJ4tAZBDWcK?= =?us-ascii?Q?7b3mjKtYCeRYpoCPko/sBfSdkkdy5laGShspYx0lsjRUEtdCuLhIvLjffWsz?= =?us-ascii?Q?8EVbIq4YRLKU5Yl8g5PByE+H/iTD6ONPaR2tehF0khGlNqhFDEkontJ8Y5ML?= =?us-ascii?Q?GcKUmYJEcEGL/m2KJ7hAE8UQrBxLo/92DMvgG28GNy65W6aYAMtzUmZaS+Dt?= =?us-ascii?Q?nYhwYm4A7g9p/PGE8gUsFawMj1JUspCptHRLsq3j07lebwgIjEA9A795La5S?= =?us-ascii?Q?wGaXpLVhsTriBCAKvzY/44HH4cYJ0QI+qN+8I/YLmmeeUm0QsDYhiKKrRe64?= =?us-ascii?Q?pyeYQGABDXOdEZSspJTtYE80rDpsnvcJMSEhyo4dEWUjY97xnT6n8clBxmGN?= =?us-ascii?Q?ppdW0Ta83vRAeCGbqiai10PnrlRrPPb3oo+tsHOmMXIExfY3NYVVnGaPhkZM?= =?us-ascii?Q?AncX6c6RPD8zxxJIg0VTds+wL0za+U13WIAED6UCkKV299DnE/MV2aJyFFRt?= =?us-ascii?Q?DRLw3/uzcPThQo/VPzRPaCgZLShGvi78NNZhrobnkSYMhwYAfrQk+3L60cP4?= =?us-ascii?Q?2eAY2HcfyIfFXTXo585UHP8b6G5jgiQPUuMStEiZqRYR5k3AC5BudnXt7Gn2?= =?us-ascii?Q?L7H5R9b5c94dGh2yqrcHu1QV7rdtZMoONs4piJW/q+kiAB7Prp4WfMcTvboA?= =?us-ascii?Q?DGOpHRMDmFvl+28AV2GrLI6AlBefbrkw5Sz8AkMmwd78p8P0JI+dPztXsec6?= =?us-ascii?Q?VePTxsgmRhDLvADAYRmfsAyQA23LcWzqemahhXgPHb9AE5wHjk4hRy0fiaBB?= =?us-ascii?Q?Fir0i9kNk9Cj9zMdk+oszl4RuLsGzJB4evveRcOAS7/y243ljDiCYk/Q2kBk?= =?us-ascii?Q?vDMBwL3KlpWNjMayCPGFG/aptELEg9E9lUZzwl7MofYuQXe7353l2lAwC/P8?= =?us-ascii?Q?W3PXXfMBIHnM4TKO4KqMa2vA?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB6816.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e1186ba-ad62-4902-5f00-08d9740db9e5 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Sep 2021 03:47:35.0844 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: b9MxXEnRhqAOhYrPRT81aInx181Ov81uaOglQ/zyuQdasZTICqQtfnYJodGS20yDd0QUi32ruphaJ0e0DEcWsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4655 Subject: Re: [dpdk-dev] [EXT] Re: [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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: David Marchand > Sent: Friday, September 3, 2021 12:45 PM > To: Apeksha Gupta > Cc: Andrew Rybchenko ; Yigit, Ferruh > ; dev ; Hemant Agrawal > ; Sachin Saxena > Subject: [EXT] Re: [dpdk-dev] [PATCH v2 1/5] net/enetfec: introduce NXP > ENETFEC driver >=20 > Caution: EXT Email >=20 > On Thu, Sep 2, 2021 at 8:01 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 > > --- > > doc/guides/nics/enetfec.rst | 121 ++++++++++++++++++++ > > doc/guides/nics/features/enetfec.ini | 8 ++ > > doc/guides/nics/index.rst | 1 + > > drivers/net/enetfec/enet_ethdev.c | 95 ++++++++++++++++ > > drivers/net/enetfec/enet_ethdev.h | 160 +++++++++++++++++++++++++++ > > drivers/net/enetfec/enet_pmd_logs.h | 31 ++++++ > > drivers/net/enetfec/meson.build | 15 +++ > > drivers/net/enetfec/version.map | 3 + > > drivers/net/meson.build | 1 + > > 9 files changed, 435 insertions(+) > > 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 >=20 > Please update MAINTAINERS and release notes in this first patch. [Apeksha] okay, added in v3. >=20 > > > > diff --git a/doc/guides/nics/enetfec.rst b/doc/guides/nics/enetfec.rst > > new file mode 100644 > > index 0000000000..f151bb26c4 > > --- /dev/null > > +++ b/doc/guides/nics/enetfec.rst > > @@ -0,0 +1,121 @@ > > +.. SPDX-License-Identifier: BSD-3-Clause > > + Copyright 2021 NXP > > + > > +ENETFEC Poll Mode Driver > > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > > + > > +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 > > > + nxp.com%2Fproducts%2Fprocessors-and-microcontrollers%2Farm- > processors%2Fi-mx-applications-processors%2Fi-mx-8-processors%2Fi-mx-8m- > mini-arm-cortex-a53-cortex-m4-audio-voice- > video%3Ai.MX8MMINI&data=3D04%7C01%7Capeksha.gupta%40nxp.com%7 > Ca965cce583974ae4b49408d96eaa8a58%7C686ea1d3bc2b4c6fa92cd99c5c301 > 635%7C0%7C1%7C637662501011576537%7CUnknown%7CTWFpbGZsb3d8eyJ > WIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C > 1000&sdata=3D2iLDhMwWZvZjskijEk6IGUPNLzw8D0xhPsvwJe305ng%3D&am > p;reserved=3D0> > > + > > +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 is a hardware > programmable > > +packet forwarding engine to provide high performance Ethernet interfac= e. > > +The diagram below shows a system level overview of ENETFEC: > > + > > + > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D > > + US +-----------------------------------------+ | Kernel Space > > + | | | > > + | ENETFEC Driver | | > > + +-----------------------------------------+ | > > + ^ | | > > + ENETFEC RXQ | | TXQ | > > + PMD | | | > > + | v | +----------+ >=20 > Misalignment of the right part. >=20 >=20 > > + +-------------+ | | fec-uio = | >=20 > What is fec-uio? > I can't find it in upstream linux kernel. [Apeksha] fec-uio is the kernel driver. We have also initiated the process = of upstreaming it. >=20 >=20 > > + | net_enetfec | | +----------= + > > + +-------------+ | > > + ^ | | > > + TXQ | | RXQ | > > + | | | > > + | v | > > + > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D > > + +----------------------------------------+ > > + | | HW > > + | i.MX 8M MINI EVK | > > + | +-----+ | > > + | | MAC | | > > + +---------------+-----+------------------+ > > + | PHY | > > + +-----+ >=20 > Misalignment. >=20 >=20 > > + > > +ENETFEC Ethernet driver is traditional DPDK PMD driver running in the > userspace. > > +The MAC and PHY are the hardware blocks. 'fec-uio' is the UIO driver, > ENETFEC PMD > > +uses UIO interface to interact with kernel for PHY initialisation and = for > mapping > > +the allocated memory of register & BD in kernel with DPDK which gives > access to > > +non-cacheable memory for BD. 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 dr= iver. > > +- The probe function will set the basic device registers and also setu= ps 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 > > +~~~~~~~~~~~~~~~~~ > > + > > +- ARMv8 > > + > > +Supported ENETFEC SoCs > > +~~~~~~~~~~~~~~~~~~~~~~ > > + > > +- i.MX 8M Mini > > + > > +Prerequisites > > +~~~~~~~~~~~~~ > > + > > +There are three main pre-requisites for executing ENETFEC PMD on a i.M= X > 8M Mini > > +compatible board: > > + > > +1. **ARM 64 Tool Chain** > > + > > + For example, the `*aarch64* Linaro Toolchain > .linaro.org%2Fcomponents%2Ftoolchain%2Fbinaries%2F7.4- > 2019.02%2Faarch64-linux-gnu%2Fgcc-linaro-7.4.1-2019.02-x86_64_aarch64- > linux- > gnu.tar.xz&data=3D04%7C01%7Capeksha.gupta%40nxp.com%7Ca965cce583 > 974ae4b49408d96eaa8a58%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C > 1%7C637662501011586493%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA > wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sda > ta=3DmHBmrwivWNwEJiXBQTR8EAADgrZtd44ggXqJFyRJxTA%3D&reserved=3D0 > >`_. > > + > > +2. **Linux Kernel** > > + > > + It can be obtained from `NXP's Github hosting > codeaurora.org%2Fexternal%2Fqoriq%2Fqoriq- > components%2Flinux&data=3D04%7C01%7Capeksha.gupta%40nxp.com%7Ca > 965cce583974ae4b49408d96eaa8a58%7C686ea1d3bc2b4c6fa92cd99c5c30163 > 5%7C0%7C1%7C637662501011586493%7CUnknown%7CTWFpbGZsb3d8eyJWIj > oiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C100 > 0&sdata=3D4im4j9xK%2FlTxAa0aVyMFVwQ7Klmy3tnTaYSDtu9yVg8%3D& > ;reserved=3D0>`_. > > + > > +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 > ubuntu.com%2Fubuntu-base%2Freleases%2F18.04%2Frelease%2Fubuntu-base- > 18.04.1-base- > arm64.tar.gz&data=3D04%7C01%7Capeksha.gupta%40nxp.com%7Ca965cce5 > 83974ae4b49408d96eaa8a58%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0% > 7C1%7C637662501011586493%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL > jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&s > data=3DjBnLNy7HsO%2BPVDOLY3tCizW%2Bvs%2FA86KjTTe73xBLGPY%3D&r > eserved=3D0>`_. > > + > > +4. The Ethernet device will be registered as virtual device, so ENETFE= C has > dependency on > > + **rte_bus_vdev** library and it is mandatory to use `--vdev` with v= alue > `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 **testpmd** >=20 > dpdk-testpmd. >=20 >=20 > > + > > +Limitations > > +~~~~~~~~~~~ > > + > > +- Multi queue is not supported. > > +- Link status is down always. > > +- Single Ethernet interface. > > diff --git a/doc/guides/nics/features/enetfec.ini > b/doc/guides/nics/features/enetfec.ini > > new file mode 100644 > > index 0000000000..5700697981 > > --- /dev/null > > +++ b/doc/guides/nics/features/enetfec.ini > > @@ -0,0 +1,8 @@ > > +; > > +; Supported features of the 'enetfec' network poll mode driver. > > +; > > +; Refer to default.ini for the full list of available PMD features. > > +; > > +[Features] > > +ARMv8 =3D Y > > +Usage doc =3D 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/drivers/net/enetfec/enet_ethdev.c > b/drivers/net/enetfec/enet_ethdev.c > > new file mode 100644 > > index 0000000000..88774788cf > > --- /dev/null > > +++ b/drivers/net/enetfec/enet_ethdev.c > > @@ -0,0 +1,95 @@ > > +/* SPDX-License-Identifier: BSD-3-Clause > > + * Copyright 2020-2021 NXP > > + */ > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include "enet_ethdev.h" > > +#include "enet_pmd_logs.h" > > + > > +#define ENETFEC_NAME_PMD net_enetfec > > +#define ENETFEC_VDEV_GEM_ID_ARG "intf" > > +#define ENETFEC_CDEV_INVALID_FD -1 > > + > > +int enetfec_logtype_pmd; >=20 > If using RTE_LOG_REGISTER* macros (see below), you don't need this defini= tion. [Apeksha] okay. >=20 >=20 > > + > > +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 =3D NULL; > > + struct enetfec_private *fep; > > + const char *name; > > + int rc; > > + > > + name =3D rte_vdev_device_name(vdev); > > + if (name =3D=3D NULL) > > + return -EINVAL; > > + ENETFEC_PMD_LOG(INFO, "Initializing pmd_fec for %s", name); > > + > > + dev =3D rte_eth_vdev_allocate(vdev, sizeof(*fep)); > > + if (dev =3D=3D NULL) > > + return -ENOMEM; > > + > > + /* setup board info structure */ > > + fep =3D dev->data->dev_private; > > + fep->dev =3D dev; > > + rc =3D 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 =3D NULL; > > + int ret; > > + > > + /* find the ethdev entry */ > > + eth_dev =3D rte_eth_dev_allocated(rte_vdev_device_name(vdev)); > > + if (eth_dev =3D=3D NULL) > > + return -ENODEV; > > + > > + ret =3D rte_eth_dev_release_port(eth_dev); > > + if (ret !=3D 0) > > + return -EINVAL; > > + > > + ENETFEC_PMD_INFO("Closing sw device"); > > + return 0; > > +} > > + > > +static struct rte_vdev_driver pmd_enetfec_drv =3D { > > + .probe =3D pmd_enetfec_probe, > > + .remove =3D pmd_enetfec_remove, > > +}; > > + > > +RTE_PMD_REGISTER_VDEV(ENETFEC_NAME_PMD, pmd_enetfec_drv); > > +RTE_PMD_REGISTER_PARAM_STRING(ENETFEC_NAME_PMD, > ENETFEC_VDEV_GEM_ID_ARG "=3D"); > > + > > +RTE_INIT(enetfec_pmd_init_log) > > +{ > > + int ret; > > + ret =3D rte_log_register_type_and_pick_level(ENETFEC_LOGTYPE_PR= EFIX > "driver", > > + RTE_LOG_NOTICE); > > + enetfec_logtype_pmd =3D (ret < 0) ? RTE_LOGTYPE_PMD : ret; > > +} >=20 > Please use RTE_LOG_REGISTER_DEFAULT. >=20 >=20 > > diff --git a/drivers/net/enetfec/enet_ethdev.h > b/drivers/net/enetfec/enet_ethdev.h > > new file mode 100644 > > index 0000000000..8c61176fb5 > > --- /dev/null > > +++ b/drivers/net/enetfec/enet_ethdev.h > > @@ -0,0 +1,160 @@ > > +/* SPDX-License-Identifier: BSD-3-Clause > > + * Copyright 2020-2021 NXP > > + */ > > + > > +#ifndef __ENETFEC_ETHDEV_H__ > > +#define __ENETFEC_ETHDEV_H__ > > + > > +#include > > +#include > > + > > +/* Common log type name prefix */ > > +#define ENETFEC_LOGTYPE_PREFIX "pmd.net.enetfec." > > + > > +/* > > + * ENETFEC with AVB IP can support maximum 3 rx and tx queues. > > + */ > > +#define ENETFEC_MAX_Q 3 > > + > > +#define BD_LEN 49152 > > +#define ENETFEC_TX_FR_SIZE 2048 > > +#define MAX_TX_BD_RING_SIZE 512 /* It should be power of 2 */ > > +#define MAX_RX_BD_RING_SIZE 512 > > + > > +/* full duplex or half duplex */ > > +#define HALF_DUPLEX 0x00 > > +#define FULL_DUPLEX 0x01 > > +#define UNKNOWN_DUPLEX 0xff > > + > > +#define PKT_MAX_BUF_SIZE 1984 > > +#define OPT_FRAME_SIZE (PKT_MAX_BUF_SIZE << 16) > > +#define ETH_ALEN RTE_ETHER_ADDR_LEN > > +#define ETH_HLEN RTE_ETHER_HDR_LEN > > +#define VLAN_HLEN 4 > > + > > +struct bufdesc { > > + uint16_t bd_datlen; /* buffer data length */ > > + uint16_t bd_sc; /* buffer control & status = */ > > + uint32_t bd_bufaddr; /* buffer address */ > > +}; > > + > > +struct bufdesc_ex { > > + struct bufdesc desc; > > + uint32_t bd_esc; > > + uint32_t bd_prot; > > + uint32_t bd_bdu; > > + uint32_t ts; > > + uint16_t res0[4]; > > +}; > > + > > +struct bufdesc_prop { > > + int que_id; > > + /* Addresses of Tx and Rx buffers */ > > + struct bufdesc *base; > > + struct bufdesc *last; > > + struct bufdesc *cur; > > + void __iomem *active_reg_desc; > > + uint64_t descr_baseaddr_p; > > + unsigned short ring_size; > > + unsigned char d_size; > > + unsigned char d_size_log2; > > +}; > > + > > +struct enetfec_priv_tx_q { > > + struct bufdesc_prop bd; > > + struct rte_mbuf *tx_mbuf[MAX_TX_BD_RING_SIZE]; > > + struct bufdesc *dirty_tx; > > + struct rte_mempool *pool; > > + struct enetfec_private *fep; > > +}; > > + > > +struct enetfec_priv_rx_q { > > + struct bufdesc_prop bd; > > + struct rte_mbuf *rx_mbuf[MAX_RX_BD_RING_SIZE]; > > + struct rte_mempool *pool; > > + struct enetfec_private *fep; > > +}; > > + > > +/* Buffer descriptors of FEC are used to track the ring buffers. Buffe= r > > + * 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. > > + */ > > +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; > > + u_int32_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]; > > +}; > > + > > +#define writel(v, p) ({*(volatile unsigned int *)(p) =3D (v); }) > > +#define readl(p) rte_read32(p) > > + > > +static inline struct > > +bufdesc *enet_get_nextdesc(struct bufdesc *bdp, struct bufdesc_prop *b= d) > > +{ > > + return (bdp >=3D bd->last) ? bd->base > > + : (struct bufdesc *)(((void *)bdp) + bd->d_size= ); > > +} > > + > > +static inline struct > > +bufdesc *enet_get_prevdesc(struct bufdesc *bdp, struct bufdesc_prop *b= d) > > +{ > > + return (bdp <=3D bd->base) ? bd->last > > + : (struct bufdesc *)(((void *)bdp) - bd->d_size= ); > > +} > > + > > +static inline int > > +enet_get_bd_index(struct bufdesc *bdp, struct bufdesc_prop *bd) > > +{ > > + return ((const char *)bdp - (const char *)bd->base) >> bd->d_si= ze_log2; > > +} > > + > > +static inline int > > +fls64(unsigned long word) > > +{ > > + return (64 - __builtin_clzl(word)) - 1; > > +} > > + > > +uint16_t enetfec_recv_pkts(void *rxq1, __rte_unused struct rte_mbuf > **rx_pkts, > > + uint16_t nb_pkts); > > +uint16_t enetfec_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, > > + uint16_t nb_pkts); > > +struct bufdesc *enet_get_nextdesc(struct bufdesc *bdp, > > + struct bufdesc_prop *bd); > > +int enet_new_rxbdp(struct enetfec_private *fep, struct bufdesc *bdp, > > + struct rte_mbuf *mbuf); > > + > > +#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 le= vel */ > > +#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..252bf83309 > > --- /dev/null > > +++ b/drivers/net/enetfec/meson.build > > @@ -0,0 +1,15 @@ > > +# SPDX-License-Identifier: BSD-3-Clause > > +# Copyright 2021 NXP > > + > > +if not is_linux > > + build =3D false > > + reason =3D 'only supported on linux' >=20 > The doc specifies that only armv8 is supported. >=20 >=20 > > +endif > > + > > +deps +=3D ['common_dpaax'] > > + > > +sources =3D files('enet_ethdev.c') > > + > > +if cc.has_argument('-Wno-pointer-arith') > > + cflags +=3D '-Wno-pointer-arith' > > +endif >=20 > Can't this be fixed in the code rather than ignored? >=20 >=20 > > diff --git a/drivers/net/enetfec/version.map > b/drivers/net/enetfec/version.map > > new file mode 100644 > > index 0000000000..170c04fe53 > > --- /dev/null > > +++ b/drivers/net/enetfec/version.map > > @@ -0,0 +1,3 @@ > > +DPDK_20.0 { >=20 > Wrong ABI version. >=20 >=20 > > + local: *; > > +}; > > diff --git a/drivers/net/meson.build b/drivers/net/meson.build > > index bcf488f203..92f433d5e8 100644 > > --- a/drivers/net/meson.build > > +++ b/drivers/net/meson.build > > @@ -19,6 +19,7 @@ drivers =3D [ > > 'e1000', > > 'ena', > > 'enetc', > > + 'enetfec', >=20 > Indent. >=20 >=20 > > 'enic', > > 'failsafe', > > 'fm10k', > > -- > > 2.17.1 > > >=20 > -- > David Marchand