From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20041.outbound.protection.outlook.com [40.107.2.41]) by dpdk.org (Postfix) with ESMTP id 2EDFB56A3 for ; Thu, 13 Sep 2018 11:42:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uEFWXsUCcet5d2HyYrjsNdzkgDQV3Ziq3QykJwGhdto=; b=q8BBFbZeSwo0jtZQvYITcyALafsFts9dCteMjK7+PPUnL0r2Ni6vSdA2ZQEt2tDOoUZWmuN8KmKHJWyUEDUK6nvA1VLJZ5i9HdTPCz2x5MErey+2VSfUB2MnKPXp7O/wEUVQfuhZNX/pJ9rlbWTdbSVIiUG04SbpkNtyPeG6Ldw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by VI1PR04MB1533.eurprd04.prod.outlook.com (2a01:111:e400:596a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.17; Thu, 13 Sep 2018 09:42:32 +0000 From: Gagandeep Singh To: dev@dpdk.org, ferruh.yigit@intel.com Cc: pankaj.chauhan@nxp.com, Gagandeep Singh Date: Thu, 13 Sep 2018 15:12:00 +0530 Message-Id: <20180913094201.17098-3-g.singh@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180913094201.17098-1-g.singh@nxp.com> References: <20180906055449.21731-1-g.singh@nxp.com> <20180913094201.17098-1-g.singh@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0029.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:c::15) To VI1PR04MB1533.eurprd04.prod.outlook.com (2a01:111:e400:596a::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2c7c4be8-90d5-4409-3f1d-08d6195d3b51 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB1533; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB1533; 3:p1IHCMeAJBMJLqGzsMk78O3lEkqFIr6fW7jdVO2TSxmVAsGcvARf0WTcGkoZ3ubWjXZQU+0a/WAToxPXVE9ecq4+rym4UXlekRm9PTgLhyWacuBj4NnL5zo1EfVu0WoUN9vVdm4HSNvPyFgc40drf03vhWjkSH0/4JKGJTSH1r///wsDgvww7MLuGmv8uLfUktfmGKHE2+B0G6dYP/rpcFunky1PJHMst9Z2clv76TSruOOcvQFsvxMM3r+QaOYi; 25:xNuEOMnSh6fLfKmYsZsKAEy6u+B7lBOkPdGTDy6QUjlmlb9BdeEiRYl3KshFxHZ0DeW88816G05srObhuM7dqrTn0qGZR+z7oaRfwtlZsAe06xgyHA6s4qyJd/v1+N3dKJjUl3NhocMh1sGEF7OQOhHET6q8lCaAro/KwyxklFyYJDvCaIRL7yhCLqy2k15l0RVUIXL4o3eD0wqNcUhNFTUcDMDIjOYflmLJmvnQQe233Fqk3tN22xHnhqYkVHsDZt5OgzhBi7jtcTp65trNIVXiE4ZiiYpG55+fafD1z5DIfTAlS6kEFmNovCLGfiFxAD7P8IABtP3TXwCrtwMbBQ==; 31:m9gGKSt2B18BUmahcBFIvA8t48zgw1sTSTgd08Wj30rIj8QISBRIihLibb9hKwRzVx+F9fAab44S4n0loFRkKlNUOL5mWrjFsLh2tLKj3md3T4pjmYF8aiXeLGfN4VEmV5mfL+Fn+GsRmk4bhJc/OVFcWybcPgO00cvnkWW5S61qvoQ8/Zo6LkZVzKpTbHy3LaR/XUXKqYSpyPcizMp1NyK+HEHHxinkcPk1aWpfId4= X-MS-TrafficTypeDiagnostic: VI1PR04MB1533: X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB1533; 20:jh3e2ZzjNRvLRPamkxlZv9gIoUnKXkmO/krU1YzNQxxS6j8+OO2mTKZZFJb6ARvPP3VbofBM3XYDkrOfUgV8icDnUO0XkfEcu98JNQt9gPneEkrV8y4QYX++HeN/RqsyAOqn2oHjg8v8reshpzuAHBcWaFx3yH0Gq84iFWt/G/MYQI1Fvnj8WAlva5WOMfuVRrqS0VsTrtvY00PzeKSbbpQVQlAH2tRJylD2vuU9Isu3je7fo0PCBk7IOUICM+FbucWadjM28Zl0sKpmSk3iBgn/251iqroDcnjN7GVJclNxvsKPq94uNj3a+uZ9mfnkPeN3UauOeAPkUogQp4njjsTaA2f02IUJtJxq1jNCWTlAN2LJnqBeJzVeQAjgqlVFeAJu5gepFZSyn75eKzvdYSqvAVIV/u5yr7TdF/MpZBifNyrQ+D3WNWM00wvDg3jj6sF7y5hvmdX3qGv6GYRSGvqAnD2DgoXtsYvSHbHfmy/FDjbexY9ncbiqyJHGwz5K; 4:4BUrRZpoY7M/y6z66KceuON3of6NbZUvVZMEpXSOz4U68tEqZTccozEnnEfiXpNcN576qG0BPLw5JqqJafl8wRz5++tn8nbhqXdGFeTKERmFMQr3UR+778X5izMyI2mk2Z0MkPA5+cRrkScK4+mQbxz9y83rM1xIOWUAF2zlYyC8+Ms/pG995m2to9n/tTkU/0o1yQyNDlWRK52H5qUmiDDRO9paDfN5gWQcmtN4TkE+FURgr68Wu7Ttp5Ze6IEyP8BMwTJxpaGznjw/4TWbV9c8KWfiL2B0Dm864OMdCojC3IL00oum+BrK9PzrF8sb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(3231311)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050); SRVR:VI1PR04MB1533; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB1533; X-Forefront-PRVS: 07943272E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(396003)(346002)(376002)(366004)(199004)(189003)(105586002)(68736007)(48376002)(106356001)(50466002)(11346002)(486006)(76176011)(7736002)(36756003)(305945005)(51416003)(52116002)(86362001)(575784001)(72206003)(478600001)(8936002)(47776003)(50226002)(2616005)(476003)(316002)(446003)(956004)(16586007)(66066001)(4326008)(186003)(16526019)(53936002)(6486002)(26005)(14444005)(97736004)(6116002)(6666003)(6512007)(3846002)(55236004)(2906002)(217873002)(5009440100003)(6506007)(386003)(8676002)(5660300001)(81156014)(1076002)(25786009)(81166006)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB1533; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR04MB1533; 23:8CunjxtZs5R6725Q2jgu/5rTjMaaoXif9jMEeVGdE?= =?us-ascii?Q?zdXQ8vuc1NtdUCjj9FvNhPgL3BeSZdV77zuIAHnRuoa8aLvikWSm/w3ErhDd?= =?us-ascii?Q?Qxack4nrTGuua8glCFbXQtsip/tEBD9PPqXSBGXWiN7QqaLilWZfUMKNZKyk?= =?us-ascii?Q?I+yS7gnZxngYDkt3kqOE2F4WIEKqDzMMvY43/H6TyPRb1I0IhLcv2aDWq7RE?= =?us-ascii?Q?5bkMekc9ik3bJKSlo9Dz8el1hqgP7V53xY6qqdhjIeze/ZtcxCD59OKhcKfy?= =?us-ascii?Q?OTtvhixu5V1HBpwhVhCELW8y7w62R0vjUSaiK3b/pJfjJOYrbbuyqq5KYdcg?= =?us-ascii?Q?3oI2xfAU6bTMEn8pfjameW59aKqAxxA1vM50gQwtuCK4yp9LdqYmB3nffPxa?= =?us-ascii?Q?iMM8QwR7C9/clREpFAZkf9qo53C8EMo17iIfpO14WYOB2V0yG9iDikp2NgIs?= =?us-ascii?Q?lAi6N6MIOk/kQjMkTOz/0M4fHITtMP3lIRKFzNZNLhuIXzVnqSavCfMkouU+?= =?us-ascii?Q?mFrHcik2ctDTY1y/AyNwOgN86xaHTOnOCSpyx8v37/s5mrVZcACOm+PWLEYm?= =?us-ascii?Q?QyuwwqZM/5/nMxY98zWLhLLrmibzIhT/aLbTRiUl9u7gvRd8j6u4RGwHHVRJ?= =?us-ascii?Q?1z1kA+K1CYNG1VBgSULiLiH2MHGgoifI2Ic/5Bo7parTnK68PiW9L6KjPMhp?= =?us-ascii?Q?J39kGM968Tsg4jUt2DZnmYLyFSfTlS/O8kLqINdY+p+VeS2SZ0/FkyJyOpqf?= =?us-ascii?Q?1aGM8Y+nDUh8trYiucFLF6aLfj3eNaEY6ec4OMmumKjhfSsiRYUjpgNQTT01?= =?us-ascii?Q?Txh8/UHm3e98oTspl5YHYt2umcfv9bcc8ass71bRNgnadPBFJDzvyBx7W+fb?= =?us-ascii?Q?KO5B8WP6BGm8ABowZ1V/2GZsrupWtevgiudXQZoKmwT62NNgtygH4wt6hT8b?= =?us-ascii?Q?HiEuBGZEiiaUWuFZ2I1W8M8kkTAe+RVKAYImBlnRUgNdmHcH5W+IHwH5WAw0?= =?us-ascii?Q?D/93/2EyXSzueD/JFOLB9JuhOyVJgrTPswFnPrBfbClyS+jkSA1ZXZlYY+Vo?= =?us-ascii?Q?7pVdXFb23YSbSMNz60aV5vGy4N7MpMBiUmC6P6WvrUwJ3PkirbRYPz4Qfz0f?= =?us-ascii?Q?9lw7jYJmMGvphMdpUgTwKGE95D0rvThLwCjs+9BR8rjVH8Jg30diXsACJmOW?= =?us-ascii?Q?+NrlfrAuvD0BqGJz3Y3fHpcSvSrlRglsaJiVeLv6X/UWnJDYNKhqw0SUsHzH?= =?us-ascii?Q?FFc+GeFw7/312RLRaWyfWhu0D6vlnls2zbEOJqIdjLPk5/WpW727rJqZo7+b?= =?us-ascii?Q?2/koSakmTonzFNOA0rfiCBDBra9VQfptaRWnGJw5/ir?= X-Microsoft-Antispam-Message-Info: sOHqhsfTtUdh9+2LPeV0h9TEy++1UUNleSVdnlTd4wTPAm1h3jhZhXVtL5oonKnY5I09y1hFZkBmSRWEYY2ueNTNNIDmLKnExBCpMFiFKoW8C4PbPOxnoGewfiZ3G/d+wVvmpaW0xCyLjWG/t+sn/hAodONshfxcnV7+5CCgO52j0MiccCSdSjfpWyGxEOpqJ3TfTHQRVhSU39drST8fh67ump+ddZw2diz/NtmypWEcWo9JWoCamfMDE4B9RP7nMZp3bNKz6oqsgL2YKWS/qQv+gvDNx2SkJ4GfgzauUr1azCRwMRKpWirXoB4cMzO4jxkbcb+RzljlSGFz0iAPheU4oqbPXAIUtjdnJFotwEM= X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB1533; 6:grWTdDr9bzpogM4GE9Acy5xE8ZR2gpoRFRt4R2N6FZ9NFMj7fnDiN+HvZ5YCnzA6l7rIKDCN+ZDHG2qG0ND/gpSvCqn57MH9Z4CjqZBW1A1qhYiWJYNOE9OIAeoVRTksVKBknQ0RFFsnfUlAWWRec8iRUXmYDErRojZjWchxPV9FSzoxwyJTneFO/VjE+s2HtKqNUvTgCsQ/7KZFWiyavqPoS5poeX9YLZKncGd5t2cLG9n8M2E/KH2zQbe2OL0Mr9sIg1jAwtnU+XEGFB37HBny2O8VBUEvmr3DlXf/krRbYijiDeVlWejB70TWquw4Q4o7iAcVUobUYqQrEcz3Mz92Tb48Fwf8ey1soQyFQEyt0xZjmEo6Gf38dV58V3Bt7c3RXlFPA5Mcg2/Dp8mzD++L1v73fsgC2jUyoa+35t4D/f9luOHF3hdoSgAYm/PulXUWk5Gyo/YfFJYL9bLPFA==; 5:3h+jHGw5bGepRlSKBLSK3bxpfIRJKIt2HkQOAAVLouZVUw1saGqy2In8Jz6Vmw3xZBzUt74IU2rsIEgCGL016R6IndI9M6w2wwyIsBRouiasYifWwGg9L6exuOPYbqV2ff6VqMFuzPMaXTJANLcAId7vyDXr4QJl7RCekyofOU8=; 7:ylYdJSikeMyImPunLsCWqGbEp2mbW/4pU1zfj/LAm5O6pjurpHZjzBs/SM9hebv6m0vsU50PdJDCNaYqQJ/aGfV0hmwIDsFzB/5Ad7Wvi95uxWGDnAQbNruYbgcAL7yXdq0ml9n3D2No4xRZePbBK+Z+MH4cxmr4qGjZOz8T4gdqpvYCU/Z8SdR/aF3EnxQr8TaP32YCEf0iqm01J+nNaEZvOO/OHzoqQIiS0Ma7JReNyRcVLmtop27ILckP6vQ7 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2018 09:42:32.6798 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2c7c4be8-90d5-4409-3f1d-08d6195d3b51 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB1533 Subject: [dpdk-dev] [PATCH v2 2/3] net/enetc: add ENETC PMD with basic operations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2018 09:42:36 -0000 This patch introduces the enetc PMD with basic initialisation functions includes probe, teardown, hardware initialisation Signed-off-by: Gagandeep Singh --- MAINTAINERS | 1 + config/common_base | 5 + config/common_linuxapp | 5 + doc/guides/nics/enetc.rst | 1 + doc/guides/nics/features/enetc.ini | 2 + drivers/net/Makefile | 1 + drivers/net/enetc/Makefile | 24 ++ drivers/net/enetc/base/enetc_hw.h | 220 ++++++++++++++++ drivers/net/enetc/enetc.h | 111 ++++++++ drivers/net/enetc/enetc_ethdev.c | 269 ++++++++++++++++++++ drivers/net/enetc/enetc_logs.h | 40 +++ drivers/net/enetc/meson.build | 10 + drivers/net/enetc/rte_pmd_enetc_version.map | 4 + drivers/net/meson.build | 1 + mk/rte.app.mk | 1 + 15 files changed, 695 insertions(+) create mode 100644 drivers/net/enetc/Makefile create mode 100644 drivers/net/enetc/base/enetc_hw.h create mode 100644 drivers/net/enetc/enetc.h create mode 100644 drivers/net/enetc/enetc_ethdev.c create mode 100644 drivers/net/enetc/enetc_logs.h create mode 100644 drivers/net/enetc/meson.build create mode 100644 drivers/net/enetc/rte_pmd_enetc_version.map diff --git a/MAINTAINERS b/MAINTAINERS index b999230cc..fc70ac049 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -645,6 +645,7 @@ F: doc/guides/nics/features/dpaa2.ini NXP enetc M: Gagandeep Singh +F: drivers/net/enetc/ F: doc/guides/nics/enetc.rst F: doc/guides/nics/features/enetc.ini diff --git a/config/common_base b/config/common_base index 4bcbaf923..a7fc48667 100644 --- a/config/common_base +++ b/config/common_base @@ -217,6 +217,11 @@ CONFIG_RTE_LIBRTE_DPAA2_USE_PHYS_IOVA=y CONFIG_RTE_LIBRTE_DPAA2_PMD=n CONFIG_RTE_LIBRTE_DPAA2_DEBUG_DRIVER=n +# +# Compile NXP ENETC PMD Driver +# +CONFIG_RTE_LIBRTE_ENETC_PMD=n + # # Compile burst-oriented Amazon ENA PMD driver # diff --git a/config/common_linuxapp b/config/common_linuxapp index 9c5ea9d89..485e1467d 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -44,3 +44,8 @@ CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV=y CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC=y CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF_RAWDEV=y CONFIG_RTE_LIBRTE_PMD_DPAA2_QDMA_RAWDEV=y + +# +# NXP ENETC PMD Driver +# +CONFIG_RTE_LIBRTE_ENETC_PMD=y diff --git a/doc/guides/nics/enetc.rst b/doc/guides/nics/enetc.rst index da775ebeb..9d30e8373 100644 --- a/doc/guides/nics/enetc.rst +++ b/doc/guides/nics/enetc.rst @@ -44,6 +44,7 @@ This infrastructure simplifies adding support for IEP and facilitates in followi ENETC Features ~~~~~~~~~~~~~~ +- Link Status NIC Driver (PMD) ~~~~~~~~~~~~~~~~ diff --git a/doc/guides/nics/features/enetc.ini b/doc/guides/nics/features/enetc.ini index fb1bf5989..83b20845a 100644 --- a/doc/guides/nics/features/enetc.ini +++ b/doc/guides/nics/features/enetc.ini @@ -4,5 +4,7 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +Link status = Y +Linux VFIO = Y ARMv8 = Y Usage doc = Y diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 664398de9..3ad436045 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -24,6 +24,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2 endif DIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += e1000 DIRS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += ena +DIRS-$(CONFIG_RTE_LIBRTE_ENETC_PMD) += enetc DIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic DIRS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe DIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += fm10k diff --git a/drivers/net/enetc/Makefile b/drivers/net/enetc/Makefile new file mode 100644 index 000000000..3f4ba97da --- /dev/null +++ b/drivers/net/enetc/Makefile @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2018 NXP + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_enetc.a + +CFLAGS += -O3 +EXPORT_MAP := rte_pmd_enetc_version.map +LIBABIVER := 1 + +# +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_LIBRTE_ENETC_PMD) += enetc_ethdev.c + +LDLIBS += -lrte_eal +LDLIBS += -lrte_ethdev +LDLIBS += -lrte_bus_pci + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/enetc/base/enetc_hw.h b/drivers/net/enetc/base/enetc_hw.h new file mode 100644 index 000000000..1ec16fec9 --- /dev/null +++ b/drivers/net/enetc/base/enetc_hw.h @@ -0,0 +1,220 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2018 NXP + */ + +#ifndef _ENETC_HW_H_ +#define _ENETC_HW_H_ +#include + +#define BIT(x) ((uint64_t)1 << ((x))) + +/* ENETC device IDs */ +#define ENETC_DEV_ID_VF 0xef00 +#define ENETC_DEV_ID 0xe100 + +/* ENETC register block BAR */ +#define ENETC_BAR_REGS 0x0 + +/* SI regs, offset: 0h */ +#define ENETC_SIMR 0x0 +#define ENETC_SIMR_EN BIT(31) + +#define ENETC_SIPMAR0 0x80 +#define ENETC_SIPMAR1 0x84 + +#define ENETC_SICAPR0 0x900 +#define ENETC_SICAPR1 0x904 + +#define ENETC_SIMSITRV(n) (0xB00 + (n) * 0x4) +#define ENETC_SIMSIRRV(n) (0xB80 + (n) * 0x4) + +#define ENETC_SICCAPR 0x1200 + +/* enum for BD type */ +enum enetc_bdr_type {TX, RX}; + +#define ENETC_BDR(type, n, off) (0x8000 + (type) * 0x100 + (n) * 0x200 \ + + (off)) +/* RX BDR reg offsets */ +#define ENETC_RBMR 0x0 /* RX BDR mode register*/ +#define ENETC_RBMR_EN BIT(31) + +#define ENETC_RBSR 0x4 /* Rx BDR status register*/ +#define ENETC_RBBSR 0x8 /* Rx BDR buffer size register*/ +#define ENETC_RBCIR 0xc /* Rx BDR consumer index register*/ +#define ENETC_RBBAR0 0x10 /* Rx BDR base address register 0 */ +#define ENETC_RBBAR1 0x14 /* Rx BDR base address register 1*/ +#define ENETC_RBPIR 0x18 /* Rx BDR producer index register*/ +#define ENETC_RBLENR 0x20 /* Rx BDR length register*/ +#define ENETC_RBIER 0xa0 /* Rx BDR interrupt enable register*/ +#define ENETC_RBIER_RXTIE BIT(0) +#define ENETC_RBIDR 0xa4 /* Rx BDR interrupt detect register*/ +#define ENETC_RBICIR0 0xa8 /* Rx BDR inetrrupt coalescing register 0*/ +#define ENETC_RBICIR0_ICEN BIT(31) + + +#define ENETC_TBMR 0x0 /* Tx BDR mode register (TBMR) 32 RW */ +#define ENETC_TBSR 0x4 /* x BDR status register (TBSR) 32 RO */ +#define ENETC_TBBAR0 0x10 /* Tx BDR base address register 0 (TBBAR0) 32 RW */ +#define ENETC_TBBAR1 0x14 /* Tx BDR base address register 1 (TBBAR1) 32 RW */ +#define ENETC_TBCIR 0x18 /* Tx BDR consumer index register (TBCIR) 32 RW */ +#define ENETC_TBCISR 0x1C /* Tx BDR consumer index shadow register 32 RW */ +#define ENETC_TBIER 0xA0 /* Tx BDR interrupt enable register 32 RW */ +#define ENETC_TBIDR 0xA4 /* Tx BDR interrupt detect register 32 RO */ +#define ENETC_TBICR0 0xA8 /* Tx BDR interrupt coalescing register 0 32 RW */ +#define ENETC_TBICR1 0xAC /* Tx BDR interrupt coalescing register 1 32 RW */ +#define ENETC_TBLENR 0x20 + +#define ENETC_TBCISR_IDX_MASK 0xffff +#define ENETC_TBIER_TXFIE BIT(1) + +#define ENETC_RTBLENR_LEN(n) ((n) & ~0x7) +#define ENETC_TBMR_EN BIT(31) + +/* Port regs, offset: 1_0000h */ +#define ENETC_PORT_BASE 0x10000 +#define ENETC_PMR 0x00000 +#define ENETC_PMR_EN (BIT(16) | BIT(17) | BIT(18)) +#define ENETC_PSR 0x00004 /* RO */ +#define ENETC_PSIPMR 0x00018 +#define ENETC_PSIPMR_SET_UP(n) (0x1 << (n)) /* n = SI index */ +#define ENETC_PSIPMR_SET_MP(n) (0x1 << ((n) + 8)) +#define ENETC_PSIPMR_SET_VLAN_MP(n) (0x1 << ((n) + 16)) +#define ENETC_PSIPMAR0(n) (0x00100 + (n) * 0x20) +#define ENETC_PSIPMAR1(n) (0x00104 + (n) * 0x20) +#define ENETC_PCAPR0 0x00900 +#define ENETC_PCAPR1 0x00904 + +#define ENETC_PV0CFGR(n) (0x00920 + (n) * 0x10) +#define ENETC_PVCFGR_SET_TXBDR(val) ((val) & 0xff) +#define ENETC_PVCFGR_SET_RXBDR(val) (((val) & 0xff) << 16) + +#define ENETC_PM0_CMD_CFG 0x08008 +#define ENETC_PM0_TX_EN BIT(0) +#define ENETC_PM0_RX_EN BIT(1) + +#define ENETC_PM0_MAXFRM 0x08014 +#define ENETC_SET_MAXFRM(val) ((val) << 16) + +/* Global regs, offset: 2_0000h */ +#define ENETC_GLOBAL_BASE 0x20000 +#define ENETC_G_EIPBRR0 0x00bf8 +#define ENETC_G_EIPBRR1 0x00bfc + +#define ETH_ADDR_LEN 6 + +/* general register accessors */ +#define enetc_rd_reg(reg) rte_read32((reg)) +#define enetc_wr_reg(reg, val) rte_write32((val), (reg)) +#define enetc_rd(hw, off) enetc_rd_reg((hw)->reg + (off)) +#define enetc_wr(hw, off, val) enetc_wr_reg((hw)->reg + (off), val) +/* port register accessors - PF only */ +#define enetc_port_rd(hw, off) enetc_rd_reg((hw)->port + (off)) +#define enetc_port_wr(hw, off, val) enetc_wr_reg((hw)->port + (off), val) +/* global register accessors - PF only */ +#define enetc_global_rd(hw, off) enetc_rd_reg((hw)->global + (off)) +#define enetc_global_wr(hw, off, val) enetc_wr_reg((hw)->global + (off), val) +/* BDR register accessors, see ENETC_BDR() */ +#define enetc_bdr_rd(hw, t, n, off) \ + enetc_rd(hw, ENETC_BDR(t, n, off)) +#define enetc_bdr_wr(hw, t, n, off, val) \ + enetc_wr(hw, ENETC_BDR(t, n, off), val) + +#define enetc_txbdr_rd(hw, n, off) enetc_bdr_rd(hw, TX, n, off) +#define enetc_rxbdr_rd(hw, n, off) enetc_bdr_rd(hw, RX, n, off) +#define enetc_txbdr_wr(hw, n, off, val) \ + enetc_bdr_wr(hw, TX, n, off, val) +#define enetc_rxbdr_wr(hw, n, off, val) \ + enetc_bdr_wr(hw, RX, n, off, val) + +#define ENETC_TX_ADDR(txq, addr) ((void *)((txq)->enetc_txbdr + (addr))) + +#define ENETC_TXBD_FLAGS_IE BIT(13) +#define ENETC_TXBD_FLAGS_F BIT(15) + +/* ENETC Parsed values (Little Endian) */ +#define ENETC_PKT_TYPE_ETHER 0x0060 +#define ENETC_PKT_TYPE_IPV4 0x0000 +#define ENETC_PKT_TYPE_IPV6 0x0020 +#define ENETC_PKT_TYPE_IPV4_TCP \ + (0x0010 | ENETC_PKT_TYPE_IPV4) +#define ENETC_PKT_TYPE_IPV6_TCP \ + (0x0010 | ENETC_PKT_TYPE_IPV6) +#define ENETC_PKT_TYPE_IPV4_UDP \ + (0x0011 | ENETC_PKT_TYPE_IPV4) +#define ENETC_PKT_TYPE_IPV6_UDP \ + (0x0011 | ENETC_PKT_TYPE_IPV6) +#define ENETC_PKT_TYPE_IPV4_SCTP \ + (0x0013 | ENETC_PKT_TYPE_IPV4) +#define ENETC_PKT_TYPE_IPV6_SCTP \ + (0x0013 | ENETC_PKT_TYPE_IPV6) +#define ENETC_PKT_TYPE_IPV4_ICMP \ + (0x0003 | ENETC_PKT_TYPE_IPV4) +#define ENETC_PKT_TYPE_IPV6_ICMP \ + (0x0003 | ENETC_PKT_TYPE_IPV6) + +/* PCI device info */ +struct enetc_hw { + /* SI registers, used by all PCI functions */ + void *reg; + /* Port registers, PF only */ + void *port; + /* IP global registers, PF only */ + void *global; +}; + +struct enetc_eth_mac_info { + uint8_t addr[ETH_ADDR_LEN]; + uint8_t perm_addr[ETH_ADDR_LEN]; + bool get_link_status; +}; + +struct enetc_eth_hw { + struct net_device *ndev; + struct enetc_hw hw; + uint16_t device_id; + uint16_t vendor_id; + uint8_t revision_id; + struct enetc_eth_mac_info mac; +}; + +/* Transmit Descriptor */ +struct enetc_tx_desc { + uint64_t addr; + uint16_t frm_len; + uint16_t buf_len; + uint32_t flags_errors; +}; + +/* TX Buffer Descriptors (BD) */ +struct enetc_tx_bd { + uint64_t addr; + uint16_t buf_len; + uint16_t frm_len; + uint16_t err_csum; + uint16_t flags; +}; + +/* RX buffer descriptor */ +union enetc_rx_bd { + struct { + uint64_t addr; + uint8_t reserved[8]; + } w; + struct { + uint16_t inet_csum; + uint16_t parse_summary; + uint32_t rss_hash; + uint16_t buf_len; + uint16_t vlan_opt; + union { + struct { + uint16_t flags; + uint16_t error; + }; + uint32_t lstatus; + }; + } r; +}; + +#endif diff --git a/drivers/net/enetc/enetc.h b/drivers/net/enetc/enetc.h new file mode 100644 index 000000000..9ed003fc8 --- /dev/null +++ b/drivers/net/enetc/enetc.h @@ -0,0 +1,111 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2018 NXP + */ + +#ifndef _ENETC_H_ +#define _ENETC_H_ + +#include + +#include "base/enetc_hw.h" + +#define PCI_VENDOR_ID_FREESCALE 0x1957 + +/* Max TX rings per ENETC. */ +#define MAX_TX_RINGS 2 + +/* Max RX rings per ENTEC. */ +#define MAX_RX_RINGS 1 + +/* Max BD counts per Ring. */ +#define MAX_BD_COUNT 256 + +/* + * upper_32_bits - return bits 32-63 of a number + * @n: the number we're accessing + * + * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress + * the "right shift count >= width of type" warning when that quantity is + * 32-bits. + */ +#define upper_32_bits(n) ((uint32_t)(((n) >> 16) >> 16)) + +/* + * lower_32_bits - return bits 0-31 of a number + * @n: the number we're accessing + */ +#define lower_32_bits(n) ((uint32_t)(n)) + +#define ENETC_TXBD(BDR, i) (&(((struct enetc_tx_bd *)((BDR).bd_base))[i])) +#define ENETC_RXBD(BDR, i) (&(((union enetc_rx_bd *)((BDR).bd_base))[i])) + +struct enetc_swbd { + struct rte_mbuf *buffer_addr; +}; + +struct enetc_bdr { + struct net_device *ndev; + struct rte_mempool *mb_pool; /* mbuf pool to populate RX ring. */ + void *bd_base; /* points to Rx or Tx BD ring */ + union { + void *tcir; + void *rcir; + }; + uint16_t index; + int bd_count; /* # of BDs */ + int next_to_use; + int next_to_clean; + struct enetc_swbd *q_swbd; + union { + void *tcisr; /* Tx */ + int next_to_alloc; /* Rx */ + }; +}; + +/* + * Structure to store private data for each driver instance (for each port). + */ +struct enetc_eth_adapter { + struct net_device *ndev; + struct enetc_eth_hw hw; + uint16_t num_rx_rings, num_tx_rings; + uint16_t rx_bd_count, tx_bd_count; + struct enetc_bdr *tx_ring[MAX_TX_RINGS]; + struct enetc_bdr *rx_ring[MAX_RX_RINGS]; +}; + +#define ENETC_DEV_PRIVATE(adapter) \ + ((struct enetc_eth_adapter *)adapter) + +#define ENETC_DEV_PRIVATE_TO_HW(adapter) \ + (&((struct enetc_eth_adapter *)adapter)->hw) + +#define ENETC_DEV_PRIVATE_TO_STATS(adapter) \ + (&((struct enetc_eth_adapter *)adapter)->stats) + +#define ENETC_DEV_PRIVATE_TO_INTR(adapter) \ + (&((struct enetc_eth_adapter *)adapter)->intr) + +#define ENETC_GET_HW_ADDR(reg, addr) ((void *)((reg) + (addr))) +#define ENETC_REG_READ(addr) (*(uint32_t *)addr) +#define ENETC_REG_WRITE(addr, val) (*(uint32_t *)addr = val) +#define ENETC_REG_WRITE_RELAXED(addr, val) (*(uint32_t *)addr = val) + +/* + * RX/TX ENETC function prototypes + */ +int enetc_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, + uint16_t nb_rx_desc, unsigned int socket_id, + const struct rte_eth_rxconf *rx_conf, + struct rte_mempool *mb_pool); + +int enetc_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, + uint16_t nb_tx_desc, unsigned int socket_id, + const struct rte_eth_txconf *tx_conf); + +uint16_t enetc_xmit_pkts(void *txq, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts); +uint16_t enetc_recv_pkts(void *rxq, struct rte_mbuf **rx_pkts, + uint16_t nb_pkts); + +#endif /* _ENETC_H_ */ diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c new file mode 100644 index 000000000..06438835d --- /dev/null +++ b/drivers/net/enetc/enetc_ethdev.c @@ -0,0 +1,269 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2018 NXP + */ + +#include +#include + +#include "enetc_logs.h" +#include "enetc.h" + +int enetc_logtype_pmd; + +/* Functions Prototypes */ +static int enetc_dev_configure(struct rte_eth_dev *dev); +static int enetc_dev_start(struct rte_eth_dev *dev); +static void enetc_dev_stop(struct rte_eth_dev *dev); +static void enetc_dev_close(struct rte_eth_dev *dev); +static void enetc_dev_infos_get(struct rte_eth_dev *dev, + struct rte_eth_dev_info *dev_info); +static int enetc_link_update(struct rte_eth_dev *dev, int wait_to_complete); +static int enetc_hardware_init(struct enetc_eth_hw *hw); + +/* + * The set of PCI devices this driver supports + */ +static const struct rte_pci_id pci_id_enetc_map[] = { + { RTE_PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, ENETC_DEV_ID) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, ENETC_DEV_ID_VF) }, + { .vendor_id = 0, /* sentinel */ }, +}; + +/* Features supported by this driver */ +static const struct eth_dev_ops enetc_ops = { + .dev_configure = enetc_dev_configure, + .dev_start = enetc_dev_start, + .dev_stop = enetc_dev_stop, + .dev_close = enetc_dev_close, + .link_update = enetc_link_update, + .dev_infos_get = enetc_dev_infos_get, +}; + +/** + * Initialisation of the enetc device + * + * @param eth_dev + * - Pointer to the structure rte_eth_dev + * + * @return + * - On success, zero. + * - On failure, negative value. + */ +static int +enetc_dev_init(struct rte_eth_dev *eth_dev) +{ + int error = 0, i; + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); + struct enetc_eth_hw *hw = + ENETC_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); + struct enetc_eth_adapter *adapter = + ENETC_DEV_PRIVATE(eth_dev->data->dev_private); + + PMD_INIT_FUNC_TRACE(); + eth_dev->dev_ops = &enetc_ops; + eth_dev->rx_pkt_burst = NULL; + eth_dev->tx_pkt_burst = NULL; + + rte_eth_copy_pci_info(eth_dev, pci_dev); + + /* Retrieving and storing the HW base address of device */ + hw->hw.reg = (void *)pci_dev->mem_resource[0].addr; + + adapter->tx_bd_count = MAX_BD_COUNT; + adapter->rx_bd_count = MAX_BD_COUNT; + + adapter->num_rx_rings = MAX_RX_RINGS; + adapter->num_tx_rings = MAX_TX_RINGS; + + for (i = 0; i < adapter->num_rx_rings; i++) { + adapter->rx_ring[i] = rte_zmalloc(NULL, + sizeof(struct enetc_bdr), 0); + if (!adapter->rx_ring[i]) { + ENETC_PMD_ERR("Failed to allocate RX ring memory"); + while (--i >= 0) + rte_free(adapter->rx_ring[i]); + error = -ENOMEM; + goto err_late; + } + adapter->rx_ring[i]->bd_count = adapter->rx_bd_count; + } + + for (i = 0; i < adapter->num_tx_rings; i++) { + adapter->tx_ring[i] = rte_zmalloc(NULL, + sizeof(struct enetc_bdr), 0); + if (!adapter->tx_ring[i]) { + ENETC_PMD_ERR("Failed to allocate TX ring memory"); + while (--i >= 0) + rte_free(adapter->tx_ring[i]); + error = -ENOMEM; + goto err_second; + } + adapter->tx_ring[i]->bd_count = adapter->tx_bd_count; + } + + error = enetc_hardware_init(hw); + if (error != 0) { + ENETC_PMD_ERR("Hardware initialization failed"); + goto err_first; + } + + /* Allocate memory for storing MAC addresses */ + eth_dev->data->mac_addrs = rte_zmalloc("enetc_eth", + ETHER_ADDR_LEN, 0); + if (!eth_dev->data->mac_addrs) { + ENETC_PMD_ERR("Failed to allocate %d bytes needed to " + "store MAC addresses", + ETHER_ADDR_LEN * 1); + error = -ENOMEM; + goto err_first; + } + + /* Copy the permanent MAC address */ + ether_addr_copy((struct ether_addr *)hw->mac.addr, + ð_dev->data->mac_addrs[0]); + + ENETC_PMD_DEBUG("port_id %d vendorID=0x%x deviceID=0x%x", + eth_dev->data->port_id, pci_dev->id.vendor_id, + pci_dev->id.device_id); + return 0; + +err_first: + for (i = 0; i < adapter->num_tx_rings; i++) + rte_free(adapter->tx_ring[i]); +err_second: + for (i = 0; i < adapter->num_rx_rings; i++) + rte_free(adapter->rx_ring[i]); +err_late: + return error; +} + +static int +enetc_dev_uninit(struct rte_eth_dev *eth_dev) +{ + return 0; +} + +static int +enetc_dev_configure(struct rte_eth_dev *dev) +{ + PMD_INIT_FUNC_TRACE(); + return 0; +} + +static int +enetc_dev_start(struct rte_eth_dev *dev) +{ + PMD_INIT_FUNC_TRACE(); + return 0; +} + +static void +enetc_dev_stop(struct rte_eth_dev *dev) +{ +} + +static void +enetc_dev_close(struct rte_eth_dev *dev) +{ +} + +/* return 0 means link status changed, -1 means not changed */ +static int +enetc_link_update(struct rte_eth_dev *dev, int wait_to_complete) +{ + struct enetc_eth_hw *hw = + ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct rte_eth_link link; + + hw->mac.get_link_status = 1; + + memset(&link, 0, sizeof(link)); + rte_eth_linkstatus_get(dev, &link); + + link.link_duplex = ETH_LINK_FULL_DUPLEX; + link.link_status = ETH_LINK_UP; + rte_eth_linkstatus_set(dev, &link); + + return 0; +} + +static int +enetc_hardware_init(struct enetc_eth_hw *hw) +{ + uint32_t psipmr = 0; + + /* Calculating and storing the base HW addresses */ + hw->hw.port = hw->hw.reg + ENETC_PORT_BASE; + hw->hw.global = hw->hw.reg + ENETC_GLOBAL_BASE; + + /* Enabling Station Interface */ + ENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.reg, ENETC_SIMR), + ENETC_SIMR_EN); + + /* Setting to accept broadcast packets for each inetrface */ + psipmr |= ENETC_PSIPMR_SET_UP(0) | ENETC_PSIPMR_SET_MP(0) | + ENETC_PSIPMR_SET_VLAN_MP(0); + psipmr |= ENETC_PSIPMR_SET_UP(1) | ENETC_PSIPMR_SET_MP(1) | + ENETC_PSIPMR_SET_VLAN_MP(1); + psipmr |= ENETC_PSIPMR_SET_UP(2) | ENETC_PSIPMR_SET_MP(2) | + ENETC_PSIPMR_SET_VLAN_MP(2); + + ENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PSIPMR), + psipmr); + + ENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PM0_CMD_CFG), + ENETC_PM0_TX_EN | ENETC_PM0_RX_EN); + + /* Enable port */ + ENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PMR), + ENETC_PMR_EN); + + /* Enabling broadcast address */ + ENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PSIPMAR0(0)), + 0xFFFFFFFF); + ENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PSIPMAR1(0)), + 0xFFFF << 16); + + return 0; +} + +static void +enetc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) +{ + struct enetc_eth_adapter *adapter = + ENETC_DEV_PRIVATE(dev->data->dev_private); + + dev_info->max_rx_queues = adapter->num_rx_rings; + dev_info->max_tx_queues = adapter->num_tx_rings; + dev_info->max_rx_pktlen = 1500; +} + +static int enetc_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, + struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_probe(pci_dev, + sizeof(struct enetc_eth_adapter), enetc_dev_init); +} + +static int enetc_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, enetc_dev_uninit); +} + +static struct rte_pci_driver rte_enetc_pmd = { + .id_table = pci_id_enetc_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_IOVA_AS_VA, + .probe = enetc_pci_probe, + .remove = enetc_pci_remove, +}; + +RTE_PMD_REGISTER_PCI(net_enetc, rte_enetc_pmd); +RTE_PMD_REGISTER_PCI_TABLE(net_enetc, pci_id_enetc_map); +RTE_PMD_REGISTER_KMOD_DEP(net_enetc, "* vfio-pci"); + +RTE_INIT(enetc_pmd_init_log) +{ + enetc_logtype_pmd = rte_log_register("pmd.net.enetc"); + if (enetc_logtype_pmd >= 0) + rte_log_set_level(enetc_logtype_pmd, RTE_LOG_NOTICE); +} diff --git a/drivers/net/enetc/enetc_logs.h b/drivers/net/enetc/enetc_logs.h new file mode 100644 index 000000000..c8a6c0cf3 --- /dev/null +++ b/drivers/net/enetc/enetc_logs.h @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2018 NXP + */ + +#ifndef _ENETC_LOGS_H_ +#define _ENETC_LOGS_H_ + +extern int enetc_logtype_pmd; + +#define ENETC_PMD_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, enetc_logtype_pmd, "enetc_net: " \ + fmt "\n", ##args) + +#define ENETC_PMD_DEBUG(fmt, args...) \ + rte_log(RTE_LOG_DEBUG, enetc_logtype_pmd, "enetc_net: %s(): "\ + fmt "\n", __func__, ##args) + +#define PMD_INIT_FUNC_TRACE() ENETC_PMD_DEBUG(">>") + +#define ENETC_PMD_CRIT(fmt, args...) \ + ENETC_PMD_LOG(CRIT, fmt, ## args) +#define ENETC_PMD_INFO(fmt, args...) \ + ENETC_PMD_LOG(INFO, fmt, ## args) +#define ENETC_PMD_ERR(fmt, args...) \ + ENETC_PMD_LOG(ERR, fmt, ## args) +#define ENETC_PMD_WARN(fmt, args...) \ + ENETC_PMD_LOG(WARNING, fmt, ## args) + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define ENETC_PMD_DP_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt, ## args) + +#define ENETC_PMD_DP_DEBUG(fmt, args...) \ + ENETC_PMD_DP_LOG(DEBUG, fmt, ## args) +#define ENETC_PMD_DP_INFO(fmt, args...) \ + ENETC_PMD_DP_LOG(INFO, fmt, ## args) +#define ENETC_PMD_DP_WARN(fmt, args...) \ + ENETC_PMD_DP_LOG(WARNING, fmt, ## args) + +#endif /* _ENETC_LOGS_H_*/ diff --git a/drivers/net/enetc/meson.build b/drivers/net/enetc/meson.build new file mode 100644 index 000000000..506b174ed --- /dev/null +++ b/drivers/net/enetc/meson.build @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2018 NXP + +if host_machine.system() != 'linux' + build = false +endif + +sources = files('enetc_ethdev.c') + +includes += include_directories('base') diff --git a/drivers/net/enetc/rte_pmd_enetc_version.map b/drivers/net/enetc/rte_pmd_enetc_version.map new file mode 100644 index 000000000..521e51f41 --- /dev/null +++ b/drivers/net/enetc/rte_pmd_enetc_version.map @@ -0,0 +1,4 @@ +DPDK_18.11 { + + local: *; +}; diff --git a/drivers/net/meson.build b/drivers/net/meson.build index 9c28ed4da..65aa6f60c 100644 --- a/drivers/net/meson.build +++ b/drivers/net/meson.build @@ -11,6 +11,7 @@ drivers = ['af_packet', 'dpaa', 'dpaa2', 'e1000', 'ena', + 'enetc', 'enic', 'failsafe', 'fm10k', 'i40e', diff --git a/mk/rte.app.mk b/mk/rte.app.mk index de33883be..154ae3b2c 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -135,6 +135,7 @@ endif _LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 _LDLIBS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += -lrte_pmd_ena _LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic +_LDLIBS-$(CONFIG_RTE_LIBRTE_ENETC_PMD) += -lrte_pmd_enetc _LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += -lrte_pmd_failsafe _LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e -- 2.17.1