From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0074.outbound.protection.outlook.com [104.47.41.74]) by dpdk.org (Postfix) with ESMTP id D611CF96F for ; Tue, 17 Jan 2017 14:20:02 +0100 (CET) Received: from CY4PR03CA0003.namprd03.prod.outlook.com (10.168.162.13) by MWHPR03MB2477.namprd03.prod.outlook.com (10.169.200.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Tue, 17 Jan 2017 13:20:01 +0000 Received: from BL2FFO11FD033.protection.gbl (2a01:111:f400:7c09::147) by CY4PR03CA0003.outlook.office365.com (2603:10b6:903:33::13) 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; Tue, 17 Jan 2017 13:20:01 +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 BL2FFO11FD033.mail.protection.outlook.com (10.173.161.129) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Tue, 17 Jan 2017 13:19:57 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0HDJ8mK021741; Tue, 17 Jan 2017 06:19:54 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Wed, 18 Jan 2017 00:22:34 +0530 Message-ID: <1484679174-4174-14-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484679174-4174-1-git-send-email-hemant.agrawal@nxp.com> References: <1482988612-6638-1-git-send-email-shreyansh.jain@nxp.com> <1484679174-4174-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131291328006344040; (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)(39840400002)(39410400002)(39850400002)(39450400003)(39400400002)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(104016004)(36756003)(85426001)(81156014)(106466001)(92566002)(4326007)(626004)(47776003)(68736007)(2906002)(50466002)(6666003)(50226002)(6916009)(2950100002)(33646002)(2351001)(110136003)(48376002)(97736004)(105606002)(8936002)(8676002)(81166006)(50986999)(77096006)(38730400001)(76176999)(305945005)(356003)(5660300001)(575784001)(189998001)(8656002)(86362001)(30001)(54906002)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2477; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD033; 1:i8wkviUa7aick9dPIub6HKWxnvgwuNKkypEJP6iY7XWL5uFTO75r7NH1XT4G7iFSInlh5preQbB3mFBV14PuubIQNusjwRAwFRCbIzJc+5Mn+GJAit7SCToPtrSqR8yAqdzJG/ZRjkAC5z2G5srI521Mb0IfPpkRlzA1lIRZOvu2flB9Pg/0Figa/DQ/IrYhD3+s6eKqUazltZwEqmaeUfRvSbK6PICr+Pc2vxQxubB5TQzogq6MdVzQc4wW70fNIyZl25cNjX1qCL/BHS35lIYvPDAHvWCMucWRzr7BmEFMemFR/2j6eVWaGVU3KBWcFrbSx7gUdhNQV75R8oD69u2vj6/Bng6pfzo6S0Ghx7ysQFsAoOkWSNyH043cYpIKjNbt7lTiKFeOr0b0oZGA/++Xrv/6YsN+XMMStINq5UKO4W4s2UijUrvRgzezO5PB5sOpbNk6ck6xi8HlvpoREseZB7vt1OInJlJaeDidB0B2X+3MNxuq6S4vgw63Lgc3grOa7Ahz3FGrRGXCYbWjZx/XPGfK1oLtrt8DA3vg1ssqdfJWYKFc/Cuvtuxm8RawdjsVCDntiGh5R3GZbWVnbJrQk4rNw5To7nd0bhjV44Z/P5qD5cvywe3Qrl0K7pMiaFOWEHcON9tRwMrK27fK2Ng3p8oQkWXTJizOyVVBRfbETb1ln14o9AyK/5lvW58Gcrql1TDPCdThUvR6EsZY7tLcakHCW+lPXrjEg2xJnwEzNC+fN7+hkfve9um+8++o MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 33773e2e-a9e2-4762-ec07-08d43edb8a5c X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR03MB2477; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 3:buKxQ+mgJJxwFhKsZQ1CWoGciOmu/8tW9tPTIgH+Bc7FvVrL2jRv7w2Gm/qXReFd8jM/ccQcVbdFHMYrLg60LMi7gnA8NJJb6AqDjudG5p6M2uHztL1ghJBxNCXL8xrmcfl8bwGl+DNGXT8Pd5yp460LATsyDkl2sLMOP/uz65ZpfN1dEgFwCN3d6df3o8sGJSVVw7UMPvpy8PkSXkNKxzDwAH1hrgpO2yuT5tY6RMrJcfyXsTIDmG1wE5eW+UkpM0pjg7esxcrOPa5rcCO9V3eV4Qvq/t0uP0VNkcXMnXnxZVB1AWE7gpHtkXxfuKBg8qqbRaGzzEQHB3fsCeiTlDNbgrH/RDAqUT8akNuY5szcEpvTQRHLsTM67vzB6RhE; 25:xpZi4t0YyxBtyFU6X/Fw1LE1T5mzKEBPg9HZQKwHJmOZTjzOWW3DxBHBCRFnSuR4ErVuiJuZc9miHaQ9M+9ppheUqOeRFz+g3WTp+6znuTs1sMpbNOfngOzpXPNIhI/TYkpH+GkyW5R/JthHDUXlAXyw/P1A/kcoNeo34nTnXeYOZggqYz7TSrBE14muYJmotP5+jcFojZPInAHQ+72SlY6CwjM5eYeNbNiPlv2vPSsP9gCvPqzR01mf0A5HC8wZaKEHMV9wwtgTJT2yx1Jr36oIiSVbicFxNyzJ2lCWFChfc+sgL29KWX4+Aym7oiXtmnlqqJy8CHaES7OgQ6aJQ9WSDg91LpAfFDngYBnlofxQTLnmx+ymKzrw5TJV/MVXMk/thhl6EayR/kEPu48PF7fYJNhVO68oD+zAXdSYi3tP6JT7D94B7F34n/UdfeygqIyYJNlLiRpCVPQwx6eehg== X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 31:HPu90B7/TbLIsnv7SxHTNI7Kgx3Zngf7LUxgP56LyfmgAt+sqK9Gt94ks+ZdvdxtzgmBMkTVtHkVWf1Hn/dMvmORv15jHDXX6vCGSRGO9IMox06eSk2tEgk4aL/YIR4h97+IZQiYuOzfZPz3JXqxGBQ1gcBahDXpkaTwzFkAjmyemNwz9L2kqtUnTccztpwUFgSm6wgInBrxs8aND1u5jSlWymBxvSs3DcOEl9QNf3/ktUBi+Gt2T2P4eYq9ZZ9PBN+2zGc2yU1iBLrwoag8N0mRgRIkLak9E/sE67sCP5w= 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)(13023025)(13017025)(13015025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123563025)(20161123565025); SRVR:MWHPR03MB2477; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2477; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 4:DVgO058HSLRXpVHd6oMAAUrk/4O5HL4suBfgxQbjTro8pLdEE8ZCh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iagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 7:2RTn+b+ew/II7yWvzKQt2iqJkd+s7YKp+OI+8qXkg7sPe2TiM3stf3Ax6Wp56dPq0B/3ynky+nSUE2v6kWBgorkce8en9o0vrE/5aCclHlTwZZa6D87s6Vjx5fc02kYRP7hhZWjvesmrSS0GaZ3I96kJSLAIvU+3BmeOsEngempYG1FINMLQ26bDKyzDlbYIpWrG8R1MEstsngOItlG/sF6k16lQcpnenWVULCADLWU5sI76aG0t1PEcdd2sjqjw15xUqLPynLyFn4e7ajHNk/QoP1Ig5LZZj3TMId4D7MK9tzWHzD+p9YiD5OQL65i+0ypPnZP71aPc98x+e2q/DETo4wZQLQKIdUdcGgLHZz3bnhRbF8M84BRjLfkUFyRPkGmYD8/d1tEZAK/qORZ+pweEumB6B0KwIp3JnOX6oppcidFFCmced9/1HUrTFLgNRi58u08OqKC3r22CqAK0Pw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2017 13:19:57.6235 (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: MWHPR03MB2477 Subject: [dpdk-dev] [PATCHv4 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: Tue, 17 Jan 2017 13:20: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 b91921d..9448a16 100644 --- a/config/common_base +++ b/config/common_base @@ -290,6 +290,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 bc93230..2bcf67b 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -55,7 +55,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 f75f0e2..438fa2c 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -109,6 +109,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