From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0074.outbound.protection.outlook.com [104.47.33.74]) by dpdk.org (Postfix) with ESMTP id 0CAA45B32 for ; Fri, 5 Oct 2018 15:00:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VjU7ERIYWktXXtvzrRzDlGXe7FYTASMV3AvuSEDpODw=; b=HjX3KCb3w1c2+Qcub9JV5t/HfgYFEN7vAOPfIne5a807IEPEomKtaVugdiK/ZXIwTSRZXV+sIx0ZTtPRnL4V95qFI0qg0StjVUCokpClpYZlJFVjMipDbtgjISmrFmTHBo2a3p+yg0wl6ztQhbdw9yz8Ar+V6BJTD8FzCezbpt4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.com (115.113.156.2) by SN6PR07MB4910.namprd07.prod.outlook.com (2603:10b6:805:39::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.21; Fri, 5 Oct 2018 13:00:14 +0000 From: Anoob Joseph To: Akhil Goyal , Pablo de Lara , Thomas Monjalon Cc: Ankur Dwivedi , Jerin Jacob , Narayana Prasad , dev@dpdk.org, Anoob Joseph , Murthy NSSR , Nithin Dabilpuram , Ragothaman Jayaraman , Srisivasubramanian S , Tejasree Kondoj Date: Fri, 5 Oct 2018 18:28:53 +0530 Message-Id: <1538744363-30340-3-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538744363-30340-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1536033560-21541-1-git-send-email-ajoseph@caviumnetworks.com> <1538744363-30340-1-git-send-email-anoob.joseph@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: MA1PR0101CA0036.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::22) To SN6PR07MB4910.namprd07.prod.outlook.com (2603:10b6:805:39::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f3e9fc0a-0c25-44fd-34f2-08d62ac28059 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4910; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4910; 3:ZFTewKXDVM5XnHk7H4IWQ5mNP+oiDHAKNG/AxIewc9wC6yOhh8/CsWMdrIh+wigWY86S2MOtqFtxDiQtcnya6oAwGgec6+I8bF/hCOOXT52vbpdwRqIW7w7kMwGoHYhN2U9u/vV1Dal82+aJuK0Qnc05+x37qkJIR+6SRAziGv5oHjWLqTrjnRZjzjKVbSlbsaO5UMYd5dV7QZAHwWqLnP990V0Mk64zCgpFbhnelPo63SshGnqqpWvL2hinEPVT; 25:DAzhL4qO4WbyPqWmd+P4EIRY862zA7KT9WGvB7iRax54OyxcAzMvWRKKnyrNn3JE00vnqm2SXkeQeVlLg4OvCTKfkePKh7hw0qCzsmU87Xb7LwaDSQ60FS201Ln3dRcNY6Rta9BY9pC4rHIWoRqdh8t97KnRc0xQdCNPquEkN0NoRrSD+m3EPG46IKdBrRZV7+WiMiLEeKB1BuCZZDaO0jyT/VYfLpUkYuaNY/EvCwOlKx5RW0pKH9Ku1fqy6sZE1hlYBoMtpLHY4M94On9HlEi8Y/CWRL7taHK56yc32Kc8lnUZPM8SQ3D/O+s7oFG+upIbwUz027NjX2N/0nn63w==; 31:iQa7yan6a5LmtP1Fwu2+DGZKaGb4x2a5LVVDqWDUgfOPWgzH+LU/Eg/X6BrWoIO+K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mTbkIYsizfrE9paHrcOvJYo91F2C7KLImpOR0+hewf/Qd8GCpTBHtSbcjGGLSgLLXixrpto137WETmotJFqJ7Nq6gCKtoHpx6CoFkMfGzfEs2Zcsg8LvxqYElE X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(149066)(150057)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:SN6PR07MB4910; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4910; X-Forefront-PRVS: 0816F1D86E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(346002)(136003)(396003)(366004)(199004)(189003)(51416003)(76176011)(11346002)(50226002)(25786009)(8936002)(48376002)(305945005)(186003)(16526019)(110136005)(6486002)(3846002)(446003)(52116002)(6116002)(81156014)(8676002)(97736004)(5660300001)(50466002)(4326008)(956004)(42882007)(2616005)(68736007)(478600001)(54906003)(7736002)(81166006)(6666003)(16586007)(107886003)(26005)(55236004)(66066001)(386003)(47776003)(6512007)(72206003)(44832011)(476003)(5024004)(316002)(14444005)(36756003)(4744004)(105586002)(106356001)(486006)(6506007)(2906002)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4910; H:ajoseph83.caveonetworks.com.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN6PR07MB4910; 23:bEHw9pm/zp7d5iiYBsXG62juVOjyKnO7CvYDNaZXI?= =?us-ascii?Q?WRD1fYPNlZDCuddT0/u5bbsXSzErJl3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NlBeQTdWTWLb9s3+9X+1O9dlsauFVzU17i9sDM7jZ4Dbo?= =?us-ascii?Q?bFrvUXFkI8zndZU823GOOJjcSoHNDn9dG4CZ0HjHbqL7RTkg5b5m/ItakNIn?= =?us-ascii?Q?Qwgj8kEASlj750f5s5lH66trberF60e71FkTrq36M1xeaueS9I5qnEeBWKzG?= =?us-ascii?Q?1hgiWnLf+mYgqqj8tH4zd7gETnO4iS3hgUOAGcdsZFetQhzpPSlG07jFi7AM?= =?us-ascii?Q?TsOMdsXp5csq7Gq19FEz328GI/ziDGUTe/qS3BtLRAXjMqCwJfSu0cKa4KrH?= =?us-ascii?Q?l7MHtOnDH5MdnfkzlHC1IgT3l0/Q7t7NHLIiB8lSuQo+uSRvghKArdwfp0Bj?= =?us-ascii?Q?ut0AZMBf8Ggg1wejaQjfEWZww/69SCqvtqgLvqOkRH5?= X-Microsoft-Antispam-Message-Info: VrVaDBNS99p11DmrPMm7PFamP6cWj96gS6iXmgaVdmWfXDVYbWDXso1Bwf3TJVW0CsNnNw3R8rBYd4CJKSlUtJPifklUNsvPh56/RviKct12L1f7evqxoBMLAxLfx2ZrvJ11ERV5+GRsGhtjxgJKRMINai398OV3tw9L0Uje4bB5KawXUGjfFSv589B1RwxOG2nMqfx0BB233NdsgE5ifVl9CbJK5wzMMbDe80DqMph80S0U4vbu6vR1EDQCkFIMD7ioa18F0hNnSeMnmrujarg0LR6hehKM56Gu91UblfpdRWUXvE4NwE3N3u28VY7VSLMy9aeldchaZcD1gcN3xAOyr1cHUY7hxXlUeBZ2I+0= X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4910; 6:/HVLDmU8BhbQgWACJWO3CJPtDjUvTLppeJHWXMPg/9AS/MiGaIsuT+GD3BAtUK64+9YbVTpUBG9rmfE5QTdKm+IHAPFlIQ+2x/atooe7iZFDRXK9Zom+2ulGop3SHcjqX7LkGnt+31Tb/N8sSNn02nXfssKmIxOuRLjF9dfFZP4tW9yoC5yIrt+aick+pTFK0tVVOh+mVxn/+jFueCVYajlLfIR7Nu67jimQZdFsL39FCsPqlkCok1KzrDZHKZR/RREoWxaHWWwZ2zUptz0z9AZfya72Kz7/HjY4d8oSR5avHz97+qkAhEPpU5mED4wGGKUJQVBSjWwkCUTwhIJ7oKjFgyWg47SIRR7i8lwZbgOXO7XqQzRFg7r1HdSsjAm3w5JqxC7C7iKWZyuzP44T4MQOBS0TLnANRRxu0lySlCum6CnHXf5hC/qIw4K1sjOj+hDu8Fs/3VFVWXiDKJkZEQ==; 5:2WbHpqzyxxgZZ6GeRwu3oA9V9xQAUzE6TSSgFQxxrHKNhZcjeuer1D2Ib5FXzcxINgLGZHy0D6mvvzPUUMcqV0GirMQPNSF1l0HT1eEh+ietT4ysjA8yQrTI6gvPTijVVD6CtushIKzjbDHt9miosKyEz4HqCfBfv1vGj417GPY=; 7:+F8DPGKTs/IzxehqCBdE+Hew9rRhZAPFm95xAFJcLAY0zYGo+6wg8wkhafND+AG44jXINrXkNB1MsvUfwKYKGmh4cPSZHBeas8Kf5yDp2N5BaTRJprWPCfrVVytkc/eTcRC02osNyy40AcPyY458M2NfDNxnlyXIqbNd0iFZlhzHr4Xjl/YX8atQFs/DybKCNB0kVUbisjzP4qtyDyH8g8I+V/o7oy0Z4W794ZQYLMyvoL3m0KWvJhjm1BWQfWoO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2018 13:00:14.4066 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3e9fc0a-0c25-44fd-34f2-08d62ac28059 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4910 Subject: [dpdk-dev] [PATCH v3 02/32] config: add Cavium OCTEONTX crypto PMD skeleton 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, 05 Oct 2018 13:00:20 -0000 From: Ankur Dwivedi Adding OCTEONTX crypto PMD skeleton. Updating the maintainers files to claim responsibility. Also enabling driver by default by adding the component in common_base. Signed-off-by: Ankur Dwivedi Signed-off-by: Anoob Joseph Signed-off-by: Murthy NSSR Signed-off-by: Nithin Dabilpuram Signed-off-by: Ragothaman Jayaraman Signed-off-by: Srisivasubramanian S Signed-off-by: Tejasree Kondoj --- MAINTAINERS | 1 + config/common_base | 5 + drivers/crypto/Makefile | 1 + drivers/crypto/meson.build | 2 +- drivers/crypto/octeontx/Makefile | 42 +++++++ drivers/crypto/octeontx/meson.build | 14 +++ drivers/crypto/octeontx/otx_cryptodev.c | 130 +++++++++++++++++++++ drivers/crypto/octeontx/otx_cryptodev.h | 20 ++++ drivers/crypto/octeontx/otx_cryptodev_ops.c | 15 +++ drivers/crypto/octeontx/otx_cryptodev_ops.h | 11 ++ .../octeontx/rte_pmd_octeontx_crypto_version.map | 4 + mk/rte.app.mk | 1 + 12 files changed, 245 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/octeontx/Makefile create mode 100644 drivers/crypto/octeontx/meson.build create mode 100644 drivers/crypto/octeontx/otx_cryptodev.c create mode 100644 drivers/crypto/octeontx/otx_cryptodev.h create mode 100644 drivers/crypto/octeontx/otx_cryptodev_ops.c create mode 100644 drivers/crypto/octeontx/otx_cryptodev_ops.h create mode 100644 drivers/crypto/octeontx/rte_pmd_octeontx_crypto_version.map diff --git a/MAINTAINERS b/MAINTAINERS index 52202b9..b38beb9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -775,6 +775,7 @@ F: doc/guides/cryptodevs/features/armv8.ini Cavium OCTEON TX M: Anoob Joseph F: drivers/common/cpt/ +F: drivers/crypto/octeontx/ Crypto Scheduler M: Fan Zhang diff --git a/config/common_base b/config/common_base index 61c7f6d..cf3da69 100644 --- a/config/common_base +++ b/config/common_base @@ -634,6 +634,11 @@ CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV=n CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV=n # +# Compile PMD for Cavium OCTEON TX crypto device +# +CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO=y + +# # Compile raw device support # EXPERIMENTAL: API may change without prior notice # diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile index c480cbd..c083e64 100644 --- a/drivers/crypto/Makefile +++ b/drivers/crypto/Makefile @@ -7,6 +7,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += aesni_gcm DIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += aesni_mb DIRS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += armv8 DIRS-$(CONFIG_RTE_LIBRTE_PMD_CCP) += ccp +DIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += octeontx DIRS-$(CONFIG_RTE_LIBRTE_PMD_OPENSSL) += openssl DIRS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += scheduler DIRS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += snow3g diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build index 6ed853b..b09fe1b 100644 --- a/drivers/crypto/meson.build +++ b/drivers/crypto/meson.build @@ -2,7 +2,7 @@ # Copyright(c) 2017 Intel Corporation drivers = ['ccp', 'dpaa_sec', 'dpaa2_sec', 'mvsam', - 'null', 'openssl', 'qat', 'scheduler', 'virtio'] + 'null', 'octeontx', 'openssl', 'qat', 'scheduler', 'virtio'] std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps config_flag_fmt = 'RTE_LIBRTE_@0@_PMD' diff --git a/drivers/crypto/octeontx/Makefile b/drivers/crypto/octeontx/Makefile new file mode 100644 index 0000000..12fec75 --- /dev/null +++ b/drivers/crypto/octeontx/Makefile @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Cavium, Inc +# + +include $(RTE_SDK)/mk/rte.vars.mk + +# library name +LIB = librte_pmd_octeontx_crypto.a + +# library version +LIBABIVER := 1 + +# build flags +CFLAGS += $(WERROR_FLAGS) + +LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring +LDLIBS += -lrte_cryptodev +LDLIBS += -lrte_pci -lrte_bus_pci + +VPATH += $(RTE_SDK)/drivers/crypto/octeontx + +CFLAGS += -O3 -DCPT_MODEL=CRYPTO_OCTEONTX +CFLAGS += -I$(RTE_SDK)/drivers/common/cpt + +# PMD code +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += otx_cryptodev.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += otx_cryptodev_ops.c + +# export include files +SYMLINK-y-include += + +# versioning export map +EXPORT_MAP := rte_pmd_octeontx_crypto_version.map + +# library dependencies +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += lib/librte_eal +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += lib/librte_cryptodev +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += lib/librte_mempool +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += lib/librte_mbuf +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += lib/librte_malloc + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/crypto/octeontx/meson.build b/drivers/crypto/octeontx/meson.build new file mode 100644 index 0000000..6564090 --- /dev/null +++ b/drivers/crypto/octeontx/meson.build @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Cavium, Inc +if host_machine.system() != 'linux' + build = false +endif + +deps += ['bus_pci'] +name = 'octeontx_crypto' + +sources = files('otx_cryptodev.c', + 'otx_cryptodev_ops.c') + +cflags += '-DCPT_MODEL=CRYPTO_OCTEONTX' +includes += include_directories('../../common/cpt') diff --git a/drivers/crypto/octeontx/otx_cryptodev.c b/drivers/crypto/octeontx/otx_cryptodev.c new file mode 100644 index 0000000..43933dd --- /dev/null +++ b/drivers/crypto/octeontx/otx_cryptodev.c @@ -0,0 +1,130 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Cavium, Inc + */ + +#include +#include +#include +#include +#include +#include + +/* CPT common headers */ +#include "cpt_pmd_logs.h" + +#include "otx_cryptodev.h" +#include "otx_cryptodev_ops.h" + +static int otx_cryptodev_logtype; + +static struct rte_pci_id pci_id_cpt_table[] = { + { + RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, CPT_81XX_PCI_VF_DEVICE_ID), + }, + /* sentinel */ + { + .device_id = 0 + }, +}; + +static void +otx_cpt_logtype_init(void) +{ + cpt_logtype = otx_cryptodev_logtype; +} + +static int +otx_cpt_pci_probe(struct rte_pci_driver *pci_drv, + struct rte_pci_device *pci_dev) +{ + struct rte_cryptodev *cryptodev; + char name[RTE_CRYPTODEV_NAME_MAX_LEN]; + int retval; + + if (pci_drv == NULL) + return -ENODEV; + + rte_pci_device_name(&pci_dev->addr, name, sizeof(name)); + + cryptodev = rte_cryptodev_pmd_allocate(name, rte_socket_id()); + if (cryptodev == NULL) + return -ENOMEM; + + cryptodev->device = &pci_dev->device; + cryptodev->device->driver = &pci_drv->driver; + cryptodev->driver_id = otx_cryptodev_driver_id; + + /* init user callbacks */ + TAILQ_INIT(&(cryptodev->link_intr_cbs)); + + /* init logtype used in common */ + otx_cpt_logtype_init(); + + /* Invoke PMD device initialization function */ + retval = otx_cpt_dev_create(cryptodev); + if (retval == 0) + return 0; + + CPT_LOG_ERR("[DRV %s]: Failed to create device " + "(vendor_id: 0x%x device_id: 0x%x", + pci_drv->driver.name, + (unsigned int) pci_dev->id.vendor_id, + (unsigned int) pci_dev->id.device_id); + + cryptodev->attached = RTE_CRYPTODEV_DETACHED; + + return -ENXIO; +} + +static int +otx_cpt_pci_remove(struct rte_pci_device *pci_dev) +{ + struct rte_cryptodev *cryptodev; + char name[RTE_CRYPTODEV_NAME_MAX_LEN]; + + if (pci_dev == NULL) + return -EINVAL; + + rte_pci_device_name(&pci_dev->addr, name, sizeof(name)); + + cryptodev = rte_cryptodev_pmd_get_named_dev(name); + if (cryptodev == NULL) + return -ENODEV; + + if (pci_dev->driver == NULL) + return -ENODEV; + + /* free crypto device */ + rte_cryptodev_pmd_release_device(cryptodev); + + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + rte_free(cryptodev->data->dev_private); + + cryptodev->device = NULL; + cryptodev->device->driver = NULL; + cryptodev->data = NULL; + + return 0; +} + +static struct rte_pci_driver otx_cryptodev_pmd = { + .id_table = pci_id_cpt_table, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING, + .probe = otx_cpt_pci_probe, + .remove = otx_cpt_pci_remove, +}; + +static struct cryptodev_driver otx_cryptodev_drv; + +RTE_PMD_REGISTER_PCI(CRYPTODEV_NAME_OCTEONTX_PMD, otx_cryptodev_pmd); +RTE_PMD_REGISTER_PCI_TABLE(CRYPTODEV_NAME_OCTEONTX_PMD, pci_id_cpt_table); +RTE_PMD_REGISTER_CRYPTO_DRIVER(otx_cryptodev_drv, otx_cryptodev_pmd.driver, + otx_cryptodev_driver_id); + +RTE_INIT(otx_cpt_init_log) +{ + /* Bus level logs */ + otx_cryptodev_logtype = rte_log_register("pmd.crypto.octeontx"); + if (otx_cryptodev_logtype >= 0) + rte_log_set_level(otx_cryptodev_logtype, RTE_LOG_NOTICE); +} diff --git a/drivers/crypto/octeontx/otx_cryptodev.h b/drivers/crypto/octeontx/otx_cryptodev.h new file mode 100644 index 0000000..62e6f70 --- /dev/null +++ b/drivers/crypto/octeontx/otx_cryptodev.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Cavium, Inc + */ + +#ifndef _OTX_CRYPTODEV_H_ +#define _OTX_CRYPTODEV_H_ + +/* Cavium OCTEON TX Crypto PMD device name */ +#define CRYPTODEV_NAME_OCTEONTX_PMD crypto_octeontx + +/* Device ID */ +#define PCI_VENDOR_ID_CAVIUM 0x177d +#define CPT_81XX_PCI_VF_DEVICE_ID 0xa041 + +/* + * Crypto device driver ID + */ +uint8_t otx_cryptodev_driver_id; + +#endif /* _OTX_CRYPTODEV_H_ */ diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c new file mode 100644 index 0000000..1b5f108 --- /dev/null +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Cavium, Inc + */ + +#include + +#include "otx_cryptodev.h" +#include "otx_cryptodev_ops.h" + +int +otx_cpt_dev_create(struct rte_cryptodev *c_dev) +{ + RTE_SET_USED(c_dev); + return 0; +} diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.h b/drivers/crypto/octeontx/otx_cryptodev_ops.h new file mode 100644 index 0000000..3f2d829 --- /dev/null +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Cavium, Inc + */ + +#ifndef _OTX_CRYPTODEV_OPS_H_ +#define _OTX_CRYPTODEV_OPS_H_ + +int +otx_cpt_dev_create(struct rte_cryptodev *c_dev); + +#endif /* _OTX_CRYPTODEV_OPS_H_ */ diff --git a/drivers/crypto/octeontx/rte_pmd_octeontx_crypto_version.map b/drivers/crypto/octeontx/rte_pmd_octeontx_crypto_version.map new file mode 100644 index 0000000..521e51f --- /dev/null +++ b/drivers/crypto/octeontx/rte_pmd_octeontx_crypto_version.map @@ -0,0 +1,4 @@ +DPDK_18.11 { + + local: *; +}; diff --git a/mk/rte.app.mk b/mk/rte.app.mk index c8a261e..248fce6 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -217,6 +217,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += -L$(LIBSSO_ZUC_PATH)/build -lsso _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += -lrte_pmd_armv8 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += -L$(ARMV8_CRYPTO_LIB_PATH) -larmv8_crypto _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_MVSAM_CRYPTO) += -L$(LIBMUSDK_PATH)/lib -lrte_pmd_mvsam_crypto -lmusdk +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += -lrte_pmd_octeontx_crypto _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += -lrte_pmd_crypto_scheduler ifeq ($(CONFIG_RTE_EAL_VFIO)$(CONFIG_RTE_LIBRTE_FSLMC_BUS),yy) _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += -lrte_pmd_dpaa2_sec -- 2.7.4