From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0073.outbound.protection.outlook.com [104.47.41.73]) by dpdk.org (Postfix) with ESMTP id 5AED4BD2C for ; Mon, 23 Jan 2017 13:00:56 +0100 (CET) Received: from BN6PR03CA0028.namprd03.prod.outlook.com (10.175.124.14) by DM2PR0301MB0749.namprd03.prod.outlook.com (10.160.97.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Mon, 23 Jan 2017 12:00:53 +0000 Received: from BL2FFO11FD017.protection.gbl (2a01:111:f400:7c09::156) by BN6PR03CA0028.outlook.office365.com (2603:10b6:404:10c::14) 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; Mon, 23 Jan 2017 12:00:53 +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 BL2FFO11FD017.mail.protection.outlook.com (10.173.161.35) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Mon, 23 Jan 2017 12:00:52 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0NC07ea019311; Mon, 23 Jan 2017 05:00:50 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Mon, 23 Jan 2017 17:29:42 +0530 Message-ID: <1485172803-17288-13-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> References: <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131296464531453336; (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)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(356003)(48376002)(104016004)(81166006)(8676002)(5003940100001)(6666003)(68736007)(626004)(6916009)(2950100002)(5660300001)(8656002)(189998001)(97736004)(54906002)(85426001)(50466002)(81156014)(50226002)(53936002)(8936002)(305945005)(36756003)(4326007)(105606002)(77096006)(38730400001)(50986999)(76176999)(2351001)(575784001)(110136003)(33646002)(86362001)(2906002)(47776003)(92566002)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0749; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD017; 1:Z+Q4NJdR2BqGeYkuDP7J4BOf6gR7bnyZ0DVFPrCFUQYd3KEZ2u2UzntesxO83Tz4wuPNaqVkMJY6fnDlWPigKCCjufJbZ+WX+J9KGqyhUsb32zOThUyWe58e17u/8nWMWCZJ6od24Qcg6AhhQwj6kKGsTrmeC2GZrP3IPMlXUW/WP6lG68bJjb6c6hoM6gzk/mHteEUEGGLklIE5/Mqi9GDsjOzzjuoSTE3G/SnURIJNhUf9SqNNZSi60AbI8AyoArEQ0Udemg+72Pv8Y4atkG8L08TeKhT8D5MXl7ONFZia0rLkoyFPyC0vMZF0bR3JYSb0VlyicMv5Qpxi6TDNRQKSuHSGiyRgZBfj2MT3TyODp9s9DIJbYMpscVeov+gpcTiPN3wtk0L2ycv7r1AbqTwGP9fK1njJnvFK9mLweinH9DyfByrxi02BQ4x0LiUauEUr5GQBcuMaLWdA4mhNdqPJtmG2S77U2NDteuXWHKOWaU/ViEhQ9Fahi7bFYoPkzkFqGD6+oT5laqKs17MElY0xLB/Mr3+tNLVRL4rw3rmyxtdpwzlYN8MXThi5xVulfbWmYeholy2s+IoXATR4033iC7xkLaa2qvwW1Faxx6XLGCVU2OtTowz6hIr3PrO4cN0p87GVA9qyGOsGW3eVUCCoG4s50JrWDBIi/LL2zVLKG5oNfr1q3Vtfb9LbKZ1GX6xqwGjm9wCq6w257LJ4vStiOMJHxUTOxeo2Rub5los0cQop/eKcPQ9zFTofbhwN MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 732c4b48-9295-4666-140c-08d443877b1e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM2PR0301MB0749; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 3:o8KHZCicBTVf9W7Wrs5J9AmPZIMeniUC7X4vJr2wNnhb5PuFYqSlRMXTp34aGQSV3rEi9tfeojMpfz4bNoGWjh/0VVn5b5FewpdeAR2tAVJ/gUfJZbMWw0R+QC2dxgR3NEfF3POLP9tY8wQyuJV8xXzMTx99A4A6c/gRgVdBGwhSNCJ9cNKY6yThe+HW3QdJqVMVoG/MKEMf4rJDmP99LdDe3bIFLtUBVdOS4xzICtcbFagZmNQ/4/LLzLNpBTdExBkuc2cJ96ryrDihap3equiStRsaBQPYmzLNCehOwyr7upJL5NopCtRZDEMaEhaieNfeNphBula4MkyDylBEb3nCmAgk7QnmZ0+BgEsL3/YXzA+gONHpH/RtwGKgcM+m; 25:1tkoXRuXrbJxid85xOT6CXIZb5mdWJyzQMFVFfMV6vjjWZ5y/KWqGfI1Xh8+/RAjXOiWXAQo0XefEYkpSkkKuXh8BvYAv4Ax5EmztjttFL9LdKqGbNiepaphl6UHdKASbo7oR7YdyZPBD7/DX2Bd3Ku3WOfsroUDt5D5HRIKyvlT/cC1l7TpSm5ICliRIuNzpR5iYB58aA55Zfdn5EbkvU0JLpUmKntgQUrmaRXnRcfbxmUeQxPYBZIxGrLugD6jHqK/S494AMdCtpgPyT0yTb8/nA2wanHM5I6uhwtEnL0TEXByhtgBJIrUtPExAWbNMgPAnwA+ic4EDg5rkDLya3fAmCzLLQnQCZcSb9BP4uv08pemZ3YLVqxAAHByg8sxtOlEeBUh22Fx9nIZut0f0w5C5nVsI2a3KJT8d1mpGLBiARfTjBRtU+k1XILh5DS5y0FUmTENXrUyO8XZxcSs6w== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 31:WqBM16Xl75lhF2DMwcmFiV25NPJ9qOpu3yf9mVgwvi7Itli10a7l35nwUQzKvuwqtU8DF8z5iZeLfrgktmdh3iBXssUWqt/bfkzJ+E2IkNaAH/Lt0fQCZMLVGVaM4xEX1b2kTsWo1jBPN131U3XmfhcbLbszeZnS2dygwGeFHa0wgFGQJuG46g9wAT22puFTs8eZGe4x20Ro9pfR1eVW1HycRfJp4UycFeLWHHgH3rMXWvlx49nCERAFW59EQ2rRZw1fFSovKL0+VQ1dyaKxaw== 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:DM2PR0301MB0749; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0749; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 4:2IBO9tA8Ygel07ey8UWz1sU3jHTFWaFiLPw0wjvePJ4NiM9Ig2v7eSol+/lV5isykyrObDvqXKikQdOptN9lXOjXi3CYd99+G7gTJ5h1dDk/2PaSBPUE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agnostics: 1; DM2PR0301MB0749; 6:Bxd1fwbhPHzs6yaEJovP/oAOXJtnV+2gTDLMRW3CdshpoIndeR/hRuEh8pLLn23ls/yEQHnhdtasSwAGckPp3U7HT8ClXQuRFugWLSJ0eJ1z6s/5TCTBTAUKs7TzNLXzX99mJ4868oNzcxvs04enPCGXRqB1seORXgKPa+FROGqWe55RcxW2wRU9IKw6WC2TLB8TK1gJcTCydScFra0fS71uxij6Ngx+UFIpdq0Aek1VPNi8/7qhoFOpCC/abGDgHl4tOpNG7D9KbLqmLWeY/sNV/TObDYubZYczJK5qVhC6Iz1dD51nUZWm3bxgiG7fkmOfoGjQpj4A74C7sSTYsfVPX8bwNRFojqjNF3Ry6qhc98XlsV48qYHp4omU85ua5I0EQKYA6dijXEOHkdiRZwmWJK933nObPwexdwFhV3TzVmQb7P8JyhFgp5bUVWSW; 5:f+7x5yJhhE4/SKRo4+gPStL1dXJjiJPd5kZou1YNwg8dAUD36+kh65I0imVOoRFqt5ts8CKyNx+Z83fF0CiojmcQyXDBs0zb7+AiSuCE/40vMSYsD4Fx97ZzedN+Y+339GwpDJeF2Ov0GzjK1TMO0Ru8RPb64LUGdZjcWGkRaDxV6kUjYgem/0ptozFdWQ9k; 24:WAARcNFINwWTPSGiUHCY1279tjajaC8sj41DaqoJ37qWeApAhgCilhs4W/NJ41CSqTkn67afQ2iSor9Ba9k+X+mK745tyoSnNG53DUUN96o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 7:oPdiOEesex+Ww1vv19ISVrboqWRzXL/dUygs8JcOFhB7HoQ7YYXs4VwTXKTQeuwYEf/cm03ed8Sin9tYbDNKxssk+604zB/Y0omiAmiadaPjWUFg90LHSIvHZP+AcqLLTi7AFFfa0R60KjLV9gi4JTM0R6MSHQNG5OiL2sNw+iQPg96SO4jgBnLURzhZHdZ4ghHQY9PuitHgnOwmRi/muj3rSnMCR/PB7zjOVKfgBrGTTFwmCDEW9Zm5FP8j/Zy3uPd85pJ4uWw/Vzt83hMP60giWtuDg4q5x7xrTrs5lok6onXv5Szp0+PPY/vdPZp9qPd47Dsxpnx/4Q8n3HsZ39IVh+eI2fQYC/jvpXnWTlncwj0Z0RaRlHw5A4DLvzEGhImUBfhzA8PHvXdOQb4SAKW857luQVDRkUdU7/Ts1iTIjlHV4KLvlPbHByVptjqrfv16rpGqHgTXqjxsheqC4Q== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2017 12:00:52.9580 (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: DM2PR0301MB0749 Subject: [dpdk-dev] [PATCHv6 12/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: Mon, 23 Jan 2017 12:00:57 -0000 add support for fsl-mc bus based dpaa2 pmd driver. Signed-off-by: Hemant Agrawal --- MAINTAINERS | 1 + config/common_base | 4 + config/defconfig_arm64-dpaa2-linuxapp-gcc | 5 + drivers/bus/Makefile | 2 + drivers/bus/fslmc/Makefile | 4 + drivers/common/Makefile | 4 + drivers/common/dpaa2/Makefile | 4 + drivers/common/dpaa2/qbman/Makefile | 4 + drivers/net/Makefile | 2 +- drivers/net/dpaa2/Makefile | 59 ++++++++++++ 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 | 3 + 14 files changed, 281 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 4a13140..7e274e0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -358,6 +358,7 @@ NXP dpaa2 M: Hemant Agrawal F: drivers/bus/fslmc/ F: drivers/common/dpaa2/ +F: drivers/net/dpaa2/ QLogic bnx2x M: Harish Patil diff --git a/config/common_base b/config/common_base index bf1de8f..7054999 100644 --- a/config/common_base +++ b/config/common_base @@ -292,6 +292,10 @@ 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/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/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile index 7cccc0e..ce799da 100644 --- a/drivers/bus/fslmc/Makefile +++ b/drivers/bus/fslmc/Makefile @@ -35,6 +35,10 @@ include $(RTE_SDK)/mk/rte.vars.mk # LIB = librte_bus_fslmc.a +ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_PMD),y) +CONFIG_RTE_LIBRTE_FSLMC_BUS = $(CONFIG_RTE_LIBRTE_DPAA2_PMD) +endif + CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) CFLAGS += "-Wno-strict-aliasing" diff --git a/drivers/common/Makefile b/drivers/common/Makefile index cba1134..b52931c 100644 --- a/drivers/common/Makefile +++ b/drivers/common/Makefile @@ -31,6 +31,10 @@ include $(RTE_SDK)/mk/rte.vars.mk +ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_PMD),y) +CONFIG_RTE_LIBRTE_DPAA2_COMMON = $(CONFIG_RTE_LIBRTE_DPAA2_PMD) +endif + ifeq ($(CONFIG_RTE_LIBRTE_FSLMC_BUS),y) CONFIG_RTE_LIBRTE_DPAA2_COMMON = $(CONFIG_RTE_LIBRTE_FSLMC_BUS) endif diff --git a/drivers/common/dpaa2/Makefile b/drivers/common/dpaa2/Makefile index 9681729..87f08bb 100644 --- a/drivers/common/dpaa2/Makefile +++ b/drivers/common/dpaa2/Makefile @@ -31,6 +31,10 @@ include $(RTE_SDK)/mk/rte.vars.mk +ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_PMD),y) +CONFIG_RTE_LIBRTE_DPAA2_COMMON = $(CONFIG_RTE_LIBRTE_DPAA2_PMD) +endif + ifeq ($(CONFIG_RTE_LIBRTE_FSLMC_BUS),y) CONFIG_RTE_LIBRTE_DPAA2_COMMON = $(CONFIG_RTE_LIBRTE_FSLMC_BUS) endif diff --git a/drivers/common/dpaa2/qbman/Makefile b/drivers/common/dpaa2/qbman/Makefile index 7ac1ba7..18bca6b 100644 --- a/drivers/common/dpaa2/qbman/Makefile +++ b/drivers/common/dpaa2/qbman/Makefile @@ -36,6 +36,10 @@ include $(RTE_SDK)/mk/rte.vars.mk # LIB = librte_common_dpaa2_qbman.a +ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_PMD),y) +CONFIG_RTE_LIBRTE_DPAA2_COMMON = $(CONFIG_RTE_LIBRTE_DPAA2_PMD) +endif + ifeq ($(CONFIG_RTE_LIBRTE_FSLMC_BUS),y) CONFIG_RTE_LIBRTE_DPAA2_COMMON = $(CONFIG_RTE_LIBRTE_FSLMC_BUS) endif 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..f85aa9f --- /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_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..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 a5daa84..c8a6c11 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -110,6 +110,9 @@ _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 +_LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_dpaa2 +_LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_common_dpaa2_qbman +_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