From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50064.outbound.protection.outlook.com [40.107.5.64]) by dpdk.org (Postfix) with ESMTP id D6B2C1B950 for ; Fri, 12 Oct 2018 16:41:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Fe5bYn6/7sKU4kn4xvBx9YwQ1jOur4JDhuUSm8pYLDw=; b=wAK0j8HzG5ZPZjjCkznHxGSE7RECAxL3PYjDJGg2+Eb2Iia2MdtgoxSX+XEiFL4DBrZBYEAotiFr6y5Bdgb6A7brDiujFQi9Pqs5dfH0E8dMhadeXBhQ0xMopB1xCGaIiFoR27B6EDVqiFCbYnhienvgRN7WYrHzxNqplFvNONU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by HE1PR04MB1530.eurprd04.prod.outlook.com (2a01:111:e400:59a8::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.23; Fri, 12 Oct 2018 14:41:46 +0000 From: Gagandeep Singh To: dev@dpdk.org, akhil.goyal@nxp.com Cc: Gagandeep Singh , Hemant Agrawal Date: Fri, 12 Oct 2018 20:10:49 +0530 Message-Id: <20181012144055.9461-9-g.singh@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012144055.9461-1-g.singh@nxp.com> References: <20180913060846.29930-1-g.singh@nxp.com> <20181012144055.9461-1-g.singh@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0039.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:c::25) To HE1PR04MB1530.eurprd04.prod.outlook.com (2a01:111:e400:59a8::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9691cb75-ac48-4b7d-a064-08d63050d6f3 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:HE1PR04MB1530; X-Microsoft-Exchange-Diagnostics: 1; HE1PR04MB1530; 3:mOsWP0ffOH36AcobPzOJtl9zyJa+svr+q35yjkqtbgdjsr/atyC4JpCsqF+X/PGBEokLbZIO/mqVfAu2fZ/iOU8gFRbQdb3sYXUBZYRDni3c4xM8MEbPE9elzg+Abg+5xDY/PSQzwQykkrcEMbUMwNJlps5CrsK9xcBFm6Ozrg3J9lMlydqC8Dfk93kmJDF0myCLkwGzuwsBurscCqWVtvjcjavS7g2zMULQ37fmaLs42xdfFOmR/8MJu0VXvS2/; 25:UJaxDT8exbkAbhqLHa1T4BzbVvth5mZRrxI75feMnTPt8mFBfe2uXWqzsv2kkL4Tqv+payRk2Y72LjuMrxr6ZfP6mdzf6O1tUJ4/TCW+vfIoroDZfW6Yo4VSeOkFNLVsgxaWRE+sLmVVWBB2Cfb/DQqHge2CRuuathx0J7HjF4tcATuguMK6xxcd7SakfAf7AfIO5Ea+Mht/LwM8v2XIwhbAQnUGX89YWTisOLXMK+iir/S/9tCEgDcP5dDFuz0jWTvvIzrJFFht70bJmWLMsy/ml8/BHNQlBFfQAR61bkvX73/qakVy90PHHw6Gkc3ZpEYYLPE2uxlhOQEx+37tQw==; 31:9JbAMBf0PXL/7cGXd/PzzFlMABv86DR17Mg0YIa5snTDRwh0W7nmNxB2gmDVOrAoytkF+DT3aXP4CrEgj6aZeQZoWVudYkghZiJDH8a+sl58UEo5OLWGJfral2gdPDj87dhhmrmdRK+rlRQfsgSftjuCzLoLX5aCE28c76xMidkmULCqvBVspmj+cHwbGSpWHFG2h6YQUGzO4Br9BK//e4592Bru5nxdS12Fe/qC4Rg= X-MS-TrafficTypeDiagnostic: HE1PR04MB1530: X-Microsoft-Exchange-Diagnostics: 1; HE1PR04MB1530; 20:+laAaZZdDO/7f/UWQwW9B/5tXyLoG1cOs2pmDhyehL0z1fGz3SKJjqOAgyVupkXBmF4aVXlS6xED5pne/9UvzHcVxSEqxS/JwNIQ/MSniW2ixgLRVd/HtMLz7xOHcufKMgBbTkgt5/lFFC/yLrpqoS+1m2Y0WxDZqDl2wbqpezzDBd2ZF2MF8T/Rnsp3DdvktwbuJX8eorBNXefEDXYoP9TRqqxQu1WHZ6x/yVM8N7DKtQlzUhcrlRbZtIrsnjq27qh2gTdG5ITMGHqQPEKJ3n9rGfYdqpIvm9x5pGizhI60sB7uEb1LLuBHHrSqKGyMf6MDtYBo3xZIRCnQYvh4ddwj3UH8Ogc2oT8NrTGujAHNyL9x7+lPDqkUq2pJL8MxC+3kR/wY2JdlVvxr2G81/PDNieae+EkZQqVBA97vtJTFo8DWsK8TcCoLpSFGipX0o4a+Vj7Po+feEke18zFXcoZw0X1k0LembxrrfJT6p8dEWbTAsbNHLSkfR+1vmVcJ; 4:nrC1nQqf/8VOe6qMOsUjzyVKmyCcT7eWDNPh1/22tWc9fl6voMHFcG/KrB57Ueo3PPyqQkK+J11vl/vYxcEbSnlg6kHEn5czDyJbbsoayBMb3SIjoV3j85M8hMG6M0zLPeRj/Z/VxMTs78rZufGFfoNhA5qfxxo3eoB22xtRw3L/D+RfveF+GoSUOjVjuzv5kDy2IWBhdK8obByCoTuHIR+GsCNVHIsekqeUmLThVcDMrC0aehGwUU42598mpetxMcEOaUut8G8Or+xhvoo28Lfy8zr5TU+e5zPJXy0AS9gZwtkNfePKf30LBE1YUo7g5KSIuXzo/nbpGv0vIvalZLcDzptTO/lnjudy3BdgbQs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(192374486261705); 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)(93001095)(6055026)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(201708071742011)(7699051); SRVR:HE1PR04MB1530; BCL:0; PCL:0; RULEID:; SRVR:HE1PR04MB1530; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(396003)(136003)(39860400002)(189003)(199004)(316002)(305945005)(8936002)(386003)(55236004)(6636002)(6506007)(106356001)(25786009)(36756003)(16586007)(5660300001)(72206003)(52116002)(53936002)(26005)(6512007)(478600001)(54906003)(68736007)(186003)(16526019)(50226002)(7736002)(105586002)(51416003)(97736004)(76176011)(78486009)(3846002)(2906002)(66066001)(1076002)(4326008)(956004)(446003)(2616005)(47776003)(11346002)(1006002)(6116002)(486006)(14444005)(476003)(8676002)(50466002)(48376002)(81156014)(86362001)(81166006)(6486002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB1530; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR04MB1530; 23:RYItyFXnJ17X1NI5syTiHhX8ncUI2V4mb9qEDY74n?= =?us-ascii?Q?6fWagMcPxvM39W9q0R/BtUPnpIEn3SSc87t/W7oJmWt2Vu9m/R37yPze+AnR?= =?us-ascii?Q?d4HWGKNR4HBdfdbgwmgOOrENA2Lo49obVKokjPykJM14BNnY0ZcKmJd2fiUA?= =?us-ascii?Q?d1Noi2ZoPLte1JIodbFvoiIPSOhfs9zFfjUhy/0tkP2VXcIyjoCHnrGKUkbD?= =?us-ascii?Q?3agTCdnW2ANeyztxHCvBzUHJl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pvs7jvwLcQkvjX2vv7uqzeZDFtpuI23nsowK5sjohD5rBWtgc5YVRTJnQgavMJJ8fWw==; 5:hAaNg2OMPvGdPuF0xKAuuvA5UeqOqZkaA16mbgIKtSPCnrox6CeSS8d5kFEKIQq0fVSLebGIclsmcq1M5zhUPHwCkRvF11MIrYKHWbag/dmzGU6Hl71mY0MlWsqjzgddtZ8ogmmXseAzVPfQkIKX1Dp4PRhouayCiuSiRmA8vYI=; 7:AlIY3Rtm/XrPZC/48MazYtip33itYKX1jh8uckFOM+gt+kCfVrzCY8J2uoSfWlVaK7WvzRYx7cfgbrChgLuxWNKIOt8rnVG14idCHBUM2k2wA27md6GtP+6ORUoKqxv8XGlSZYQOS6vRz7YM9uE3yh1PrzNiNzDoblozcO0wjEYow/ahIXWTNvlPAM31DQnDWKzxZ4S7Y2KPmxyjvZS/SrQtmr2Zut+3QZvLwBU9Sff6fLtr3zTFl1PfYJox74It SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 14:41:46.9279 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9691cb75-ac48-4b7d-a064-08d63050d6f3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB1530 Subject: [dpdk-dev] [PATCH v2 08/14] crypto/caam_jr: add device cababilities 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, 12 Oct 2018 14:41:50 -0000 add device capabilities for supported algorithms, key length etc. Signed-off-by: Gagandeep Singh Signed-off-by: Hemant Agrawal --- drivers/crypto/caam_jr/Makefile | 1 + drivers/crypto/caam_jr/caam_jr.h | 18 ++ drivers/crypto/caam_jr/caam_jr_capabilities.c | 266 ++++++++++++++++++ drivers/crypto/caam_jr/meson.build | 5 +- 4 files changed, 289 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/caam_jr/caam_jr.h create mode 100644 drivers/crypto/caam_jr/caam_jr_capabilities.c diff --git a/drivers/crypto/caam_jr/Makefile b/drivers/crypto/caam_jr/Makefile index cfd093a5f..88cdf7410 100644 --- a/drivers/crypto/caam_jr/Makefile +++ b/drivers/crypto/caam_jr/Makefile @@ -31,6 +31,7 @@ LIBABIVER := 1 # library source files SRCS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) += caam_jr.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) += caam_jr_capabilities.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) += caam_jr_hw.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) += caam_jr_uio.c # library dependencies diff --git a/drivers/crypto/caam_jr/caam_jr.h b/drivers/crypto/caam_jr/caam_jr.h new file mode 100644 index 000000000..ef0900641 --- /dev/null +++ b/drivers/crypto/caam_jr/caam_jr.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2017-2018 NXP + */ + +#ifndef CAAM_JR_H +#define CAAM_JR_H + +#include +#include + +/* Get cryptodev capabilities */ +const struct rte_cryptodev_capabilities * +caam_jr_get_cryptodev_capabilities(void); +/* Get security capabilities */ +const struct rte_security_capability * +caam_jr_get_security_capabilities(void *device); + +#endif diff --git a/drivers/crypto/caam_jr/caam_jr_capabilities.c b/drivers/crypto/caam_jr/caam_jr_capabilities.c new file mode 100644 index 000000000..88c9b33c6 --- /dev/null +++ b/drivers/crypto/caam_jr/caam_jr_capabilities.c @@ -0,0 +1,266 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2017-2018 NXP + */ + +#include + +static const struct rte_cryptodev_capabilities caam_jr_capabilities[] = { + { /* MD5 HMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_MD5_HMAC, + .block_size = 64, + .key_size = { + .min = 1, + .max = 64, + .increment = 1 + }, + .digest_size = { + .min = 1, + .max = 16, + .increment = 1 + }, + .iv_size = { 0 } + }, } + }, } + }, + { /* SHA1 HMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA1_HMAC, + .block_size = 64, + .key_size = { + .min = 1, + .max = 64, + .increment = 1 + }, + .digest_size = { + .min = 1, + .max = 20, + .increment = 1 + }, + .iv_size = { 0 } + }, } + }, } + }, + { /* SHA224 HMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA224_HMAC, + .block_size = 64, + .key_size = { + .min = 1, + .max = 64, + .increment = 1 + }, + .digest_size = { + .min = 1, + .max = 28, + .increment = 1 + }, + .iv_size = { 0 } + }, } + }, } + }, + { /* SHA256 HMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA256_HMAC, + .block_size = 64, + .key_size = { + .min = 1, + .max = 64, + .increment = 1 + }, + .digest_size = { + .min = 1, + .max = 32, + .increment = 1 + }, + .iv_size = { 0 } + }, } + }, } + }, + { /* SHA384 HMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA384_HMAC, + .block_size = 128, + .key_size = { + .min = 1, + .max = 128, + .increment = 1 + }, + .digest_size = { + .min = 1, + .max = 48, + .increment = 1 + }, + .iv_size = { 0 } + }, } + }, } + }, + { /* SHA512 HMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA512_HMAC, + .block_size = 128, + .key_size = { + .min = 1, + .max = 128, + .increment = 1 + }, + .digest_size = { + .min = 1, + .max = 64, + .increment = 1 + }, + .iv_size = { 0 } + }, } + }, } + }, + { /* AES GCM */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AEAD, + {.aead = { + .algo = RTE_CRYPTO_AEAD_AES_GCM, + .block_size = 16, + .key_size = { + .min = 16, + .max = 32, + .increment = 8 + }, + .digest_size = { + .min = 8, + .max = 16, + .increment = 4 + }, + .aad_size = { + .min = 0, + .max = 240, + .increment = 1 + }, + .iv_size = { + .min = 12, + .max = 12, + .increment = 0 + }, + }, } + }, } + }, + { /* AES CBC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher = { + .algo = RTE_CRYPTO_CIPHER_AES_CBC, + .block_size = 16, + .key_size = { + .min = 16, + .max = 32, + .increment = 8 + }, + .iv_size = { + .min = 16, + .max = 16, + .increment = 0 + } + }, } + }, } + }, + { /* AES CTR */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher = { + .algo = RTE_CRYPTO_CIPHER_AES_CTR, + .block_size = 16, + .key_size = { + .min = 16, + .max = 32, + .increment = 8 + }, + .iv_size = { + .min = 16, + .max = 16, + .increment = 0 + } + }, } + }, } + }, + { /* 3DES CBC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher = { + .algo = RTE_CRYPTO_CIPHER_3DES_CBC, + .block_size = 8, + .key_size = { + .min = 16, + .max = 24, + .increment = 8 + }, + .iv_size = { + .min = 8, + .max = 8, + .increment = 0 + } + }, } + }, } + }, + + RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() +}; + +static const struct rte_security_capability caam_jr_security_cap[] = { + { /* IPsec Lookaside Protocol offload ESP Transport Egress */ + .action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL, + .protocol = RTE_SECURITY_PROTOCOL_IPSEC, + .ipsec = { + .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP, + .mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL, + .direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS, + .options = { 0 } + }, + .crypto_capabilities = caam_jr_capabilities + }, + { /* IPsec Lookaside Protocol offload ESP Tunnel Ingress */ + .action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL, + .protocol = RTE_SECURITY_PROTOCOL_IPSEC, + .ipsec = { + .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP, + .mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL, + .direction = RTE_SECURITY_IPSEC_SA_DIR_INGRESS, + .options = { 0 } + }, + .crypto_capabilities = caam_jr_capabilities + }, + { + .action = RTE_SECURITY_ACTION_TYPE_NONE + } +}; + +const struct rte_cryptodev_capabilities * +caam_jr_get_cryptodev_capabilities(void) +{ + return caam_jr_capabilities; +} + +const struct rte_security_capability * +caam_jr_get_security_capabilities(void *device __rte_unused) +{ + return caam_jr_security_cap; +} diff --git a/drivers/crypto/caam_jr/meson.build b/drivers/crypto/caam_jr/meson.build index 7b024e886..99b71aef1 100644 --- a/drivers/crypto/caam_jr/meson.build +++ b/drivers/crypto/caam_jr/meson.build @@ -6,7 +6,10 @@ if host_machine.system() != 'linux' endif deps += ['bus_vdev', 'bus_dpaa', 'security'] -sources = files('caam_jr_hw.c', 'caam_jr_uio.c', 'caam_jr.c') +sources = files('caam_jr_capabilities.c', + 'caam_jr_hw.c', + 'caam_jr_uio.c', + 'caam_jr.c') allow_experimental_apis = true -- 2.17.1