From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0079.outbound.protection.outlook.com [104.47.38.79]) by dpdk.org (Postfix) with ESMTP id F3173D00F for ; Fri, 24 Mar 2017 14:35:52 +0100 (CET) Received: from BN6PR03CA0034.namprd03.prod.outlook.com (10.175.124.20) by DM5PR03MB2794.namprd03.prod.outlook.com (10.168.198.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Fri, 24 Mar 2017 13:35:51 +0000 Received: from BL2FFO11OLC005.protection.gbl (2a01:111:f400:7c09::173) by BN6PR03CA0034.outlook.office365.com (2603:10b6:404:10c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14 via Frontend Transport; Fri, 24 Mar 2017 13:35:51 +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 BL2FFO11OLC005.mail.protection.outlook.com (10.173.160.91) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.977.7 via Frontend Transport; Fri, 24 Mar 2017 13:35:51 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v2ODZhfm005481; Fri, 24 Mar 2017 06:35:48 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Fri, 24 Mar 2017 19:05:17 +0530 Message-ID: <1490362538-20854-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490362538-20854-1-git-send-email-hemant.agrawal@nxp.com> References: <1489756124-10805-1-git-send-email-hemant.agrawal@nxp.com> <1490362538-20854-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131348361514849391; (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)(39400400002)(39840400002)(39850400002)(39450400003)(39860400002)(39380400002)(39410400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(9170700003)(305945005)(77096006)(356003)(33646002)(189998001)(2351001)(8936002)(47776003)(76176999)(36756003)(50466002)(48376002)(105606002)(106466001)(50986999)(8676002)(5660300001)(110136004)(50226002)(81166006)(2906002)(104016004)(38730400002)(85426001)(53936002)(6666003)(2950100002)(6916009)(8656002)(5003940100001)(86362001)(54906002)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2794; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC005; 1:I4XzKJpaRIIjloqkryT9wDpgNz9igfAAe6352QA1xL+Qh6bJw3ATpEGXL3Kqt/7gu3jV+BKkZgofTe1rM/WCpTcykKuHkJ14A7zl0bE05HghIGY2+vgnrUU8knEN4DWXz98Ng6BRpf/jUTF8yvIW2wJQkG0dkRZpq+BnA09FQhI676qkqFuh3FQzsSz925Ks9v+bDe3omwSrP7gCSdtmoix1mrcdmFCoMt9kTC8KhRqSxtoljVaxDmL0ywWUd94bgPT9S7l/bTapWWjhKKQgKWHa8EYdkUzj3LBTN41qTHf9VHhw+fct0tGmhvKX+mboLvgBdvdRkEfa1C5uvg07ATX9xkOxnwdDVL7Gt4kbN7JUWEw9jhC8BsOND2dVde0ZeJPq9XHaJB3RrSGoBEleeF63FKBq8lGcBz+EIeaUO3QUV3Vs2lxuCse5piPUdH8oWbGEApgOgSwYwZ4scXdFeXr0dDv15SQvfro11Ia8bntrxeIYanw+UcGy2so0ubxtSr/+ThXpTE4YSJBk+9NUxfwpgAc7pVpf9fKA6dI+SEKWkfD82KRlRZ09ab8YyYPyzPsWpR3rPp8aQ1fcyMNMekn9W/0aIGnerolAiy53yGCIgqcXiBTjFBrSRpiQJfMNu1jn31ecVFYpG/HtldjXnA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: dbd8925e-7529-473a-146f-08d472bab063 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR03MB2794; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2794; 3:k9IlB88PzA4Bc2UHYrcvTho23IIS3lIJD8Id6A2PxIWcaU3CdMiYrpNujqjtOPUBlW6YBcJtHSNpHf8Fe63zgXkTORf9Fd5CrQ+VpRj3hOKNPBD8w9NwExMruYary94NkDQqDwUTYINYrf1MOw7GJvmHe0X+xgHstwBcB8g/geRem9resvKTasdCfgshwX7nrprypsCUO1r7ihAKhGQ7Ut95xWnTkc0JZ064ecoGj3llZ2S1wdcV81TyW/d/OUeBqMtRfZMIdO+T13yQ7Q1QUgVw4j6czK1RVBsBTU6anrBPAWObnY9KWPHJFD3I8KVUVMhcKRLExK0SiWcXyhSYY44hHAr8FLn4sTAmD64plDjbB56TM7ZOHQgmFplX3WJS; 25:kiMVpha70cDMnrZQWYNYoqnhxIo/9PY2aWFqW5wDuAy7/7v1GNYKA9VOTuxbKnty1YAZJQ4xKC6dPa+BzWazcl1GGzzKbWE/q3gI0/oPsiJnc1N/qnir+ygceVbVn1Lz35ehBIYn91g/B2wDqAEpyAhyqip3N1sp1GCUm8CN2QbQ/nb6j1IMFKcDmDkqR6iNV2wVj/4LUS8cjX7KGwYAB4+Rh+HRI/vFxODhf0oglTIUlnU5CC9buoPkWcZBXwFlAtxolZ+C9wX2Pda89V6pQYYmwoGIc9+m1T2BwV0eMMSrLoJhn7hMphf+iY2XEg4efu00mCQZJpBdLs0+rPDXbCkGDjlEeIAkxUYJYydj2ABaV2I0QibEg85M27nBxmvh2LFGXXYQWA5OpLTz3Wa52bzd1hyXqksc/wrs3J2urU5hhvkRzSjZhtuGhTm35lkSYBgbfwqVIXFoNseq7h7PHQ== X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2794; 31:DJ+oeMePCxo2LTPYR7v0Wt9Dvdlw8UoPHHjBs3qio+r4RdLdAFdvRg2rJk0k1x68NM0P5e3qwZE0xK6Fxm6Y17rvVO4At2cgLQbXG2tjRG5GUs+JMrRgXss6DM3UUEFpSUo1MrVbvQRWMvjiN7rXJH4L2OvAeBgYvJzSQe8U68pYEZYBSq9JHXAgrS8QK8MubivANCCSHUihGiXbZjrOzwNWaP+hwX8LKH1ohJE7ZtbCAiQNMSBdmeEMaztUdxdXRGixYwuntc0hPplmZsIeSA== 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)(8121501046)(13017025)(5005006)(13024025)(13015025)(13018025)(13023025)(10201501046)(3002001)(6055026)(6096035)(20161123559025)(20161123556025)(20161123563025)(20161123565025)(20161123561025); SRVR:DM5PR03MB2794; BCL:0; PCL:0; RULEID:(400006); SRVR:DM5PR03MB2794; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2794; 4:Q3eGQ5yLrmWQWdxcaM/x8okkTsGFa2Jl1AJec0IYEb661/X4s+k36nVYQ5cSjKo/uTPAvISbPM6WO4FmfwBOzMODRvpys0F1MlKwCFPP6DBVxSSq0hGFv+VD32dVg8knih0lt6HsbVXhyTbRvc6zdI2W73K9b26MwRQBAnADV6+zyfpPO9a3vmnXMfQBTWk8ho45oOnX2+HJ8OhSavlmInBr4JjFyCThzBymB/F3lRt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Fl6BHtuWCcXWoJS9DAPHqK5/aGjK3lbdwMu3ovrz0sBNy3t22M7j+HARJ3t1Cgjygq4o6OfGoSA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2017 13:35:51.3133 (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: DM5PR03MB2794 Subject: [dpdk-dev] [PATCH v10 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, 24 Mar 2017 13:35:53 -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 | 1 + drivers/net/dpaa2/Makefile | 61 +++++++++++++ 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 ++ 9 files changed, 265 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 a1d4756..b70cde8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -350,8 +350,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 198fda5..4d6f459 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 89001d7..7b8b6a2 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 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..939c56c --- /dev/null +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -0,0 +1,137 @@ +/*- + * 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 70c3a5e..48c7a1c 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -107,6 +107,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 @@ -152,6 +153,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