From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 74724A0471 for ; Fri, 19 Jul 2019 14:34:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E29521B974; Fri, 19 Jul 2019 14:33:53 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id C2B125B3E for ; Fri, 19 Jul 2019 14:33:41 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x6JCTZPk023558 for ; Fri, 19 Jul 2019 05:33:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=I4eCsUpfWITOuDcOzJWZ4GoYYZM99YBZvVVUVWd7lhE=; b=MJ4FBw90lAQ+Z1/8EEWIfeMqX9lZxuZ2/pYWbMUCUSHdUCkUxjqNIr3g5hWHrW5pNXtu oLWveBUC+vhJ7nW4KAbKmkJsOYf6I79h3KLN3l2wxc1B4i0sgCoTBbWDKxwK7B0OOfK+ sk+C/ovnhiKGkWyG2HkZDlZMwSXmdSaKTeRBJ6uRFDTYx9N6otuTgQ+tks0RWUMeAw11 7N2HE8UvCEr/ybV1NHvIdgslw6SWVadsSUUOWBEIWC1vEVJboG54n3Ejp9zIoaHEt8bj U+WMtUOjvUtGZED8lmx8jNo8rB98inzQBZEefWDWDYtNQ6bgVD1uv3N9DtsPM9PquxmJ nw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2ts07vse5a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 19 Jul 2019 05:33:40 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 19 Jul 2019 05:33:39 -0700 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (104.47.42.56) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Fri, 19 Jul 2019 05:33:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g3GNsF9xfcR/oL91lwt5aeXtF/RwAJPG4hmpeLD6EftepvlyC7omfCu9upjbnSB1SAAHamCMkvQm0c1KwKRpjWxp/qTYG4vq4W2PxoGxQMdpv+UHE4lq5i9Ziluqs2CRRe54m6M7P8XGVj5BiyrBdyN5E8u/mE2KZRjSVFTFZgSeKhxTflZrA/B1B8yiAp4UR6/aBBw151mO8S5lLA8crPTAeRbtt9rNjTqJRTt8wZFhRc5DN0dq2wZnvJ07zxKRgZ6i4ehWnocfoJ4KWz42dYuyLCceTCdlom+SX/w23qVXdCU5Z1YeT2OCrp0JJusHIiUl4Yezbc6dQ+xCqZ6OHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I4eCsUpfWITOuDcOzJWZ4GoYYZM99YBZvVVUVWd7lhE=; b=gu7gYs9Muy04tNr5QJu51BSIUkcoaCNWduhelTf2LnB3Guld99GjfXp3GBNOVq20b6qzWoMg5F4MivXGLYEoxVqeqp7OaGtw2wkv96c4XcV/P5QbNvFrLAkshyEpgZMF8w8BI2aaHmR5czJGtX0srPKX/xDvxHqpsVKPi6CT5IFBQFi3jDFPn/uSFgkRrDCsqAfG/Dcpk8OIrN4ujrdvAwE4ynlX3wWjVgJg5NdAMUwRjx2hPRN/sCw8GoiGvz5kRK+K8/8jNXSAd/naoh1Aj2y76KvV+66jfjylsrJBorCFiqhxJF1cDjsOSUcVjBhZ/RvUzw/fCGOkbiAPwOIhFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=marvell.com;dmarc=pass action=none header.from=marvell.com;dkim=pass header.d=marvell.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I4eCsUpfWITOuDcOzJWZ4GoYYZM99YBZvVVUVWd7lhE=; b=EGOQEdN0yUwlcS+oXppboUW3TFUpbjoHwALI05t7eCvpeibhU6SkpFAIlIq1TwsNPE1GjSg1Tgp6akzouFr0W9owVD5fWZ7vlhhA53a7YW85FFt4Doz75cKDqwLJuSaV17yLymHMQiwSAWHqLGmMOr1UDP19RD1yLSE7kJQa3ac= Received: from MN2PR18MB2797.namprd18.prod.outlook.com (20.179.22.16) by MN2PR18MB2527.namprd18.prod.outlook.com (20.179.82.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Fri, 19 Jul 2019 12:33:37 +0000 Received: from MN2PR18MB2797.namprd18.prod.outlook.com ([fe80::5d53:ac2e:80ec:cd8f]) by MN2PR18MB2797.namprd18.prod.outlook.com ([fe80::5d53:ac2e:80ec:cd8f%6]) with mapi id 15.20.2094.011; Fri, 19 Jul 2019 12:33:37 +0000 From: Nagadheeraj Rottela To: "dev@dpdk.org" CC: Srikanth Jampala , Nagadheeraj Rottela Thread-Topic: [PATCH v2 04/10] crypto/nitrox: add basic symmetric cryptodev operations Thread-Index: AQHVPi4w2SM9Sb8i80y95LYBQm2G9w== Date: Fri, 19 Jul 2019 12:33:37 +0000 Message-ID: <20190719123309.24417-5-rnagadheeraj@marvell.com> References: <20190717052837.647-1-rnagadheeraj@marvell.com> <20190719123309.24417-1-rnagadheeraj@marvell.com> In-Reply-To: <20190719123309.24417-1-rnagadheeraj@marvell.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0048.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::34) To MN2PR18MB2797.namprd18.prod.outlook.com (2603:10b6:208:a0::16) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.13.6 x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: db58cc4a-870e-4231-4a30-08d70c45527b x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MN2PR18MB2527; x-ms-traffictypediagnostic: MN2PR18MB2527: x-ms-exchange-purlcount: 2 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 01039C93E4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(346002)(39860400002)(396003)(366004)(376002)(199004)(189003)(2616005)(6486002)(107886003)(36756003)(6306002)(486006)(5660300002)(316002)(99286004)(966005)(6116002)(14454004)(102836004)(1076003)(476003)(86362001)(6916009)(6512007)(5640700003)(8936002)(76176011)(53936002)(186003)(26005)(54906003)(6436002)(2501003)(8676002)(81166006)(1730700003)(81156014)(478600001)(3846002)(66476007)(66446008)(64756008)(52116002)(25786009)(68736007)(50226002)(4326008)(2906002)(66946007)(71200400001)(446003)(71190400001)(11346002)(14444005)(66066001)(55236004)(2351001)(7736002)(6506007)(305945005)(66556008)(256004)(386003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2527; H:MN2PR18MB2797.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: AG+L/OT5bczZC02tzIqH2beBvBtzrsob0zfL/9V8KOyb5cvE7leO3YM9QY5P8hyR4C9lHmRgv8m3RYwsI4+WC7jbW7SI5gnnq8zKuUn0KvLT3/OyMtZ4K57LrMtUYu5chMQybIycTrKkRmw0squg+nehWnrKoBG9fvC8bUTAnV9fcgeDYuKH4Qem1s18T28ZELIi5kF/SRLnwtiKO/YftwFIJYXY9NiBm6JdT21QfZPw3epxRqxpTSpsoPMfdDprDGTgH45/LdyZi/Si5yVewJ3t74O3AvJJDW9mdARegEganviZHXOizfkZwlBr98fEdUhGn68uCAjyG+WfC/B/bsLKJ3sXiKnnhEpGefS27Odc+INykzSrdnXXyhGI2Zmik1bk7cm8Tp4Driib+uAgY2KdfJyn+dSjxUtFBp90IyU= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: db58cc4a-870e-4231-4a30-08d70c45527b X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2019 12:33:37.3562 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rnagadheeraj@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2527 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-07-19_09:2019-07-19,2019-07-19 signatures=0 Subject: [dpdk-dev] [PATCH v2 04/10] crypto/nitrox: add basic symmetric cryptodev operations 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add the following cryptodev operations, - dev_configure - dev_start - dev_stop - dev_close - dev_infos_get Signed-off-by: Nagadheeraj Rottela --- doc/guides/cryptodevs/features/nitrox.ini | 38 ++++++++++++ doc/guides/cryptodevs/nitrox.rst | 37 +++++++++++ drivers/crypto/nitrox/Makefile | 1 + drivers/crypto/nitrox/meson.build | 1 + drivers/crypto/nitrox/nitrox_sym.c | 81 +++++++++++++++++++++= +++- drivers/crypto/nitrox/nitrox_sym_capabilities.c | 57 +++++++++++++++++ drivers/crypto/nitrox/nitrox_sym_capabilities.h | 12 ++++ 7 files changed, 226 insertions(+), 1 deletion(-) create mode 100644 doc/guides/cryptodevs/features/nitrox.ini create mode 100644 drivers/crypto/nitrox/nitrox_sym_capabilities.c create mode 100644 drivers/crypto/nitrox/nitrox_sym_capabilities.h diff --git a/doc/guides/cryptodevs/features/nitrox.ini b/doc/guides/cryptod= evs/features/nitrox.ini new file mode 100644 index 000000000..9f9e2619c --- /dev/null +++ b/doc/guides/cryptodevs/features/nitrox.ini @@ -0,0 +1,38 @@ +; +; Supported features of the 'nitrox' crypto driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Symmetric crypto =3D Y +Sym operation chaining =3D Y +HW Accelerated =3D Y +In Place SGL =3D Y +OOP SGL In SGL Out =3D Y +OOP SGL In LB Out =3D Y +OOP LB In SGL Out =3D Y +OOP LB In LB Out =3D Y + +; +; Supported crypto algorithms of the 'nitrox' crypto driver. +; +[Cipher] +AES CBC (128) =3D Y +AES CBC (192) =3D Y +AES CBC (256) =3D Y + +; +; Supported authentication algorithms of the 'nitrox' crypto driver. +; +[Auth] +SHA1 HMAC =3D Y + +; +; Supported AEAD algorithms of the 'nitrox' crypto driver. +; +[AEAD] + +; +; Supported Asymmetric algorithms of the 'nitrox' crypto driver. +; +[Asymmetric] diff --git a/doc/guides/cryptodevs/nitrox.rst b/doc/guides/cryptodevs/nitro= x.rst index b6b86dda5..c16a5e393 100644 --- a/doc/guides/cryptodevs/nitrox.rst +++ b/doc/guides/cryptodevs/nitrox.rst @@ -9,3 +9,40 @@ cryptographic operations to the NITROX V security processo= r. Detailed information about the NITROX V security processor can be obtained here: =20 * https://www.marvell.com/security-solutions/nitrox-security-processors/ni= trox-v/ + +Features +-------- + +Nitrox crypto PMD has support for: + +Cipher algorithms: + +* ``RTE_CRYPTO_CIPHER_AES_CBC`` + +Hash algorithms: + +* ``RTE_CRYPTO_AUTH_SHA1_HMAC`` + +Limitations +----------- + +* AES_CBC Cipher Only combination is not supported. + +Installation +------------ + +For compiling the Nitrox crypto PMD, please check if the +CONFIG_RTE_LIBRTE_PMD_NITROX setting is set to `y` in config/common_base f= ile. + +* ``CONFIG_RTE_LIBRTE_PMD_NITROX=3Dy`` + +Initialization +-------------- + +Nitrox crypto PMD depend on Nitrox kernel PF driver being installed on the +platform. Nitrox PF driver is required to create VF devices which will +be used by the PMD. Each VF device can enable one cryptodev PMD. + +Nitrox kernel PF driver is available as part of CNN55XX-Driver SDK. The SD= K +and it's installation instructions can be obtained from: +`Marvell Technical Documentation Portal `_. diff --git a/drivers/crypto/nitrox/Makefile b/drivers/crypto/nitrox/Makefil= e index 06c96ccd7..dedb74a34 100644 --- a/drivers/crypto/nitrox/Makefile +++ b/drivers/crypto/nitrox/Makefile @@ -27,5 +27,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_NITROX) +=3D nitrox_device.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_NITROX) +=3D nitrox_hal.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_NITROX) +=3D nitrox_logs.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_NITROX) +=3D nitrox_sym.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_NITROX) +=3D nitrox_sym_capabilities.c =20 include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/crypto/nitrox/meson.build b/drivers/crypto/nitrox/meso= n.build index 1277cf58e..7c565c5a4 100644 --- a/drivers/crypto/nitrox/meson.build +++ b/drivers/crypto/nitrox/meson.build @@ -13,4 +13,5 @@ sources =3D files( 'nitrox_hal.c', 'nitrox_logs.c', 'nitrox_sym.c', + 'nitrox_sym_capabilities.c', ) diff --git a/drivers/crypto/nitrox/nitrox_sym.c b/drivers/crypto/nitrox/nit= rox_sym.c index c72016dd0..c05042e54 100644 --- a/drivers/crypto/nitrox/nitrox_sym.c +++ b/drivers/crypto/nitrox/nitrox_sym.c @@ -9,6 +9,7 @@ =20 #include "nitrox_sym.h" #include "nitrox_device.h" +#include "nitrox_sym_capabilities.h" #include "nitrox_logs.h" =20 #define CRYPTODEV_NAME_NITROX_PMD crypto_nitrox @@ -25,6 +26,84 @@ static const struct rte_driver nitrox_rte_sym_drv =3D { .alias =3D nitrox_sym_drv_name }; =20 +static int nitrox_sym_dev_qp_release(struct rte_cryptodev *cdev, + uint16_t qp_id); + +static int +nitrox_sym_dev_config(__rte_unused struct rte_cryptodev *cdev, + __rte_unused struct rte_cryptodev_config *config) +{ + return 0; +} + +static int +nitrox_sym_dev_start(__rte_unused struct rte_cryptodev *cdev) +{ + return 0; +} + +static void +nitrox_sym_dev_stop(__rte_unused struct rte_cryptodev *cdev) +{ +} + +static int +nitrox_sym_dev_close(struct rte_cryptodev *cdev) +{ + int i, ret; + + for (i =3D 0; i < cdev->data->nb_queue_pairs; i++) { + ret =3D nitrox_sym_dev_qp_release(cdev, i); + if (ret) + return ret; + } + + return 0; +} + +static void +nitrox_sym_dev_info_get(struct rte_cryptodev *cdev, + struct rte_cryptodev_info *info) +{ + struct nitrox_sym_device *sym_dev =3D cdev->data->dev_private; + struct nitrox_device *ndev =3D sym_dev->ndev; + + if (!info) + return; + + info->max_nb_queue_pairs =3D ndev->nr_queues; + info->feature_flags =3D cdev->feature_flags; + info->capabilities =3D nitrox_get_sym_capabilities(); + info->driver_id =3D nitrox_sym_drv_id; + info->sym.max_nb_sessions =3D 0; +} + +static int +nitrox_sym_dev_qp_release(struct rte_cryptodev *cdev, uint16_t qp_id) +{ + RTE_SET_USED(cdev); + RTE_SET_USED(qp_id); + return 0; +} + +static struct rte_cryptodev_ops nitrox_cryptodev_ops =3D { + .dev_configure =3D nitrox_sym_dev_config, + .dev_start =3D nitrox_sym_dev_start, + .dev_stop =3D nitrox_sym_dev_stop, + .dev_close =3D nitrox_sym_dev_close, + .dev_infos_get =3D nitrox_sym_dev_info_get, + + .stats_get =3D NULL, + .stats_reset =3D NULL, + + .queue_pair_setup =3D NULL, + .queue_pair_release =3D NULL, + + .sym_session_get_size =3D NULL, + .sym_session_configure =3D NULL, + .sym_session_clear =3D NULL +}; + int nitrox_sym_pmd_create(struct nitrox_device *ndev) { @@ -50,7 +129,7 @@ nitrox_sym_pmd_create(struct nitrox_device *ndev) =20 ndev->rte_sym_dev.name =3D cdev->data->name; cdev->driver_id =3D nitrox_sym_drv_id; - cdev->dev_ops =3D NULL; + cdev->dev_ops =3D &nitrox_cryptodev_ops; cdev->enqueue_burst =3D NULL; cdev->dequeue_burst =3D NULL; cdev->feature_flags =3D RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | diff --git a/drivers/crypto/nitrox/nitrox_sym_capabilities.c b/drivers/cryp= to/nitrox/nitrox_sym_capabilities.c new file mode 100644 index 000000000..aa1ff2638 --- /dev/null +++ b/drivers/crypto/nitrox/nitrox_sym_capabilities.c @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2019 Marvell International Ltd. + */ + +#include "nitrox_sym_capabilities.h" + +static const struct rte_cryptodev_capabilities nitrox_capabilities[] =3D { + { /* 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 } + }, } + }, } + }, + { /* 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 + } + }, } + }, } + }, + + RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() +}; + +const struct rte_cryptodev_capabilities * +nitrox_get_sym_capabilities(void) +{ + return nitrox_capabilities; +} diff --git a/drivers/crypto/nitrox/nitrox_sym_capabilities.h b/drivers/cryp= to/nitrox/nitrox_sym_capabilities.h new file mode 100644 index 000000000..cb2d97572 --- /dev/null +++ b/drivers/crypto/nitrox/nitrox_sym_capabilities.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2019 Marvell International Ltd. + */ + +#ifndef _NITROX_SYM_CAPABILITIES_H_ +#define _NITROX_SYM_CAPABILITIES_H_ + +#include + +const struct rte_cryptodev_capabilities *nitrox_get_sym_capabilities(void)= ; + +#endif /* _NITROX_SYM_CAPABILITIES_H_ */ --=20 2.13.6