From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0087.outbound.protection.outlook.com [104.47.41.87]) by dpdk.org (Postfix) with ESMTP id 9A94BC254 for ; Fri, 17 Mar 2017 14:09:01 +0100 (CET) Received: from DM5PR03CA0010.namprd03.prod.outlook.com (10.175.104.20) by SN1PR0301MB1968.namprd03.prod.outlook.com (10.163.224.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.961.17; Fri, 17 Mar 2017 13:08:59 +0000 Received: from BN1BFFO11FD010.protection.gbl (2a01:111:f400:7c10::1:122) by DM5PR03CA0010.outlook.office365.com (2603:10b6:3:118::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.977.11 via Frontend Transport; Fri, 17 Mar 2017 13:08:59 +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 BN1BFFO11FD010.mail.protection.outlook.com (10.58.144.73) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.977.7 via Frontend Transport; Fri, 17 Mar 2017 13:08: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 v2HD8peN021077; Fri, 17 Mar 2017 06:08:55 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Fri, 17 Mar 2017 18:38:23 +0530 Message-ID: <1489756124-10805-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1489756124-10805-1-git-send-email-hemant.agrawal@nxp.com> References: <1488545223-25739-1-git-send-email-hemant.agrawal@nxp.com> <1489756124-10805-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131342297390357190; (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)(39380400002)(39450400003)(39860400002)(39850400002)(39840400002)(39400400002)(39410400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(9170700003)(47776003)(54906002)(105606002)(5660300001)(305945005)(2351001)(189998001)(356003)(85426001)(86362001)(50466002)(575784001)(33646002)(48376002)(50986999)(106466001)(76176999)(2906002)(4326008)(110136004)(5003940100001)(2950100002)(8676002)(50226002)(6666003)(38730400002)(81156014)(104016004)(36756003)(8936002)(6916009)(77096006)(81166006)(8656002)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB1968; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD010; 1:p4ARlpmLiTYck/d0us3XPZSD8OtA5a+gKgXuHXASIh8y1FYpfCBxCaIU643zWm/EPmKU/Lo8Io2zi3gxenxEqUUkIgNHgd5302eLBadUc3K7ayql6T+B3YMIGcarPcV70O2eMpSpoJHB6q4IWCB1qraKb13tnV11S84mqIv3Y8Pm/CQh1pNcLXokTaA+qGJ3xEzwthUB8dt1xIl5ssmn+XJnuxD8Utdcps3wODKYRuMpqywKdQXy0TyiYl8DxygJriNqwDzwyy1IdEkhN5RQ8+/um46cTx8/XyLIfk9XxFn6i9u/eVuP7Tw5DVXOUkAFaMwewTO1aOXN9Ia+ODhwSdp71j/xuL1Uezp3LPyL+z4SPdPYYvHVRvJcAXXMYzesYhZRrXnbgOqSpz7s4kWEmu+IOEot4pLASAjigpid7UUkGCXmyMFm6/yRbhB8td0vJ3n7FZag88qcb0bDUmx7C65dfy8UUjAlup08xeIFUYAYnGZ0/UY12jPfuBvl3dENsqVoyKLn+iufseptm8AzdVljvZpx/TRHfeSU1CcGemgT2TRbY/82zfj6i90yJ+GcIwXOQRQtmYCdvT6WcBSldekNon3r4av3v3Jm1UQc/BaiYP3Yny5FV8p8RiHGe21D088UWyOZxWycuNXXK9/SVA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 3d1be0f6-89db-4861-9ac6-08d46d36c666 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:SN1PR0301MB1968; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 3:jcEHVODI5W5cY8b1tnM7QUUb6x0w0E8VHSMI/OexmwgxmaOVn6Oq6Ih5mA9WjmYeqPXrolaY40O9N2V9BjljqPLzoqcuUQ5GbtzeTrPmlHBkCYaa4PALVu727kpJefOgwlWb1QAxL8M/VKB+JwbrWm/i/7m5qAZ+JUZOhOwzteOgO/QjZUGamUb7T+P+pD5mBj5yJmKjeQLaYrIlon7Ntlx8kEoXD5J+RBa1EnlFR5lBhtrk4gjFiJmovfjmWVnSkhbAPpLycCHAKQUrLZOw5wHcZUu1ek6/rC4U/hQQrUFrvCXajfIJKHZ/2aVrE+FEg456LBDJ9rDgA+G6m+sWMu8anFJAYBMZJsxw0oci06/mlLPlAV4tbEnKaB7j+o/d; 25:DxLPbh9JmRGnVg/bA46Ls4Jz6jzXhUwnLGYcxlBaf7Kf/CiH8LjjjNqeK3QwYSIT6WLK4aK5Ryu1o1y9E11E10cFPa6lVXpe9cqCey0pzRUFn89E1G9uFNUjaStsWQEHOwg08i7lWotl+fQUjWlzWxFpOpcULEg2wxXlraH5oE/gaFVxHKKHRh1u4Jh46Edg7tEzz7yyzi9ljxXJfQXiB5GyOTTpcZUbHp+UjiAo4adckRbn1ssTxZsZ/ihrSP6BZ69NoBi2ZxBRRc6eIo3D0cQrnzzai6yonA+o3+bWDpZPVONRFxilFX5sNOTNi3gTXF8Hx9aCR9QR6b+KclnIJWgC9tcT4CFOviPoU/He8J/w1nQSXoxK7NCEgG6dURYjuU7nsFmyOnB5EgidVbvK73NGEY9ND3IPIKrdo18J/t2hI44YwxOoF5zjl7C3iMaA8jzyjyGxlhHixHEWYMF+CQ== X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 31:q6gPSe6DLxFa3UlbKg2EOWHvDsXNJNDfPWVZO/IXemQGWugmnkFIB3PM3ue8NYw92XK8t8MkGQN9wmLLa6UhkAvM4D+lqk/LJsJqV0KLaN3Cvq0UKxm6FCkuVMsa3X2mXWkFEC1BwOmZrk26UiEs4RwtcTkXu7VMNPfwyzcaietkE2zbZtro76z5aI3eZ/KLAOirjjPlio7vooH8Fa0UChGxUGqSfbjtmlYl3tkl7kYho+oyzIb4bsKE22of8o7DggCdfVZCdtV5WxJt1LmW+YgyYFYChB0w68RXhrf0ac4= 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)(5005006)(8121501046)(13015025)(13018025)(13024025)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123565025)(20161123559025)(20161123561025)(20161123556025); SRVR:SN1PR0301MB1968; BCL:0; PCL:0; RULEID:(400006); SRVR:SN1PR0301MB1968; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 4:PMTSEbgic4Dg3R5v0Ic/y3ZkY3vh06R+NgV6aCdIe75nsybaxpKiLzGG/89LYbj1fLXXZGN4MA3o+Q3N4xIyTenfWI7fAf4DsIoh4CeCqSy7eFYPzyLLTl38hhHdtIbe6hCG7JsnJeOEqCoufojdMhN+OztFskH0ApkjbX1io8egnuhqxvo4BOiX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UOoyT6JHx?= =?us-ascii?Q?LvVjykOXOUfCEUI6prX6zGSMVX3MSvF1yApeqrH1U?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 6:JhikC1559/ZZAWUxN36xQKVoFcTj/SIxvSblZ2MbhZxoXa2+I9mfTn5n/ju8hphKTThIQoFv1pIAW+w28pgS2J8x+pytLNbghLeLYKGmld8qHssUpkwR+clyl0fqY/w/KwS+nahxpkSV/+B/FZnXDYP8enLNzMX/R4dpAoin1u+GPyt198k+jeR6MtUqzwRbqihcZjWAEABPVTH1WMZpx5y+IojarQbKVdPql1qk0ZpPn+yFOD35eTjCgfXo5PeCCB4Q7AMgYI4HSl5vfjtIQ+dqdwVOOHF1Q6oOWEEE61qEvCAYTESNapSOP4OSqVeLZJ8PfGa476SRT9zOVkrjO1dFig5RfYa1PalSLyYvsXzoKROoe44qBD99i6VjDtlh98Pnal7WpOsh1VjB/262MbdFfduve3WHHJjoH3AbO8s=; 5:AvJ3r1yKjIWmZOg8eBwlqRqyjo/npDKy+bG0hB05moJKvHGjHuBXODukpfwFWcsqoefJu5M0MxUVJMaO1fe7vAjV7LSYWxqVn5RqjmMnA1qr08jkfR6ixyBeagaXzjNKnK6ZPY9TIQfjtvSk8ySVOnS4BrXBgECV9YfEy6jgI4JmTWjsHG3dESZX1zbv4pvS; 24:dKX6W0bvjfk4ORSShnkpJ6CiHVCTVvcL0HOqDwUR7RqcJCuD8EPfKvEnvNVGkF5j2MkNihu/VNZEagU3hGszBmMEt2/SHxwIQTjJvJpcSls= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 7:Fn7J4jO0lFAmMVy8NuhA/YsN6EPdt07RtOfUGzO+JVEjqpwQm3FfboPw48p8BIT2kmW8do4eksc8uR2fSVO3Bvk+z+UZFrTaP8M1CEWvAfelFAKQKL5B1DnVYqGUvWi/Go3UstOk4oKyc4ANvxJ0SDKX0/BS9/B/Nye38CmC0WkGPdPkJTJLuGOTyM25cEUwfrC6hRHmnQUAY1fVaEudek0IuHV9THxuLHOPXqFbVPVEbg8W+wVmsaUZhWZ0WhVVC7Qgnsef24yorcj3GsuAR0nIaZXlveFsQSTj0saiDmmW0ZjBnFieVXRatYlnVcdZA9EkmDWkfv2EEGqBBeZ1lA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2017 13:08:58.8485 (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: SN1PR0301MB1968 Subject: [dpdk-dev] [PATCH v9 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: Fri, 17 Mar 2017 13:09:02 -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/net/Makefile | 2 +- drivers/net/dpaa2/Makefile | 61 ++++++++++++ drivers/net/dpaa2/dpaa2_ethdev.c | 138 ++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_ethdev.h | 44 +++++++++ drivers/net/dpaa2/rte_pmd_dpaa2_version.map | 4 + mk/rte.app.mk | 6 ++ 9 files changed, 266 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 229b919..1b1e1d7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -351,8 +351,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 1c3bbe0..8ec3591 100644 --- a/config/common_base +++ b/config/common_base @@ -302,6 +302,11 @@ CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL=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 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/net/Makefile b/drivers/net/Makefile index a16f25e..487b917 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 @@ -56,7 +57,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..79ee08d --- /dev/null +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -0,0 +1,138 @@ +/*- + * 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 0e0b600..79320e6 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -108,6 +108,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 @@ -150,6 +151,11 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += -L$(ARMV8_CRYPTO_LIB_PATH) - _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += -lrte_pmd_crypto_scheduler endif # CONFIG_RTE_LIBRTE_CRYPTODEV +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 -- 1.9.1