From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0087.outbound.protection.outlook.com [104.47.36.87]) by dpdk.org (Postfix) with ESMTP id 14FE65323 for ; Sun, 9 Apr 2017 10:09:24 +0200 (CEST) Received: from BN6PR03CA0074.namprd03.prod.outlook.com (10.164.122.140) by BY2PR03MB393.namprd03.prod.outlook.com (10.141.141.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17; Sun, 9 Apr 2017 08:09:22 +0000 Received: from BL2FFO11FD018.protection.gbl (2a01:111:f400:7c09::137) by BN6PR03CA0074.outlook.office365.com (2603:10b6:405:6f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17 via Frontend Transport; Sun, 9 Apr 2017 08:09:22 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; caviumnetworks.com; dkim=none (message not signed) header.d=none; caviumnetworks.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD018.mail.protection.outlook.com (10.173.161.36) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1019.14 via Frontend Transport; Sun, 9 Apr 2017 08:09:21 +0000 Received: from DTS-02.ap.freescale.net (DTS-02.ap.freescale.net [10.232.132.223]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v3989Aoe015502; Sun, 9 Apr 2017 01:09:15 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Sun, 9 Apr 2017 13:41:02 +0530 Message-ID: <1491725483-6619-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1491725483-6619-1-git-send-email-hemant.agrawal@nxp.com> References: <1490362538-20854-1-git-send-email-hemant.agrawal@nxp.com> <1491725483-6619-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131361989620892426; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39450400003)(39380400002)(39850400002)(39860400002)(39840400002)(39400400002)(39410400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(54906002)(575784001)(86362001)(53936002)(77096006)(4326008)(2950100002)(6666003)(6916009)(47776003)(8656002)(50986999)(76176999)(305945005)(5003940100001)(48376002)(50466002)(356003)(36756003)(2906002)(5660300001)(33646002)(104016004)(2351001)(189998001)(81166006)(8936002)(50226002)(8676002)(85426001)(38730400002)(105606002)(110136004)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB393; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD018; 1:dMxIwsWKfrA25WAiAF5KCfKhVBLwRBkr5pnQYkY8eIysXHa/UGtXmAxn0YM3Ow1Zv0f1woebkGl8Ztmh2r9krcBdHCRVXcB/kUMh1uHBzAjUirizIlSXfdZXXwuv4aqyEpCD/cdvEToSTERNoIuhMTJH3IC5gVt21/D7vyYGPBEYIxpqDRwkTiiskMkWMQkZyDtjJS/YcgJPLFuEydqElkdT8o2WhZEHw6k1qOfxPxFPt56ydLoiGDUNCRmuzLr8g2gXwp5wu8XmtIoRIJYflwHkJNhRybWtUDenkcgBPkERw8L9uhpjI33e8dhcf2VPxheaD12LVG6olWW44Xf7xQ2cKvjER6oPUuWL1t6rDTliq5vIViaQ8Tb1ZncGJe1ykzuY3GGLhk47DuWawVhBpMYE3ElQOBk+bnk87a/Xw/2IsyfG6CvDP17E4bB1tAH6teR4Ocs1/aYXgYtT0F1cQMKLa2gjbQ0eMhF2PbdhjcjCV/WOpDcv0f002SNjAujsWHwm7GvuvKEN2h7UrDr2xgOPJhA2X2pOEU42g3mM9xKOy1URFZ5W+qeMCzNVsJyLLI/qnXjIjRk31ZEZwhXW27UClIX99RKpCiY+GnA4YomfBuRDuYMfMd6U0SIc0bLwMv5FAEljEwYIgxlvOa9YNC7qgIpZJd8okY0jKNx0pcU= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 81a88a2a-31c9-43f1-21a9-08d47f1fbacc X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BY2PR03MB393; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB393; 3:8jdfOnlkPOfVAPlBaHYqUTJG/tyu0C4a0cpsQ2wOMwWkHETUFKu0ZQaJf6r52u6OJKkEkYRJ/JUVyCACRDVM7a6tdBJNWmkIet8hUgzHZ7Bd4UIyOTle1TPtbVM2t0ZJhWZvTkzVywNRdGyZQKPg9IiGIRxsIiNwF3jjyMUjLyqhgQbvCCmD87S4GOaPgQOzC1rYaGGy//BwOl8WsnQCiZcvE/l7mYeJW1NbSFB5xWCyKZrtFiaa3wefO1Qd6jaD+tAcNXPPZJ7K+tTIAU/EbixcMs14xAm9AszRChrO/iTQbztuPqanWgW6IvR0a+IechbWNzmZuxQh4e4q9vK6+kjOQwZejUKId6GV0f1BerMgleeflVN2oPreLbE+0oDuFUx/yYPDPeeWJGrFtXQxOxk7d+wak+TRQEZcjoPJYnf8u3RkLJPhCOTmkUu833cQ; 25:1fldoARKB6b+w7ZNho+PTIHoNes0x/9Rgp0ut6zZ6/TGXsalIwTf3+mfS9TWwV+4lgUHWsUQplMf102VqrsEOvetJhQ9ZDzexSlv3usI1hVef8wtRQouqC0eudO5BN+PA7XOF+e/0ONsHtdwNvPBMVODuAnMDuT/9ckL3qdFstADqXCUjHRZHinwUs9+tPo/ft/8TRWnxDaI9xI7QdThZR/XJRYzRoxWEnK+hqyjTJOTsu7o9hFaYchG7Iq0Ec6dNdMTuVQi3mruqgMwetkpkhrbasQFoWTGwYcTG+5fT5pUon20L0n+EzXKBww61M7uQqC1hteyGFZIpKHyyVLhX3nGsd1HpVqIGKODBEy+ffQsqxrLKZuM6+eip+FV9VoMF6qSial60n5E+NJb2S//ojoQjlNNks5e2BCUuqvxzdjTlOnF2uI0golQDAFmiD2HbnfIzpQB6Kux8oA/1sKrgA== X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB393; 31:+9lBPpinINnG0tSAaFvmvThpNm45HSCzw2fNkk+buyl8MHK9eHETttBy0PCednqSfd3vPqbytg5tS2mrqyIgovz7H4r0/rrddXwLDg2WHLjYEW8D5jYm+vEvbxcqBTms92HftNWHmRBlizllXvSaQkh3YBEMspA9PfHeSwiPnxjsnauiMEpiZZREuqzFOcISx9AImylKMsHtA03L78NPzF1SvpBxRkhZrmscC9InYKZHzzSR3mwmZVGxk1HWCmzBaX8m0n02jWaJpp+MYVq64TGkQvxjHIIlBUlVXKMMwkE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(8121501046)(5005006)(13017025)(13015025)(13018025)(13024025)(13023025)(93006095)(93001095)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123556025)(201703131430075)(201703131448075)(201703131433075)(201703161259075)(20161123561025)(20161123565025); SRVR:BY2PR03MB393; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR03MB393; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB393; 4:1sN3s9c6DIhkUIFTVklaOZ7O1GLUa1vUpotWASTNLu4lG9XdDfJ8Ljeamd7+ChHp0PK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j94CblQV1nCEWl0EhoucfgE9YQatgPUSFUnKCV9NnRiH32eg10KZ1dHKcKEslvL1Ei5U= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB393; 7:UVsMWHjjk4iY+S+ZL/JinWeyb/zq0bBCyTFfia/psJURgqI2DqIk8pPygCHeQBFY7QiCx6wmYec2qU/RkDovYIt+FmmJ8irhgM/R9pywsZ2WxUJOy07Vj3jZnidxytRAvz3IOvSFu05oPCVYJRYW4MNEBsLQX6nvy72956lQ+RZSl/ws4BEHuOINSTmtoYavvBVljvflLy9kZVlw6XIqcLnh/JUf6Vo3sQ946hMXME+LP5yC+h+yRs7zJxjMLjZL7arrZo9cgfgxFhwnYdmY07+4YjntM8Rgd8Xx0T72C74xHgkhnuHYue/uakuBdXuxMg5Y+UYgWxdwoYPgJslXkQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2017 08:09:21.9176 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB393 Subject: [dpdk-dev] [PATCH v11 01/22] net/dpaa2: introducing NXP DPAA2 PMD driver 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: Sun, 09 Apr 2017 08:09:24 -0000 add support for fsl-mc bus based dpaa2 pmd driver. Signed-off-by: Hemant Agrawal --- MAINTAINERS | 2 + config/common_base | 5 + config/defconfig_arm64-dpaa2-linuxapp-gcc | 5 + drivers/Makefile | 1 + drivers/bus/Makefile | 4 + drivers/mempool/Makefile | 4 + drivers/net/Makefile | 2 + drivers/net/dpaa2/Makefile | 57 ++++++++++++ drivers/net/dpaa2/dpaa2_ethdev.c | 137 ++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_ethdev.h | 44 +++++++++ drivers/net/dpaa2/rte_pmd_dpaa2_version.map | 4 + mk/rte.app.mk | 6 ++ 12 files changed, 271 insertions(+) create mode 100644 drivers/net/dpaa2/Makefile create mode 100644 drivers/net/dpaa2/dpaa2_ethdev.c create mode 100644 drivers/net/dpaa2/dpaa2_ethdev.h create mode 100644 drivers/net/dpaa2/rte_pmd_dpaa2_version.map diff --git a/MAINTAINERS b/MAINTAINERS index d0a08cb..b783014 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -366,8 +366,10 @@ F: doc/guides/nics/nfp.rst NXP dpaa2 M: Hemant Agrawal +M: Shreyansh Jain F: drivers/bus/fslmc/ F: drivers/mempool/dpaa2/ +F: drivers/net/dpaa2/ QLogic bnx2x M: Harish Patil diff --git a/config/common_base b/config/common_base index c02e259..0caf585 100644 --- a/config/common_base +++ b/config/common_base @@ -311,6 +311,11 @@ CONFIG_RTE_LIBRTE_FSLMC_BUS=n CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL=n # +# Compile burst-oriented NXP DPAA2 PMD driver +# +CONFIG_RTE_LIBRTE_DPAA2_PMD=n + +# # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y diff --git a/config/defconfig_arm64-dpaa2-linuxapp-gcc b/config/defconfig_arm64-dpaa2-linuxapp-gcc index 47a5eee..487ed7e 100644 --- a/config/defconfig_arm64-dpaa2-linuxapp-gcc +++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc @@ -54,3 +54,8 @@ CONFIG_RTE_MBUF_DEFAULT_MEMPOOL_OPS="dpaa2" # Compile NXP DPAA2 FSL-MC Bus # CONFIG_RTE_LIBRTE_FSLMC_BUS=y + +# +# Compile burst-oriented NXP DPAA2 PMD driver +# +CONFIG_RTE_LIBRTE_DPAA2_PMD=y diff --git a/drivers/Makefile b/drivers/Makefile index 19459fd..a7d0fc5 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -35,6 +35,7 @@ DIRS-y += bus DIRS-y += mempool DEPDIRS-mempool := bus DIRS-y += net +DEPDIRS-net := bus mempool DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile index 1aab1cc..d3a3768 100644 --- a/drivers/bus/Makefile +++ b/drivers/bus/Makefile @@ -33,6 +33,10 @@ include $(RTE_SDK)/mk/rte.vars.mk core-libs := librte_eal librte_mbuf librte_mempool librte_ring librte_ether +ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_PMD),y) +CONFIG_RTE_LIBRTE_FSLMC_BUS = $(CONFIG_RTE_LIBRTE_DPAA2_PMD) +endif + ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL),y) CONFIG_RTE_LIBRTE_FSLMC_BUS = $(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL) endif diff --git a/drivers/mempool/Makefile b/drivers/mempool/Makefile index 8fd40e1..a51ef9a 100644 --- a/drivers/mempool/Makefile +++ b/drivers/mempool/Makefile @@ -33,6 +33,10 @@ include $(RTE_SDK)/mk/rte.vars.mk core-libs := librte_eal librte_mempool librte_ring +ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_PMD),y) +CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL = $(CONFIG_RTE_LIBRTE_DPAA2_PMD) +endif + DIRS-$(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL) += dpaa2 DEPDIRS-dpaa2 = $(core-libs) DIRS-$(CONFIG_RTE_DRIVER_MEMPOOL_RING) += ring diff --git a/drivers/net/Makefile b/drivers/net/Makefile index bac7057..7a26d65 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -49,6 +49,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += bonding DEPDIRS-bonding = $(core-libs) librte_cmdline DIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe DEPDIRS-cxgbe = $(core-libs) +DIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2 +DEPDIRS-dpaa2 = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += e1000 DEPDIRS-e1000 = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += ena diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile new file mode 100644 index 0000000..c91e743 --- /dev/null +++ b/drivers/net/dpaa2/Makefile @@ -0,0 +1,57 @@ +# BSD LICENSE +# +# Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. +# Copyright (c) 2016 NXP. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Freescale Semiconductor, Inc nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_dpaa2.a + +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) + +CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2 +CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc +CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include +CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal + +# versioning export map +EXPORT_MAP := rte_pmd_dpaa2_version.map + +# library version +LIBABIVER := 1 + +SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_ethdev.c + +LDLIBS += -lrte_bus_fslmc + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c new file mode 100644 index 0000000..939c56c --- /dev/null +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -0,0 +1,137 @@ +/*- + * BSD LICENSE + * + * Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (c) 2016 NXP. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Freescale Semiconductor, Inc nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "dpaa2_ethdev.h" + +static struct rte_dpaa2_driver rte_dpaa2_pmd; + +static int +dpaa2_dev_init(struct rte_eth_dev *eth_dev) +{ + /* For secondary processes, the primary has done all the work */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return 0; + + eth_dev->data->drv_name = rte_dpaa2_pmd.driver.name; + + return 0; +} + +static int +dpaa2_dev_uninit(struct rte_eth_dev *eth_dev __rte_unused) +{ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -EPERM; + + return 0; +} + +static int +rte_dpaa2_probe(struct rte_dpaa2_driver *dpaa2_drv __rte_unused, + struct rte_dpaa2_device *dpaa2_dev) +{ + struct rte_eth_dev *eth_dev; + char ethdev_name[RTE_ETH_NAME_MAX_LEN]; + + int diag; + + sprintf(ethdev_name, "dpni-%d", dpaa2_dev->object_id); + + eth_dev = rte_eth_dev_allocate(ethdev_name); + if (eth_dev == NULL) + return -ENOMEM; + + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + eth_dev->data->dev_private = rte_zmalloc( + "ethdev private structure", + sizeof(struct dpaa2_dev_priv), + RTE_CACHE_LINE_SIZE); + if (eth_dev->data->dev_private == NULL) { + RTE_LOG(CRIT, PMD, "Cannot allocate memzone for" + " private port data\n"); + rte_eth_dev_release_port(eth_dev); + return -ENOMEM; + } + } + eth_dev->device = &dpaa2_dev->device; + dpaa2_dev->eth_dev = eth_dev; + eth_dev->data->rx_mbuf_alloc_failed = 0; + + /* Invoke PMD device initialization function */ + diag = dpaa2_dev_init(eth_dev); + if (diag == 0) + return 0; + + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + rte_free(eth_dev->data->dev_private); + rte_eth_dev_release_port(eth_dev); + return diag; +} + +static int +rte_dpaa2_remove(struct rte_dpaa2_device *dpaa2_dev) +{ + struct rte_eth_dev *eth_dev; + + eth_dev = dpaa2_dev->eth_dev; + dpaa2_dev_uninit(eth_dev); + + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + rte_free(eth_dev->data->dev_private); + rte_eth_dev_release_port(eth_dev); + + return 0; +} + +static struct rte_dpaa2_driver rte_dpaa2_pmd = { + .drv_type = DPAA2_MC_DPNI_DEVID, + .probe = rte_dpaa2_probe, + .remove = rte_dpaa2_remove, +}; + +RTE_PMD_REGISTER_DPAA2(net_dpaa2, rte_dpaa2_pmd); diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h new file mode 100644 index 0000000..5778780 --- /dev/null +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -0,0 +1,44 @@ +/*- + * BSD LICENSE + * + * Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (c) 2016 NXP. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Freescale Semiconductor, Inc nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _DPAA2_ETHDEV_H +#define _DPAA2_ETHDEV_H + +struct dpaa2_dev_priv { + void *hw; + int32_t hw_id; + uint16_t token; + + uint8_t flags; /*dpaa2 config flags */ +}; +#endif /* _DPAA2_ETHDEV_H */ diff --git a/drivers/net/dpaa2/rte_pmd_dpaa2_version.map b/drivers/net/dpaa2/rte_pmd_dpaa2_version.map new file mode 100644 index 0000000..8591cc0 --- /dev/null +++ b/drivers/net/dpaa2/rte_pmd_dpaa2_version.map @@ -0,0 +1,4 @@ +DPDK_17.05 { + + local: *; +}; diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 4c659e9..8f8189f 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -113,6 +113,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x -lz _LDLIBS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += -lrte_pmd_bnxt _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond _LDLIBS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += -lrte_pmd_cxgbe +_LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_dpaa2 _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 @@ -165,6 +166,11 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += -lrte_pmd_sw_event _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += -lrte_pmd_octeontx_ssovf endif # CONFIG_RTE_LIBRTE_EVENTDEV +ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_PMD),y) +_LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_bus_fslmc +_LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_mempool_dpaa2 +endif # CONFIG_RTE_LIBRTE_DPAA2_PMD + endif # !CONFIG_RTE_BUILD_SHARED_LIBS _LDLIBS-y += --no-whole-archive -- 2.1.4