From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0058.outbound.protection.outlook.com [104.47.40.58]) by dpdk.org (Postfix) with ESMTP id F3E43F947 for ; Thu, 19 Jan 2017 14:25:02 +0100 (CET) Received: from DM2PR03CA0038.namprd03.prod.outlook.com (10.141.96.37) by BY2PR0301MB1573.namprd03.prod.outlook.com (10.163.28.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Thu, 19 Jan 2017 13:25:00 +0000 Received: from BN1BFFO11FD001.protection.gbl (2a01:111:f400:7c10::1:177) by DM2PR03CA0038.outlook.office365.com (2a01:111:e400:2428::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Thu, 19 Jan 2017 13:24:59 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; 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 BN1BFFO11FD001.mail.protection.outlook.com (10.58.144.64) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Thu, 19 Jan 2017 13:24:58 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0JDO4ep015351; Thu, 19 Jan 2017 06:24:56 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Thu, 19 Jan 2017 18:53:40 +0530 Message-ID: <1484832240-2048-16-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> References: <1484679174-4174-1-git-send-email-hemant.agrawal@nxp.com> <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131293058989310032; (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)(7916002)(336005)(39850400002)(39840400002)(39380400002)(39410400002)(39400400002)(39450400003)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(36756003)(105606002)(189998001)(53936002)(33646002)(50226002)(106466001)(86362001)(92566002)(97736004)(2351001)(81166006)(81156014)(8936002)(50466002)(8676002)(48376002)(68736007)(5003940100001)(47776003)(8656002)(2950100002)(6666003)(6916009)(85426001)(626004)(2906002)(76176999)(54906002)(5660300001)(38730400001)(305945005)(104016004)(110136003)(4326007)(50986999)(77096006)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB1573; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD001; 1:TROXTnTH0xs8uLOA0HphNRL27WlPayv3MI1oO0I0Y/lG1THRy8/mO8iVi6TF6SxDLkLy1N3WQ2u0sREHlIigRoAucrc+LipGdxWcIkbOcZxb3J+WJjlkFi/AdxerBXjDuvOIDjZtU+st4fjPtL8w058XzqO5oWjt9VuTRaOJZ+EO2kMZE10RkNi0zDMbb+nz0C37r0vt9hyCfN2Tk3TSO4X7csAmKFp2mkbNNpVqhYqrOeX2VeGWilshG0K/mUndHW9OdCNMxNZIyVP/AwQwf1mf14BTG0EQXu9Y8Q86qU7vMX5cMCwGQGNoP3Q11RQd3QPMh9H48OKvDs0zIxONZXDhWsIuG163w4tTmLUHbeIVcloydMP/oMtZXV4JOQjabhXtFaJNyYDeEzkmo+7CC7M2PUX+PlvJnwGwoLRh2L3w7lv8Oj6HAqNe+NhX9G7DlH/WbZ78ZZmwFeMyOc9AHX+uljXJGbshCaSeBf3a9/vpEeOvdSW6RYJ4k6E6C5RKvGDr0L0zoKJVSYTQ2PcysyXfUboEkhDFbSvyNsnau0h/kOnJ3RjUvEBjLOI9yULjO//MpIWJHkr1gBT2a/j+9p6Z9pWKEaJ5GJZYpDpXgswCCkiAUaq4Y0EldW7JG9Y0UG/T+vQxXxZaMcN/GtaSHAX9RQjBiLzFtCG6leZo7aXiETeb0eQd+oNhcT2y05HC/23MKjckSTwoG8AFKE5RpJmkwslSVDgkW12piNUkt8fqGacA/ZRxsW/uv5ZDOKoj MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 42c3716c-9631-495e-3570-08d4406e90ec X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR0301MB1573; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1573; 3:efh/47VQ3HT1/VsJ+efTOoNrTUB7FmsgpMJMaoyS0Q+UPWETyrSauOADKj17oH8nQepdlCU+seTZaFPDh1BEksKv5NN1Buf8pG9g5rBuD9flFr9oLwHckrNat6U3gnSLWXErhzLBTZRlevbfmdVhPaYVd0Yy6eGuLyykFNtzOeMiJ2fLph2duPS0uru+yAVvt3neYK2quWAAVmJPj7gF3jPr9JoqImn1DW6IP0xiiqfuNTiYmQfCkySAedWjbml45YXSxDx70iid7006GiV0Tjd2RIx9gibJmLLUWg8JN5S6lmVukIQEZPPc2E/jYg1rOFvxiJTmrlt+NJUUMGnLDyLFbDySFL1Uz++v3mytFqlRMza+9rRV2fJZPz5G0ria; 25:8uOj+fQDPIr4NFbwSaNNxmvPvHDWSbAkjKAyOunOwTO+QGZ0TUQClVkdGoHkh8j39vHY6jW4ezmwACzZzUlxyJgOGWSc4LkEhxr4Fnn579BWkr2hQabhfrca4NCKpzEoP3g/Y1J56wOWWFDlf6GHTYbv1IQ9HQ4gscg8k66wMf7gRzsN54Vh8hNuSf9frIOGUnep3TlZeycNE3NhRb2UJ8nYfCTcy3AD2V/vYTvTWstr/LjVdvjCmTvkrN4mJ70BBidHAO++3BmVCf4GU9eys8bRD7l4f2/7O1ypdhZRKotiUcZMgh0aaUzXIXctBPUNuAi3DKU91C++mQviY+KAmBrL0uOewgCpuVT4L/aQo9eaErqbbcSxJnaAGgTdrbG3o9USIx0V5wG9aG+BzblvTj1+YX/bUfYltjzVbDJB1aeKeYvIFYNPzEN58fe1YnO315xJRG/hNaSGqTtrgBpOGA== X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1573; 31:BD7VOcC+m0Ii+qim3qqhNP2lUY1OYBY+OoqV+pObySHteWEtstcN1XyB5Fy+dtzx+BI8P2MbgDuRgYX7RgI3QPm+22X1tiTN0Eu7dTlp+wED/xlhMzCDnm8O9IKwRKx+qAr99Z9AXq62OMfyFzAbnlqxu53wOI9WXn+lnHJL2ccdt1cwZQUNmaDyt73dMe+64zMskMzl2QvB5TCLpAxSPqpN5QvuwNhWgxzsqJzGJgIZ8Lcl7js6XXKJRpmp3R3Ogf2zmmjbc2or8DU9zxIOb/sKTTkMvFPHVmFBncebz3g= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(5005006)(8121501046)(13023025)(13017025)(13015025)(13018025)(13024025)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123559025)(20161123563025)(20161123556025)(20161123561025); SRVR:BY2PR0301MB1573; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB1573; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1573; 4:HL/7wX6CybP66PEyahzpI2F+REdWnlX3a/dWvN2d/DF9Eq4pBZDnD2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: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1573; 7:0ZVm5pO+GH8t0eJkntvmhE21YP/HCy3jyZh3OpVlJNIuLXSyDfxdwpnhAXWTDgU4cg5ecDaI+ztugqHBt5XpJpmJEYcWqm5Ed1jJHPz4adxYQTKDhaU2/2DVruOkeVW7ewRWDdhn+l/4+pBp55IOm0TifpNJqBd+KPO6T3JQZhVnzOHiOGgucDE62O/uy2ue2vHWX6WWTEdbkB2TVHwMK4n75m+lEd0lnJ3w/Uuhg9GT1RgOK2PxjnhHJYFQhh9ICxjo5NWl3C1BoYEH+QzEwu6a9TY9ZL66W3mDmOujqGbR8F1SsPIx7zM7849s2Ik9C+iE0La2LE0+ND5+3EwNeGWTHosNtCoZ3I5MJaY4DdhmeORMWFTp2LqkKyrGSs60sN6Fc0RlQS5LyHXrxFTutI8gznU6ToN4vRwrFtK1CnKAag8uKMpt7xvgxa4LIgdDChGai/OueGlJBZumnBImZQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2017 13:24:58.6346 (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: BY2PR0301MB1573 Subject: [dpdk-dev] [PATCHv5 13/33] 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: Thu, 19 Jan 2017 13:25:03 -0000 add support for fsl-mc bus based dpaa2 pmd driver. Signed-off-by: Hemant Agrawal --- config/common_base | 4 + config/defconfig_arm64-dpaa2-linuxapp-gcc | 5 + drivers/bus/Makefile | 2 + drivers/common/Makefile | 2 + drivers/net/Makefile | 2 +- drivers/net/dpaa2/Makefile | 59 +++++++++++ drivers/net/dpaa2/dpaa2_ethdev.c | 153 ++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_ethdev.h | 44 ++++++++ drivers/net/dpaa2/rte_pmd_dpaa2_version.map | 4 + mk/rte.app.mk | 5 + 10 files changed, 279 insertions(+), 1 deletion(-) 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/config/common_base b/config/common_base index e6b4d60..6f513fe 100644 --- a/config/common_base +++ b/config/common_base @@ -297,6 +297,10 @@ CONFIG_RTE_LIBRTE_DPAA2_COMMON=n # CONFIG_RTE_LIBRTE_FSLMC_BUS=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 800e22b..13c16c0 100644 --- a/config/defconfig_arm64-dpaa2-linuxapp-gcc +++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc @@ -51,3 +51,8 @@ CONFIG_RTE_LIBRTE_DPAA2_COMMON=y # 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/bus/Makefile b/drivers/bus/Makefile index 60e9764..8f7864b 100644 --- a/drivers/bus/Makefile +++ b/drivers/bus/Makefile @@ -31,6 +31,8 @@ include $(RTE_SDK)/mk/rte.vars.mk +CONFIG_RTE_LIBRTE_FSLMC_BUS = $(CONFIG_RTE_LIBRTE_DPAA2_PMD) + DIRS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/common/Makefile b/drivers/common/Makefile index e5bfecb..76ec2d1 100644 --- a/drivers/common/Makefile +++ b/drivers/common/Makefile @@ -31,6 +31,8 @@ include $(RTE_SDK)/mk/rte.vars.mk +CONFIG_RTE_LIBRTE_DPAA2_COMMON = $(CONFIG_RTE_LIBRTE_DPAA2_PMD) + DIRS-$(CONFIG_RTE_LIBRTE_DPAA2_COMMON) += dpaa2 include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 40fc333..f716ca0 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -57,7 +57,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD) += thunderx DIRS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += virtio DIRS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += vmxnet3 DIRS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += xenvirt - +DIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2 ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y) DIRS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += vhost endif # $(CONFIG_RTE_LIBRTE_VHOST) diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile new file mode 100644 index 0000000..9e7f958 --- /dev/null +++ b/drivers/net/dpaa2/Makefile @@ -0,0 +1,59 @@ +# 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/common/dpaa2/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 + +# library dependencies +DEPDIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += lib/librte_eal lib/librte_ether +DEPDIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += lib/librte_pmd_fslmcbus + +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..2295f82 --- /dev/null +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -0,0 +1,153 @@ +/*- + * 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" + +/* Name of the DPAA2 Net PMD */ +static const char *drivername = "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 = drivername; + + 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, + struct rte_dpaa2_device *dpaa2_dev) +{ + struct eth_driver *eth_drv; + struct rte_eth_dev *eth_dev; + char ethdev_name[RTE_ETH_NAME_MAX_LEN]; + + int diag; + + eth_drv = (struct eth_driver *)dpaa2_drv; + + 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"); + return -ENOMEM; + } + } + eth_dev->device = &dpaa2_dev->device; + dpaa2_dev->eth_dev = eth_dev; + eth_dev->driver = eth_drv; + eth_dev->data->rx_mbuf_alloc_failed = 0; + + /* init user callbacks */ + TAILQ_INIT(ð_dev->link_intr_cbs); + + /* + * Set the default MTU. + */ + eth_dev->data->mtu = ETHER_MTU; + + /* 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, + .driver = { + .name = "DPAA2 PMD", + }, + .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..31eca32 --- /dev/null +++ b/drivers/net/dpaa2/rte_pmd_dpaa2_version.map @@ -0,0 +1,4 @@ +DPDK_17.02 { + + local: *; +}; diff --git a/mk/rte.app.mk b/mk/rte.app.mk index a5daa84..c793dd2 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -110,6 +110,11 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet _LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x -lz _LDLIBS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += -lrte_pmd_bnxt _LDLIBS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += -lrte_pmd_cxgbe +ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_COMMON),y) +_LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_dpaa2 +_LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_dpaa2_qbman +_LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_fslmcbus +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 -- 1.9.1