From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0059.outbound.protection.outlook.com [104.47.34.59]) by dpdk.org (Postfix) with ESMTP id C3DDB37B0 for ; Fri, 3 Mar 2017 08:13:45 +0100 (CET) Received: from DM2PR03CA0043.namprd03.prod.outlook.com (10.141.96.42) by BY2PR0301MB0727.namprd03.prod.outlook.com (10.160.63.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13; Fri, 3 Mar 2017 07:13:44 +0000 Received: from BN1BFFO11FD001.protection.gbl (2a01:111:f400:7c10::1:107) by DM2PR03CA0043.outlook.office365.com (2a01:111:e400:2428::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12 via Frontend Transport; Fri, 3 Mar 2017 07:13:44 +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 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.947.7 via Frontend Transport; Fri, 3 Mar 2017 07:13:43 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v237D50E005035; Fri, 3 Mar 2017 00:13:40 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Fri, 3 Mar 2017 18:16:28 +0530 Message-ID: <1488545223-25739-12-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1488545223-25739-1-git-send-email-hemant.agrawal@nxp.com> References: <1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com> <1488545223-25739-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131329988235711689; (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)(7916002)(39380400002)(39850400002)(39450400003)(39860400002)(39410400002)(39400400002)(39840400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(33646002)(626004)(48376002)(50226002)(81166006)(50986999)(8676002)(6666003)(4326008)(2950100002)(8656002)(105606002)(92566002)(104016004)(76176999)(50466002)(85426001)(189998001)(6916009)(305945005)(356003)(38730400002)(2351001)(110136004)(86362001)(77096006)(54906002)(5660300001)(2906002)(5003940100001)(106466001)(8936002)(36756003)(53936002)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0727; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD001; 1:+3Gi2n/12TldAKm0W+mb+U24jTQ6Gu4bIzN+inAmBkuoeR8LVSmvURn/uQ8dfGFZcHIGj/XWHP/UCIEStWfJPrvA7pOSJkrq3r0YDVx6En85SshDH812P4goTUflYynYaSCGWYcB1fXLHaSp7mHTs5UShpE9WCRufPp23XXKZ61eCQu3Fv3KpvzLikdQLlEw9l2fNbqdWsMagDUBKZueyrY1mz8oap4em5R+vQfKDmP72/zyb+I2ysV2Cs+78XWr1bhNrsdSeD6xA/VPPDlbwHxhsNHetmvvH2yaHvS2+Z/N6G9h1535buaP0koyPtE4Ki0eK6ex9i/1XoPRCkUCX1W7GcAfoufPcAXM0UR8O+yGAcaXYZGrDRIdHC0XYXv2Jn5WMG8qLOw9NGQSH9LDgAvAkOssMSa0LDOLCWDfSMZVJIu+BS1U7qz6bvAxuJ64fhQ/B5+N28CEFHRA6AzM7HawPCZDO4rOpdVCCfsko1IvR+utPBOZ7ucpA4Ck8nmtnW5p4aIAAwGHmgwn+eAsMq3ZLdTi7MaEgfwbWAaJHq/vZdgRL1PNv0nBKOs+eb4hMU9ZFXi0gqLBvTa9DLDRY7pDCZTLWJhZy++WKeSLUs2kHysugFfN1knmm/OKcslfxkolmg0d6v6uBkhLEzBhCA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 4ccd5c37-6096-41c2-f368-08d46204d399 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR0301MB0727; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0727; 3:R//4K+EPbeQhkIq1M2hjIFtr0kDsm4AOVxWaX2QE2iE3Nvb1dSBE3YYb5jhTKuJi3hZEuFhBRoBEsi+v5KQS/KlnKYxIbDAMbIi0ljZI9eGuXrvItrGyt7Ay2Pn6sMCEDQ6ZOql33rvHa/OjGKXP0alFO6J1DDx9Sd/BROCuk6RbzFBa9b9i844+SRllrTWRfAFPPF6ustKEL7GeYXW7yym8hvNWbQnB9xJq8qfhpSyjJ7SoWdD8JJB4IBsuDGLzZwCD2iOrAe0yHdW2sJm6RfamCBZIB4eRoZ2oQ4b/YuMQmSM9gXsn/GdBFb5aUVdpAk5rnvqjyeJhQQUbVhdvOJFNkmpAHRiPC98CHbDTvIHfD0ZAbiAS2gCWMM8gfYV8; 25:nm5f0laKDr3HBJO5V7SAOQobDkJdIPYEPOOdzh5XVFkBuLN/HiJpmgc6Sll53a8O+mTLwWWnlppWPbszhad/m86r+gTJ8E0NeQXY+hziaxEnmEh++bdx9xXNkUmW6KhfPXeGfnKXALO9atRFyHi0XgydA9Pdn10c4WT3yl0H52OG7+M0DwNlwsubyJhht0ORmJbyKQjI9pP4/6FnIEsBn7fNRNoS/CkKIdnYVwGtd+fBmFOPLfz4DtzsuZyXL/J3iH3E5T+Wh/DlmFsjKRafiSYQvnqWDdAPKC5d4eqYjIEecG9E4DCdwZPw3oK/IqZhIM1CV3I4XJZ+67GI9WDiIHOA+cJ+5d2PyNYWJqhPQylu77YNFnrpnwGM0f/ohYZpHJ9yamO5gcO34bRd41S75X2PiEN2SSVItmHQz5g+M4UdaC45xYAf4qwOaxqZfbiaOAhF8npskZ+GtO8OXTFQVw== X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0727; 31:7IABJEyk7edfjDxNg/JuAjqHBwXTDATNzqXzvw3OYU9fl2AlQD28muFs2SoxVI/BuAOzP5vTubilmLlyoIMPVVS4Jn6cP3upqD/PHP+itSi8I+6c/iPCS/wpnwRXNU6sk5sD7V+qk0y/LW/vqntqRWyCxB8sXVAOzOJJ0robjYhL7+t0i1yErWrVZ7rXAMxmV76WjyU8XUC7TxGvIV8QERsAYSG28relX1ZfLhBwb6PaToSCmcKc/mCostlm+qjjEaNHKGM2Lr5SBp7yEuqUseo1+4WZKLtR8P84zlFUNRE= 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)(13015025)(13017025)(13023025)(13024025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123565025)(20161123563025)(20161123561025)(20161123559025)(20161123556025); SRVR:BY2PR0301MB0727; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0727; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0727; 4:Fn/lg2akf4AyWkYRfOy8UNJ8oUs4bcgGrg2qXdQv65rMjA/krRSMAi6xOxuFRbYlqPcMjlamNl9HFNKD43lLpmG1DvbInjWLDFywLY/BQwHJqxBDcZkPDVRdi39z6/FRyP8B1geoymoeWwxutTnmxi9yE9luz/jGtxPRb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vQ4ndpU44DonWcaBEJRF7WnnzJUs1sWhdnx73J+bTyDc4hDb6?= =?us-ascii?Q?2cvwlt1sTcKkWTQZf/9Pc2bdfOkZ8i+FGx6vywNL7?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0727; 6:ZbnBgiu6lrkF60ZLmeCfkkzO9fmEASwBvPFWGH4f8vdukI6l1wXOC6xWSX52b38XgSTcBPVdmlX9o1bikhrM3SzA2KiZ7g+bYer92D6AixBDvm8ikWj7KrDsBxM0+2fMKCYNDB71QOZjaMuKiCzOYO2aSuhPlGzkarZQi45nOlKEs+wgNtWlzsOyyp4ndyCFTtaT0tW+x4Q3y0RidVOQGsZYLRiIlbKB25X3wxlQiPkmwKCh/Uk6BNJK7yTYDUTWOrz7yZv8NRFEsb6QMx2D9ymsBIADfIBFaRhOqH3v2si9NVFV8MNABX1Gvw+2+pA6q3A6Xe77ze8aJS13LAxE2kC1mSLxbbA0g/UjibKObb01P02BRcbgjci69VmKaVRizK8D5EMvVmvGZPmr9sHqjlfwXwCISfqSDfBm66rfS7o=; 5:X2NY1sFwG3xNtWGSux5R7xV++cCSyykW3Nu6hmZcGetr2lTl8zxiH+u3rmfRyJU8MpZEjiN303IG4ZNqph1NkeewzU3z60c5oqoCqKKbNIEzXHADK3W9GRaNUa68LQkd2PY69kFKWGo4jJUnvZA4CCw3JZyVWShSYmPDIyXEmOb54K+zGNxNfYcIqalz9lPi; 24:EUlbiqdb0wzLt28E9/AowpS9l7eZsxaZhizFyJKRK5jYBQJhf6gUVkWsyTAaQ5JQS344lC/wiCvrMCyg0/Z6DRTukjvhR1C72odYoKSpOGA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0727; 7:zEOc6Z7n86NE1Qbuj5HX2++h2IuLC++nf+ktGrBJMgfLErsuKJTT9n0v/+ZLYyBHyVp9fz/xxrKMpRv5ixH0SWVw5MbX2R5eBdb/pqj2vRE7oRB81qbLUMkgANLYA2+E5vj61IahoSU7w6QbTFxSpBxSFbED4vOrCo60FbmHO2fxACMHE1JGNsdraiAIVHwOnWUbdMb0YSsHp78Wjoz+gsR34U5S23oZm9XLlTI5wexhQg+fEU4Ng1HMFui7mdCwYyUiNbixmDpOrQhj4C9k7ShnEcP6OrAYxeuM/YpBucQrQuJM2k6JxSCHARbHSKfVJA9XcpFViwXFq6IYepEFIg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 07:13:43.3683 (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: BY2PR0301MB0727 Subject: [dpdk-dev] [PATCHv8 11/46] 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: Fri, 03 Mar 2017 07:13:46 -0000 add support for fsl-mc bus based dpaa2 pmd driver. Signed-off-by: Hemant Agrawal --- MAINTAINERS | 3 + config/common_base | 5 + config/defconfig_arm64-dpaa2-linuxapp-gcc | 5 + drivers/net/Makefile | 2 +- drivers/net/dpaa2/Makefile | 61 ++++++++++++ drivers/net/dpaa2/dpaa2_ethdev.c | 142 ++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_ethdev.h | 44 +++++++++ drivers/net/dpaa2/rte_pmd_dpaa2_version.map | 4 + mk/rte.app.mk | 2 + 9 files changed, 267 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/MAINTAINERS b/MAINTAINERS index 0eda467..faca3d7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -358,7 +358,10 @@ F: doc/guides/nics/nfp.rst NXP dpaa2 M: Hemant Agrawal +M: Shreyansh Jain F: drivers/bus/fslmc/ +F: drivers/net/dpaa2/ + QLogic bnx2x M: Harish Patil M: Rasesh Mody diff --git a/config/common_base b/config/common_base index e7ab12f..1b58313 100644 --- a/config/common_base +++ b/config/common_base @@ -292,6 +292,11 @@ CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_MBOX=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 365ae5a..e63ff56 100644 --- a/config/defconfig_arm64-dpaa2-linuxapp-gcc +++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc @@ -46,3 +46,8 @@ CONFIG_RTE_MAX_NUMA_NODES=1 # 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/net/Makefile b/drivers/net/Makefile index 40fc333..c2f64ce 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -35,6 +35,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += af_packet DIRS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += bnx2x DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += bonding DIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe +DIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2 DIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += e1000 DIRS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += ena DIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic @@ -57,7 +58,6 @@ 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 - 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..4f5dbf7 --- /dev/null +++ b/drivers/net/dpaa2/Makefile @@ -0,0 +1,61 @@ +# 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 + +# library dependencies +DEPDIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += lib/librte_eal lib/librte_ether +DEPDIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += drivers/bus/fslmc + +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..bdef362 --- /dev/null +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -0,0 +1,142 @@ +/*- + * 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, + 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"); + rte_eth_dev_release_port(eth_dev); + 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; + + /* 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 d46a33e..22c22d4 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -108,6 +108,8 @@ _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_DPAA2_PMD) += -lrte_bus_fslmc _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