From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40047.outbound.protection.outlook.com [40.107.4.47]) by dpdk.org (Postfix) with ESMTP id 8B4667CBC for ; Mon, 22 Oct 2018 16:17:53 +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=GCNMZY8v4aXXRRLBM+keLSFsZEfmMZm5Yr0qy0Srxgk=; b=cVFgslGt2OLtaubkSbjpY94GpjEZiHOdR1pHAlYv3THYmK07I39Q+Sieqc/L8JmLdEV4VE7NXwy69cjuIo2HctFjNRYnFbg43n07wOiW1V9YcqJQciK713EYj9N/pUaoYgRCEKJaIRMbHazSzerNiAmyYq/c6ZLeRfs85TywkAs= Received: from HE1PR04MB1530.eurprd04.prod.outlook.com (10.164.48.20) by HE1PR04MB3242.eurprd04.prod.outlook.com (10.170.251.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.30; Mon, 22 Oct 2018 14:17:52 +0000 Received: from HE1PR04MB1530.eurprd04.prod.outlook.com ([fe80::95cd:198:d5c5:59a4]) by HE1PR04MB1530.eurprd04.prod.outlook.com ([fe80::95cd:198:d5c5:59a4%5]) with mapi id 15.20.1250.028; Mon, 22 Oct 2018 14:17:52 +0000 From: Gagandeep Singh To: "dev@dpdk.org" , Akhil Goyal CC: Gagandeep Singh , Hemant Agrawal Thread-Topic: [PATCH v4 09/15] crypto/caam_jr: add device cababilities Thread-Index: AQHUahIE3bAEHWFTtUmZ5N9PquurcQ== Date: Mon, 22 Oct 2018 14:17:52 +0000 Message-ID: <20181022141657.4727-10-g.singh@nxp.com> References: <20181022133021.11264-1-g.singh@nxp.com> <20181022141657.4727-1-g.singh@nxp.com> In-Reply-To: <20181022141657.4727-1-g.singh@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::11) To HE1PR04MB1530.eurprd04.prod.outlook.com (2a01:111:e400:59a8::20) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [14.142.187.166] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR04MB3242; 6:6FyghLPPqfQegSGUhoIQBrPs3eYf4HgUg0bDEWJDVzoqHqkykD0L4bRQCiZgyOV0dOo6DQWePbGcC06p+alN0j84P2RD3MAaYMS56bNvZ8WoXwn+65uLh8cNBlU+F3KTksTVICkbdXN2YevIftkyhniFnQtOEqbtwWdxbSZK96tPRCZ3KsPVxLqxb37NpmqtHujdVqTbGsEU4RjNCRJo4S7agxX+xmgDmbKQOI9A2ZRN6rDx//G4nlJMqYbPBrJpDNpHU7ftMipcRkKpfYlyL8bdyrSGAQzjvpaJ0ptWdg1GfySqzOjp3LwDxNbvIYPSIrQaZ8qgAqHPslgPfDw1o6cDEPYLxeoMF+GWbc+cEFLVd8iSMSFGSkabTBaoeZdfngD62KmZOqKxbqlQCdTH3AuAJ67rK42ELVjpLFNetaHpUDFSp1XZvleWYEcaL+t8Prz7L3tMjBiVKvSsb6XeUg==; 5:ZE1MThOHn4GnIaqp2Xp5EJsWttNppMduNf9+O8FhPQEcXt4OsJlSUo6rAP7q5EeaRkqqtyziNl8B3+Zmm7nUjPyqzw1wRfqv/uVV/xoHSrtOSCZTZRSSO4qsPt/4iURpEP8FxiyGl2g4tZaZDaSMA6/zH8VcFNWGn5YwDgb13+s=; 7:Ghl0LhaNZEw/GWxsB6jKqUD5iygad7JMDp64WZOK7lnoEG4wMgkeSbk6h+NEy35mejoC2q0FpeC0qPC2Nez9trt8b9sQaI22cuMnSRg28v5my8iNRQHv+bWXtGBNoqf/3UK7ztL2uz9GyGaRdrK9+Y9lyQlgoJjgraOjqk9LHV39AZeZCHtKCgVlpC1DCN4i4TTf3QGcRjXkvKBahD0N54ky2VeFDOj3XMDY+AqBxdSqcKdTZdeBqPf0PoOKuFLU x-ms-office365-filtering-correlation-id: 8b94f060-b4f7-48c6-a417-08d6382926bb 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:HE1PR04MB3242; x-ms-traffictypediagnostic: HE1PR04MB3242: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(192374486261705)(185117386973197); 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)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:HE1PR04MB3242; BCL:0; PCL:0; RULEID:; SRVR:HE1PR04MB3242; x-forefront-prvs: 08331F819E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(396003)(376002)(346002)(39860400002)(199004)(189003)(86362001)(68736007)(72206003)(1076002)(3846002)(6116002)(5660300001)(71200400001)(71190400001)(110136005)(54906003)(105586002)(78486010)(106356001)(6636002)(2906002)(7736002)(8936002)(305945005)(478600001)(81166006)(316002)(81156014)(8676002)(4326008)(25786009)(2900100001)(476003)(53936002)(66066001)(6486002)(14444005)(446003)(6436002)(6512007)(99286004)(52116002)(76176011)(36756003)(14454004)(256004)(6346003)(97736004)(2616005)(11346002)(486006)(186003)(26005)(2501003)(5250100002)(55236004)(102836004)(6506007)(386003); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB3242; H:HE1PR04MB1530.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; x-microsoft-antispam-message-info: 4i6pTx/NJ8oFDnza3sQhyLxyvjrSfXo56VI+8sdCX4lHjzdLofL48HX6pe6wqP5fxOabEov+0RXTVmYF7BjyFIj/2qB0ytUe3l1BfxDk5L1oF9/hsReJwhLaEY0qxhp5vgYoMjzM0Lsky2yI7+5QAlSFfvy08qB7mMglP9TqMK8MYlaaMMNsN1wQ+GYWQhbW0D6vt3YARxc6H0fZnlVHbGtXl/FCWZHR7wl1oq3bBvLP2RY09j3AL6M2sfyL3UukluwaR2S1lXAKw7OiIbjWtshv8pz7WiwCnDZLfWOoPFSXhcfWnuqsE8GFF777LXEYZx7Y8vXiZfX4jGFwKdQbKy2+7hQkB74kXY+5k2RcVYY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8b94f060-b4f7-48c6-a417-08d6382926bb X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2018 14:17:52.2859 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3242 Subject: [dpdk-dev] [PATCH v4 09/15] 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: Mon, 22 Oct 2018 14:17:54 -0000 add device capabilities for supported algorithms, key length etc. Signed-off-by: Gagandeep Singh Signed-off-by: Hemant Agrawal Acked-by: Akhil Goyal --- drivers/crypto/caam_jr/Makefile | 1 + drivers/crypto/caam_jr/caam_jr.c | 2 + drivers/crypto/caam_jr/caam_jr_capabilities.c | 232 ++++++++++++++++++ drivers/crypto/caam_jr/caam_jr_capabilities.h | 13 + drivers/crypto/caam_jr/meson.build | 5 +- 5 files changed, 252 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/caam_jr/caam_jr_capabilities.c create mode 100644 drivers/crypto/caam_jr/caam_jr_capabilities.h diff --git a/drivers/crypto/caam_jr/Makefile b/drivers/crypto/caam_jr/Makef= ile index cfd093a5f..88cdf7410 100644 --- a/drivers/crypto/caam_jr/Makefile +++ b/drivers/crypto/caam_jr/Makefile @@ -31,6 +31,7 @@ LIBABIVER :=3D 1 =20 # library source files SRCS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) +=3D caam_jr.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) +=3D caam_jr_capabilities.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) +=3D caam_jr_hw.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) +=3D caam_jr_uio.c # library dependencies diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam= _jr.c index aec033649..96b18be12 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -16,6 +16,7 @@ #include #include =20 +#include #include #include #include @@ -438,6 +439,7 @@ caam_jr_dev_infos_get(struct rte_cryptodev *dev, if (info !=3D NULL) { info->max_nb_queue_pairs =3D internals->max_nb_queue_pairs; info->feature_flags =3D dev->feature_flags; + info->capabilities =3D caam_jr_get_cryptodev_capabilities(); info->sym.max_nb_sessions =3D internals->max_nb_sessions; info->driver_id =3D cryptodev_driver_id; } 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..92aa429cc --- /dev/null +++ b/drivers/crypto/caam_jr/caam_jr_capabilities.c @@ -0,0 +1,232 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2017-2018 NXP + */ + +#include + +static const struct rte_cryptodev_capabilities caam_jr_capabilities[] =3D = { + { /* MD5 HMAC */ + .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym =3D { + .xform_type =3D RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth =3D { + .algo =3D RTE_CRYPTO_AUTH_MD5_HMAC, + .block_size =3D 64, + .key_size =3D { + .min =3D 1, + .max =3D 64, + .increment =3D 1 + }, + .digest_size =3D { + .min =3D 1, + .max =3D 16, + .increment =3D 1 + }, + .iv_size =3D { 0 } + }, } + }, } + }, + { /* SHA1 HMAC */ + .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym =3D { + .xform_type =3D RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth =3D { + .algo =3D RTE_CRYPTO_AUTH_SHA1_HMAC, + .block_size =3D 64, + .key_size =3D { + .min =3D 1, + .max =3D 64, + .increment =3D 1 + }, + .digest_size =3D { + .min =3D 1, + .max =3D 20, + .increment =3D 1 + }, + .iv_size =3D { 0 } + }, } + }, } + }, + { /* SHA224 HMAC */ + .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym =3D { + .xform_type =3D RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth =3D { + .algo =3D RTE_CRYPTO_AUTH_SHA224_HMAC, + .block_size =3D 64, + .key_size =3D { + .min =3D 1, + .max =3D 64, + .increment =3D 1 + }, + .digest_size =3D { + .min =3D 1, + .max =3D 28, + .increment =3D 1 + }, + .iv_size =3D { 0 } + }, } + }, } + }, + { /* SHA256 HMAC */ + .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym =3D { + .xform_type =3D RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth =3D { + .algo =3D RTE_CRYPTO_AUTH_SHA256_HMAC, + .block_size =3D 64, + .key_size =3D { + .min =3D 1, + .max =3D 64, + .increment =3D 1 + }, + .digest_size =3D { + .min =3D 1, + .max =3D 32, + .increment =3D 1 + }, + .iv_size =3D { 0 } + }, } + }, } + }, + { /* SHA384 HMAC */ + .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym =3D { + .xform_type =3D RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth =3D { + .algo =3D RTE_CRYPTO_AUTH_SHA384_HMAC, + .block_size =3D 128, + .key_size =3D { + .min =3D 1, + .max =3D 128, + .increment =3D 1 + }, + .digest_size =3D { + .min =3D 1, + .max =3D 48, + .increment =3D 1 + }, + .iv_size =3D { 0 } + }, } + }, } + }, + { /* SHA512 HMAC */ + .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym =3D { + .xform_type =3D RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth =3D { + .algo =3D RTE_CRYPTO_AUTH_SHA512_HMAC, + .block_size =3D 128, + .key_size =3D { + .min =3D 1, + .max =3D 128, + .increment =3D 1 + }, + .digest_size =3D { + .min =3D 1, + .max =3D 64, + .increment =3D 1 + }, + .iv_size =3D { 0 } + }, } + }, } + }, + { /* AES GCM */ + .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym =3D { + .xform_type =3D RTE_CRYPTO_SYM_XFORM_AEAD, + {.aead =3D { + .algo =3D RTE_CRYPTO_AEAD_AES_GCM, + .block_size =3D 16, + .key_size =3D { + .min =3D 16, + .max =3D 32, + .increment =3D 8 + }, + .digest_size =3D { + .min =3D 8, + .max =3D 16, + .increment =3D 4 + }, + .aad_size =3D { + .min =3D 0, + .max =3D 240, + .increment =3D 1 + }, + .iv_size =3D { + .min =3D 12, + .max =3D 12, + .increment =3D 0 + }, + }, } + }, } + }, + { /* AES CBC */ + .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym =3D { + .xform_type =3D RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher =3D { + .algo =3D RTE_CRYPTO_CIPHER_AES_CBC, + .block_size =3D 16, + .key_size =3D { + .min =3D 16, + .max =3D 32, + .increment =3D 8 + }, + .iv_size =3D { + .min =3D 16, + .max =3D 16, + .increment =3D 0 + } + }, } + }, } + }, + { /* AES CTR */ + .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym =3D { + .xform_type =3D RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher =3D { + .algo =3D RTE_CRYPTO_CIPHER_AES_CTR, + .block_size =3D 16, + .key_size =3D { + .min =3D 16, + .max =3D 32, + .increment =3D 8 + }, + .iv_size =3D { + .min =3D 16, + .max =3D 16, + .increment =3D 0 + } + }, } + }, } + }, + { /* 3DES CBC */ + .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym =3D { + .xform_type =3D RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher =3D { + .algo =3D RTE_CRYPTO_CIPHER_3DES_CBC, + .block_size =3D 8, + .key_size =3D { + .min =3D 16, + .max =3D 24, + .increment =3D 8 + }, + .iv_size =3D { + .min =3D 8, + .max =3D 8, + .increment =3D 0 + } + }, } + }, } + }, + + RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() +}; + +const struct rte_cryptodev_capabilities * +caam_jr_get_cryptodev_capabilities(void) +{ + return caam_jr_capabilities; +} diff --git a/drivers/crypto/caam_jr/caam_jr_capabilities.h b/drivers/crypto= /caam_jr/caam_jr_capabilities.h new file mode 100644 index 000000000..7a94013e5 --- /dev/null +++ b/drivers/crypto/caam_jr/caam_jr_capabilities.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2017-2018 NXP + */ + +#ifndef CAAM_JR_CAPABILITIES_H +#define CAAM_JR_CAPABILITIES_H + +#include + +/* Get cryptodev capabilities */ +const struct rte_cryptodev_capabilities * +caam_jr_get_cryptodev_capabilities(void); +#endif diff --git a/drivers/crypto/caam_jr/meson.build b/drivers/crypto/caam_jr/me= son.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() !=3D 'linux' endif =20 deps +=3D ['bus_vdev', 'bus_dpaa', 'security'] -sources =3D files('caam_jr_hw.c', 'caam_jr_uio.c', 'caam_jr.c') +sources =3D files('caam_jr_capabilities.c', + 'caam_jr_hw.c', + 'caam_jr_uio.c', + 'caam_jr.c') =20 allow_experimental_apis =3D true =20 --=20 2.17.1