From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0053.outbound.protection.outlook.com [104.47.37.53]) by dpdk.org (Postfix) with ESMTP id AF9E1FA31 for ; Mon, 5 Dec 2016 08:28:58 +0100 (CET) Received: from BY2PR03CA069.namprd03.prod.outlook.com (10.141.249.42) by MWHPR03MB2479.namprd03.prod.outlook.com (10.169.200.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9; Mon, 5 Dec 2016 07:28:57 +0000 Received: from BL2FFO11FD029.protection.gbl (2a01:111:f400:7c09::192) by BY2PR03CA069.outlook.office365.com (2a01:111:e400:2c5d::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9 via Frontend Transport; Mon, 5 Dec 2016 07:28:57 +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 BL2FFO11FD029.mail.protection.outlook.com (10.173.160.69) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.734.4 via Frontend Transport; Mon, 5 Dec 2016 07:28:56 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:723; Count:10 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uB57SdmW016006; Mon, 5 Dec 2016 00:28:53 -0700 From: Akhil Goyal To: CC: , , , , Akhil Goyal Date: Mon, 5 Dec 2016 18:25:36 +0530 Message-ID: <20161205125540.6419-5-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161205125540.6419-1-akhil.goyal@nxp.com> References: <20161205125540.6419-1-akhil.goyal@nxp.com> X-IncomingHeaderCount: 10 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131253965368812991; (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)(7916002)(2980300002)(1110001)(1109001)(336004)(339900001)(189002)(199003)(2950100002)(92566002)(6916009)(110136003)(6666003)(356003)(8666005)(36756003)(104016004)(5660300001)(77096006)(626004)(97736004)(85426001)(39840400001)(39860400001)(50226002)(7846002)(305945005)(33646002)(5003940100001)(50466002)(50986999)(48376002)(4326007)(81156014)(2906002)(81166006)(189998001)(1076002)(8936002)(86362001)(47776003)(2351001)(39450400002)(39400400001)(39850400001)(38730400001)(39410400001)(39380400001)(106466001)(68736007)(105606002)(76176999)(8676002)(7059030)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2479; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD029; 1:4H6lKhkTv+CIlllAd+jbiCwUYTJXJZYaxfU93z4PWbk2RneY6M7jaoKrkEcT014PkvIuozUivlfobf2ycFSwgvC0AFMkPJhvvmzXMGx0HdXYaxqKnScJLw5rBEwcDeH2IivoTODG0igdpofkZrLRzzatKglgscBVsuoan+gkHLleqOHIoi1VzX8dmV5e3fgMU3fuq+I2skfMDOgZupgBAPeDKPnXWisDmZV1sY/oTi2E5aDQMb8lE+klC7bxE+4NDhUrbpFJmFaZ3V/9NMm219oIkkGSmKX2YmtZjfhETbFmqRETzxrwNwfhB+yJgu+8XZ9rVV1s41XU/QTArG9XGtQqSv4n4IvuLBYiJwfIacBBHPhmqSi3qJIUvNJYXA4YSQFHwlpMegYPuHHVynqoJP6KwT+se+kIOL1XHUhG+UDA9Za781bW6jZTKQJGj+muHYOYTHNV2koNtYvXS6X+/1RX1OJWgHoYvJSF+BdTRnWPo8Txo2m3IPdc2muU+jdenjYMnFIVc02GcaRhu+eKvvzprxVg0853Rn5lkGMz3OK+qWijB+7JDv18vzKeFezpVC0exPSH3q+KyVeyqooDfOFo9aajCDLVpeo/iY1fgZ/I/peBr85bKonqkcvuBssYWJbFL2qQKBGtMYwF+00zrYT7oqOZCWLphWX1fWmoge+BW3vquqOH9T0oigMr3Nk+LfUX7GJbVi18dU3xjdtO2X8ThZIBPbQu6TE7VjL6wjspJldVlUpRkARZt+Xcs/FAuGP9LIJ9RC+HwwWr8IMBuQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: e067194e-50e9-4a1e-65bf-08d41ce05fa2 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR03MB2479; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2479; 3:jNu6zy2H5sEdCjWtnlSgPRURbbCy9UbximPhmOpHYnyKDvxFkby16tbRQQ0UnKZfH2fJW9ncLXvAZezDd4H9MdSBSQR+VV6/z/FeQqQSJN9RVblf6AZT3DmIpJ9oEGgGQcscORxnstqrV57zWboRVAhdh9Mwy7/4vvOjy04tZlZN/c7+/DPOh6C4HlGfDoC9MsqAKdeAO6XwJVuZ4KEXmvjS4wvvXMR+sBPmQRa3pv9A/OYCGgWfHw8LcjK03/zBjmHToztt8y9I5qwim31ytlmlSMFnDvMHnafBJ7nL2R2qS0h8iwASCcBHmV9TQhcZLC/nWUWlpnXIobIGC+r7419GtF5PALGQB0xX6Q9iHY0k5e5gKOl6QJWSc+41FPC9; 25:6Q7wc2MxlVVS0gHkQkT7IwphSt52bf/2HnfuopuGvpXOcKKlwR1h1SbE9T6IjAGMmcxG/ZPgroUdu+KFUAutyHte4fdVwMqqB82U9QRmF3Whg6pHgNAxPxhSjN/HX8I1AXQeHPHW6c0C6VtCiJS8qe7Kj730N9tKXn42RCeaQ2TlmdExZDHraW2x2sT+xDzeq0eKexW2+blNIPYdWHEQ3e6BlbVH4TGVeUmBI5dwJWvpoNFUz80B5+4mdDry9F4+Bu6YG7aqIF9vYuQkUoK4AP7eqg+vGngN1iDLfkjHfdhxVk3hDwtTeHvHg0Q1V8mH98VX//wrEOO5owO24jz6Fu/O//oXivVplEVPR2vQtjtXviRiScisqOyzB3QT05RsGNBL2OOI06JdWRiojtXf87LbbDhH3SbuG6jlnwDAdC9/eNMeJATKuWFxU2vVdxcciOJ9M/g0kZ3v/AyovAD8pA== X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2479; 31:1IFK1FrsJ2R6IwRlweTj7awZEx1uBp/GtJF6m8kZVLiuf7qloWO8A7eh7YioHfKEhGhkH/21TpbPZEJY8YmLJoa/eKBD9/5uHs+B98CKFwvVjgunQz7hC6zOID3RIm4pH1C6jOwSgzmHk37p9ITcQPMRpVIXZxVkFe98NOHo1nPB5auycyHRqtwRLO2zJgwQHdswEzDEo50J2xHiSjhhaT45ZS58azIS6bEVh60VSBSeuTEQ1KtaWzMKdm3pYV434furn0snTuFXEL6CsatOnA== 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)(13024025)(13023025)(13018025)(13017025)(13015025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123565025)(20161123563025)(20161123556025)(20161123561025)(20161123559025); SRVR:MWHPR03MB2479; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2479; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2479; 4:WP/7iuSD+GHlzCGBWcdo3P/rNBadl9IIxJtWHJjwvZYjiLkUWT/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fJXic= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2479; 7:Mfr3OVrhadCbVgMzr9OcezW278b/l3z7mixEc1FRpPlIORgR2gSzBQu/DkUGeD4R8rB5afbWFdijyYLvPLbxuF0VhWj8XvcuZ1kwOLPzBkKE0AiTeMhJz6LX3SrgIM3wWn9O7eTUGShChtHqK9G9VvNlaFU5U2N6QhaoHk2YYb2OoxvNW8sRyUQPwMnA4k0DQNLmm8K03fUQfP96F8VB7BllGknWZFFvCbAfACfKbn4ku69PHxDZUraAwbZ55rgWdYeBS8VbIO/FtpT3O3hm0CXQ2n8LgUHcBin+BaUcqHQkVCT3oH33+HVN8aImIOwixypPoBIGNeI0mGZTkTwGXz0b/A6QLPNErGhuZhGent7b83y1alzQrsG3CjsClXJz+GUMFGRhfR6VDUGjvFQCB983Ymxuj0ZEVtMBk7NCaTrITu22cIh0xxcTY/JFHzGw+cLdaLxfytY8McktZfBOcQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2016 07:28:56.6940 (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: MWHPR03MB2479 Subject: [dpdk-dev] [PATCH 4/8] crypto/dpaa2_sec: Introducing dpaa2_sec based on NXP SEC HW 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, 05 Dec 2016 07:28:59 -0000 Signed-off-by: Akhil Goyal Reviewed-by: Hemant Agrawal --- config/defconfig_arm64-dpaa2-linuxapp-gcc | 3 + drivers/crypto/Makefile | 1 + drivers/crypto/dpaa2_sec/Makefile | 78 +++++++++++++ drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 128 +++++++++++++++++++++ .../crypto/dpaa2_sec/rte_pmd_dpaa2_sec_version.map | 4 + drivers/net/dpaa2/Makefile | 3 +- lib/librte_cryptodev/rte_cryptodev.h | 3 + mk/rte.app.mk | 1 + 8 files changed, 220 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/dpaa2_sec/Makefile create mode 100644 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c create mode 100644 drivers/crypto/dpaa2_sec/rte_pmd_dpaa2_sec_version.map diff --git a/config/defconfig_arm64-dpaa2-linuxapp-gcc b/config/defconfig_arm64-dpaa2-linuxapp-gcc index 7dc6d2d..cc202ea 100644 --- a/config/defconfig_arm64-dpaa2-linuxapp-gcc +++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc @@ -53,3 +53,6 @@ CONFIG_RTE_LIBRTE_DPAA2_PMD=y CONFIG_RTE_LIBRTE_DPAA2_USE_PHYS_IOVA=y CONFIG_RTE_LIBRTE_DPAA2_DEBUG_INIT=n CONFIG_RTE_LIBRTE_DPAA2_DEBUG_DRIVER=n + +#NXP DPAA2 crypto sec driver for CAAM HW +CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC=y diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile index 745c614..22958cb 100644 --- a/drivers/crypto/Makefile +++ b/drivers/crypto/Makefile @@ -39,5 +39,6 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += snow3g DIRS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += kasumi DIRS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += zuc DIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += null +DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += dpaa2_sec include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/crypto/dpaa2_sec/Makefile b/drivers/crypto/dpaa2_sec/Makefile new file mode 100644 index 0000000..2cb0611 --- /dev/null +++ b/drivers/crypto/dpaa2_sec/Makefile @@ -0,0 +1,78 @@ +# 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_sec.a + +# build flags +ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_SEC_DEBUG_INIT),y) +CFLAGS += -O0 -g +CFLAGS += "-Wno-error" +else +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) +endif +CFLAGS += -D _GNU_SOURCE +CFLAGS +=-Wno-unused-function + +CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2/ +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaa2/mc +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaa2/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaa2/ +CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/ +CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/ +CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal + +# versioning export map +EXPORT_MAP := rte_pmd_dpaa2_sec_version.map + +# library version +LIBABIVER := 1 + +# external library include paths +CFLAGS += -Iinclude +LDLIBS += -lcrypto + +# library source files +SRCS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += dpaa2_sec_dpseci.c + +# library dependencies +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += lib/librte_eal +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += lib/librte_mbuf +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += lib/librte_cryptodev +DEPDIRS-y += drivers/common/dpaa/mc +DEPDIRS-y += drivers/common/dpaa/qbman + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c new file mode 100644 index 0000000..46e3571 --- /dev/null +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -0,0 +1,128 @@ +/*- + * 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 + +/* MC header files */ +#include + +#include +#define FSL_VENDOR_ID 0x1957 +#define FSL_DEVICE_ID 0x410 +#define FSL_SUBSYSTEM_SEC 1 +#define FSL_MC_DPSECI_DEVID 3 + +static int +dpaa2_sec_uninit(__attribute__((unused)) const struct rte_cryptodev_driver *crypto_drv, + struct rte_cryptodev *dev) +{ + if (dev->data->name == NULL) + return -EINVAL; + + return 0; +} + +static int +dpaa2_sec_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_drv, + struct rte_cryptodev *dev) +{ + struct fsl_mc_io *dpseci; + uint16_t token; + int retcode, hw_id = dev->pci_dev->addr.devid; + + + dev->dev_type = RTE_CRYPTODEV_DPAA2_SEC_PMD; + + + /* + * For secondary processes, we don't initialise any further as primary + * has already done this work. Only check we don't need a different + * RX function + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + return 0; + } + + /*Open the rte device via MC and save the handle for further use*/ + dpseci = (struct fsl_mc_io *)rte_calloc(NULL, 1, + sizeof(struct fsl_mc_io), 0); + if (!dpseci) { + return -1; + } + dpseci->regs = mcp_ptr_list[0]; + + retcode = dpseci_open(dpseci, CMD_PRI_LOW, hw_id, &token); + if (retcode != 0) { + goto init_error; + } + sprintf(dev->data->name, "dpsec-%u", hw_id); + + + return 0; + +init_error: + + /* dpaa2_sec_uninit(crypto_dev_name); */ + return -EFAULT; +} + +static struct rte_pci_id pci_id_dpaa2_sec_map[] = { + { + RTE_PCI_DEVICE(FSL_VENDOR_ID, FSL_MC_DPSECI_DEVID), + }, + {.device_id = 0}, +}; + +static struct rte_cryptodev_driver rte_dpaa2_sec_pmd = { + .pci_drv = { + .id_table = pci_id_dpaa2_sec_map, + .drv_flags = 0, + .probe = rte_cryptodev_pci_probe, + .remove = rte_cryptodev_pci_remove, + }, + .cryptodev_init = dpaa2_sec_dev_init, + .cryptodev_uninit = dpaa2_sec_uninit, +}; + +RTE_PMD_REGISTER_PCI(CRYPTODEV_NAME_DPAA2_SEC_PMD, rte_dpaa2_sec_pmd.pci_drv); diff --git a/drivers/crypto/dpaa2_sec/rte_pmd_dpaa2_sec_version.map b/drivers/crypto/dpaa2_sec/rte_pmd_dpaa2_sec_version.map new file mode 100644 index 0000000..31eca32 --- /dev/null +++ b/drivers/crypto/dpaa2_sec/rte_pmd_dpaa2_sec_version.map @@ -0,0 +1,4 @@ +DPDK_17.02 { + + local: *; +}; diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile index a8c3c04..8b6cef7 100644 --- a/drivers/net/dpaa2/Makefile +++ b/drivers/net/dpaa2/Makefile @@ -1,5 +1,6 @@ # 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 @@ -12,7 +13,7 @@ # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with the # distribution. -# * Neither the name of NXP nor the names of its +# * 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. # diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index 8f63e8f..9ef14ca 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -66,6 +66,8 @@ extern "C" { /**< KASUMI PMD device name */ #define CRYPTODEV_NAME_ZUC_PMD crypto_zuc /**< KASUMI PMD device name */ +#define CRYPTODEV_NAME_DPAA2_SEC_PMD cryptodev_dpaa2_sec_pmd +/**< NXP DPAA2 - SEC PMD device name */ /** Crypto device type */ enum rte_cryptodev_type { @@ -77,6 +79,7 @@ enum rte_cryptodev_type { RTE_CRYPTODEV_KASUMI_PMD, /**< KASUMI PMD */ RTE_CRYPTODEV_ZUC_PMD, /**< ZUC PMD */ RTE_CRYPTODEV_OPENSSL_PMD, /**< OpenSSL PMD */ + RTE_CRYPTODEV_DPAA2_SEC_PMD, /**< NXP DPAA2 - SEC PMD */ }; extern const char **rte_cyptodev_names; diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 9e1c17c..81fdfb7 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -146,6 +146,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += -lrte_pmd_kasumi _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += -L$(LIBSSO_KASUMI_PATH)/build -lsso_kasumi _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += -lrte_pmd_zuc _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += -L$(LIBSSO_ZUC_PATH)/build -lsso_zuc +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += -lrte_pmd_dpaa2_sec -ldpaa2_mc -ldpaa2_qbman endif # CONFIG_RTE_LIBRTE_CRYPTODEV endif # !CONFIG_RTE_BUILD_SHARED_LIBS -- 2.9.3