From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0053.outbound.protection.outlook.com [104.47.34.53]) by dpdk.org (Postfix) with ESMTP id 0B2B169D8 for ; Tue, 11 Apr 2017 15:49:55 +0200 (CEST) Received: from BN6PR03CA0007.namprd03.prod.outlook.com (10.168.230.145) by BN3PR03MB2276.namprd03.prod.outlook.com (10.166.74.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17; Tue, 11 Apr 2017 13:49:53 +0000 Received: from BN1BFFO11FD007.protection.gbl (2a01:111:f400:7c10::1:160) by BN6PR03CA0007.outlook.office365.com (2603:10b6:404:23::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.10 via Frontend Transport; Tue, 11 Apr 2017 13:49:53 +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 BN1BFFO11FD007.mail.protection.outlook.com (10.58.144.70) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1019.14 via Frontend Transport; Tue, 11 Apr 2017 13:49:53 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v3BDnjFo000706; Tue, 11 Apr 2017 06:49:50 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Tue, 11 Apr 2017 19:19:17 +0530 Message-ID: <1491918578-4902-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1491918578-4902-1-git-send-email-hemant.agrawal@nxp.com> References: <1491725483-6619-1-git-send-email-hemant.agrawal@nxp.com> <1491918578-4902-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131363921937092640; (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)(39840400002)(39860400002)(39400400002)(39450400003)(39850400002)(39380400002)(39410400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(50466002)(48376002)(4326008)(104016004)(47776003)(2906002)(50986999)(575784001)(36756003)(38730400002)(76176999)(2351001)(105606002)(106466001)(33646002)(189998001)(110136004)(356003)(86362001)(97736004)(77096006)(305945005)(85426001)(53936002)(8676002)(8656002)(81166006)(54906002)(5660300001)(8936002)(50226002)(6666003)(2950100002)(6916009)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2276; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD007; 1:qJFF3JpR1iOQ0tX9EilPgDBInShiPjcBtDv0SyjjfT4Xyhz76eozxK8QV7pX76/TVYmdACCWrwEDpxOv3mXkNVaYEAWRKxXtyEK6AKYmrAj4T4Bag3DAtXx9b4GSmiVsdnXHqhfp4UMIZPxw431b98J3T4dsiZ+u73pOo31cDtB6vT+1xQuazcrwoSF+yXfWbcyzg2UBLZ9w1wWMMZ9pub+GJ8RXh5sTXHXq7NMdi6pZM5KgfOMiYEsl8XMn3yGMFRBrURnteqqS0wH0EqndfyyVSRCi9qeI8VLjXrZTR3PiIb1e+uUTleObrQFKzO+zoJXsZJV4Fl7qHlWN9pRYCXnQ2uV9Fx8jBTAytAPbcyR+/BwvuNH71BD5exSS9ek4985iLaImILLEML2Eoe0afgxekGe8VO7Ye24C86FSfKbVWIJThLcM+EVgRRU7vJZuwIVVr0MKSRg0D+FMXLWenDZ+PXHfRw/9WR4z2TYowysGcLnOFVlsqxf4Hndi95axJ1nOkQEtRMa/j+mWY6glK5Svf14v/CNCQeoZcjlm9VkHumUFnHLuwK8i0fqkwegKCXONczRoEJx+PAuZNvjsnMZQlz4S9FsZhG6V5XDaadNuia8ZEwtoZtod7aQCqw1BtMhv3Z8h61rSBk0cC0rdOdCLNqgIjxy8tGRDlyaFB6U= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 8a7e7d29-cc55-4251-6ec0-08d480e1a1d1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030255120)(201703131430075)(201703131517081); SRVR:BN3PR03MB2276; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2276; 3:wdNZLy31/Ji9gTPGi1ZqYrwfsxAT+R6SVIxvICoumAaLstYl9awDkmQDgJqyhfrCwm2D3VC4KYAF4+9Pyc72DKkpqg6+yisvm3ho2g97DgCCEYDfPYyOv+wxe0JmjsGIiPtyNMWuC7eKCY7q7VagCTK5ndsGv3V3uHcqqELfs419uzeNCiqxv2n6tnyOA3EomFb897zhfdIahwTCyAr6Azl+LOkRTEcVxc1fRZ0xZBXVg5fks+VVE7cHEJEOR+CgXSl+n0giNuAcTWt/qn0bRS5kI+ueYGERrD75vRCvX5S2ih/g+FVGjWmjyUkH3/IWbq5Hg76fYZ8XG0cN7fYCGXAQQgecYymkzhWZdFWQnhBxl7O1nL/4+SWijAuWitcZehyy/YHJpW0iojavd6uyhWgHja/rLsvAdszlWBlMgHqihDud2IfUkoLnOvgfpeHB3mIlnfTLQ2jD9f5+IqxumQ==; 25:yWnJNhoGMG9T1gelZK6+XHvuqA8JRM1IZPSFCTvrsmE7OqZIgIsOn2cTv8brIKppYGC+K+ST09ivYBETc+ueXoz4ha0y91v8Sork2LCRZlz4+bmHcFCW2vvFScMpmKhtesQD7qrK08Paj/d+DTwmnDrAb1lq7DWE1tiPDz8B2blDWLAk781WUQS2TAdKTtvPMxV4ih8VDXFz5+LO6iSvnd2SqJV+NM+nh7O1q8dY7p9AYl3v4UWGXkzXD0fR0qMuZrdW7NtnoUCCiwaSDfxx2MhbHomwUMZw4mz5zMQJd74hJ+GlrAOCPRvx6BYdHqjWkp8h80h6U5ngkO9nRx+k8frqnJQFH9duon7XOINzRZjxyNM2QhDT54Xm+LRIVwUU4fkpEH4bcckXNY/XGffzPrbW1IUCbxRh3OabTqK5JlqEHQAQxqJgxXAeTXLoakqSOUd/3/TBkW96KJt4JQR/SQ== X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2276; 31:9SIB7EP4FVR89cxy1RW+6U/fn7AH6qBjkTETTZR1fGlCPVL/I6QAx7RlBbNinFXe1F1DzCcYTCvJL5K3HjXmruZXRkS//QwssampiUFOkZ9RRg1Ojk9EInL2obSer4gBlJBuW9Xje8JXxcr3XDz2MofoSTs6RpFxBIMJJYeaPWfejRIfT8JjLRR6xiTX+pD3cRj0IZMiHhjoxwUlmv+UgALQsdEZADLQPIo0HsqoEBPdRj4K75FqRk4HI2fEUUV+ax95vTQJYRoHpYATMtHYahJktnnz25C6LTtHQr5TTWM= 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)(13015025)(8121501046)(5005006)(13017025)(13024025)(13023025)(13018025)(93006095)(93001095)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123561025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259075)(20161123556025)(20161123565025); SRVR:BN3PR03MB2276; BCL:0; PCL:0; RULEID:(400006); SRVR:BN3PR03MB2276; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2276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jUtCECzKL7wQ5AQFoQ8e8OShK/p4NW/LAhix+m; 24:PkVTJEZP/XmKFxkJ2GNpanvU65911g3kJXdIt7136hMh/4vfY3/AkO9/EoS9tAVHUhBhGog2Z49JK9WSgq1a/arE9cDyyqPz/utHGI3UiYc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2276; 7:7nPehStWHAiDlrYKwpsV2Sn3qgmegYnIdD5+VXGZ6Szsthcxo+dTdrJoA2df4bdSqsbMD/egcpg1cL3GO9j9eokeEUbp3qC9ikQIpIaKf57MBvV8l0xH3gF0HT+KvRRlH2v+js4jdOB7NZjYQoeHACx/+/vqJYXox5aRZyUVKS6OkfWDcHlhZNTxHSlSi52BrMfqSzIK6voQgbMAgkTkXO6AWfdOTBsNgknS42XmySBVJwW68W5s6iFsqtdQecvGj+vxqHLkR+PLqwWIvZQMggZl6px99fpZo4Rm+cgXGYFLHH+0jWdu1ucpJtRo25aXZRwn9tMT9bk2Kmhulr0VNg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2017 13:49:53.5064 (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: BN3PR03MB2276 Subject: [dpdk-dev] [PATCH v12 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: Tue, 11 Apr 2017 13:49:57 -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/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 ++ 10 files changed, 263 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 cd57447..61e8fa2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -374,8 +374,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 ab0750b..5812b00 100644 --- a/config/common_base +++ b/config/common_base @@ -309,6 +309,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 0c280d8..d2f174e 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/net/Makefile b/drivers/net/Makefile index fadd13a..35ed813 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -51,6 +51,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..829d1b9 --- /dev/null +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -0,0 +1,137 @@ +/*- + * 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 +#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 0e1a79f..3530ab0 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -114,6 +114,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 @@ -166,6 +167,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 -- 1.9.1