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 737A2A2EFC for ; Fri, 20 Sep 2019 11:45:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 260981F38C; Fri, 20 Sep 2019 11:45:00 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50060.outbound.protection.outlook.com [40.107.5.60]) by dpdk.org (Postfix) with ESMTP id 8B6A11F376 for ; Fri, 20 Sep 2019 11:44:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZepVHylZjLUV0cNOEEziQ9ywLhwPz2jUSrju4VkS5AXW1FQeJVrdd19IU8bJjJqfT+/9yQd8Ir2qYiA6R2w/Fe3UPGYm8p2EMETS58uuY23rpNgNIwZZsDZpdSbOhlh76KnM0S6OijTG0iO09al+p+7r9peWLn+pFCSffMZqeQL8cIJn6EEeqbiTR9DcpN4LiIB/TJxqWhhMIy6cvVgCh7LjA0WTIFY0BFLUikGeTKyWS4fBvkBSzlsb+kc91aJOPJcKRvQaW04UeBmegU9KZPicr0WipItoFkoUWMtkikC4mUX10C47B6MNT0hUNdcuGBPfOSWjw1fKVQ9RuFJiFw== 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=ktMwz1vwSlpAmfsHwfrS9n3T29WqN25KI/bNV9+aydQ=; b=YRrzUVjhyns8Wp/7v9jUwcLEgSoOufSCuODA6y24qwSotkUeDnKt9GWs5oHthY6ERFhEKZv0LxbOkMumh8Q4/JiV3e51f0Yh+D4CDMtUDIZopgsW6SR3C+TOo9In0PNxwu2FmpLMQvLyoN9ptEB6Y4fvNY8zDA0kq0ugZbpKb8AWCQkTPg6muWIp+MTGKlrXAZeOQVadab8Aqd5u7hfZgPpkqNXtQdgLmG0Tldv1q1I+72wncISz/W/aPA1mMbJoV1vImf7GLMtnhShhQkvGmg53j9hs68DBlNwAXi3CYN510BuKGzOQHyIWmDSIVP57MdgBIRQWY8iDRJTFQp5ROg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ktMwz1vwSlpAmfsHwfrS9n3T29WqN25KI/bNV9+aydQ=; b=B4rf5y+x9e53nE6U5YA5/CcphVxH72cZupOtC/ybUqF+rrGgVbR+vx7HBqsFXFpcfa0zcbkqylUP4PfIrYxCRUkEFWkWVadqI6GkD0VZ/afP/limyqXAG0G8QPoUC0t0/enzAOG1+rJGAoN5XsdFZEOWKajhvrhZcQ5uZ4oFj5E= Received: from VE1PR04MB6639.eurprd04.prod.outlook.com (10.255.118.11) by VE1PR04MB6542.eurprd04.prod.outlook.com (20.179.234.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.20; Fri, 20 Sep 2019 09:44:57 +0000 Received: from VE1PR04MB6639.eurprd04.prod.outlook.com ([fe80::c045:5df2:ba1f:c3ee]) by VE1PR04MB6639.eurprd04.prod.outlook.com ([fe80::c045:5df2:ba1f:c3ee%5]) with mapi id 15.20.2284.023; Fri, 20 Sep 2019 09:44:57 +0000 From: Akhil Goyal To: Nagadheeraj Rottela , "pablo.de.lara.guarch@intel.com" , "mattias.ronnblom@ericsson.com" CC: "dev@dpdk.org" , Srikanth Jampala Thread-Topic: [PATCH v4 04/11] crypto/nitrox: add basic symmetric cryptodev operations Thread-Index: AQHVXAy+A+vIiew3hEyDJMMfIbA4Aac0dEdA Date: Fri, 20 Sep 2019 09:44:57 +0000 Message-ID: References: <4b0fc70c-768a-a474-ace4-b69513412cae@ericsson.com> <20190826124836.21187-1-rnagadheeraj@marvell.com> <20190826124836.21187-5-rnagadheeraj@marvell.com> In-Reply-To: <20190826124836.21187-5-rnagadheeraj@marvell.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; x-originating-ip: [92.120.1.65] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: caa8f940-1ee0-4d77-c012-08d73daf32b1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600167)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:VE1PR04MB6542; x-ms-traffictypediagnostic: VE1PR04MB6542: x-ms-exchange-purlcount: 2 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0166B75B74 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(346002)(376002)(39860400002)(136003)(396003)(189003)(199004)(66066001)(8936002)(81166006)(110136005)(8676002)(54906003)(81156014)(74316002)(316002)(66446008)(64756008)(66556008)(66476007)(305945005)(2501003)(76116006)(66946007)(7736002)(9686003)(6306002)(55016002)(4326008)(6246003)(86362001)(2201001)(6436002)(229853002)(25786009)(966005)(14454004)(71200400001)(2906002)(478600001)(71190400001)(6116002)(3846002)(33656002)(256004)(14444005)(76176011)(486006)(52536014)(6506007)(5660300002)(26005)(99286004)(7696005)(44832011)(11346002)(186003)(446003)(476003)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6542; H:VE1PR04MB6639.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 2b5Xb2khUCKJDWIGAScxUajOruWnD5DYzgtIClprCd+aXN2clfNf+9adm9J/NxMzsCo3EbnZx1sE6R/8riOTuincqlOZEhaFOa4v3JDwabuh6Bb8mtDeABzzCghevMIDCUSS/v4R838hXPz+kq/AOWD14aF6F4iI7asC8uM9llm+TpO+wUFYqUmLIFpEsyzex22gntxKmpTNwE1LqSBU8EfHa7PlgC8v/YL4HRUCdNfk7Au2DzIqAM0A17XWqUr6/e7FMUiPUog6MDlTUNrKH2Fej6w8qedMr/+gLzQPWZKr2J2R9CE/n7o77sIk6Wv9oSRPA9UAGUpjBTtPihZDI1u+/ITm9gB9XoqUyE91aoQFN/4+Pe1/ub2ZEAqYx0+naICWxhX3gE3FA4cubHdBbcby9lI6uUFpxhuIbZIbimo= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: caa8f940-1ee0-4d77-c012-08d73daf32b1 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Sep 2019 09:44:57.3576 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GoBoWTy60YC3poGprFmIDj3Iupxz4tO1WuKQ0sAX9FsVoqrYMwinS/nCiOK/8/0wY2D8hECoz9D54bprvLUXig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6542 Subject: Re: [dpdk-dev] [PATCH v4 04/11] 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" Hi Nagadheeraj, > Add the following cryptodev operations, > - dev_configure > - dev_start > - dev_stop > - dev_close > - dev_infos_get >=20 > 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 >=20 > diff --git a/doc/guides/cryptodevs/features/nitrox.ini > b/doc/guides/cryptodevs/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 I cannot see any of these features getting supporting in any of the patches= before 4/11. You should add documentation update where the feature is supported. > + > +; > +; 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/nit= rox.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 > processor. Detailed > information about the NITROX V security processor can be obtained here: >=20 > * > https://www.marvell.com/security-solutions/nitrox-security-processors/nit= rox-v/=20 > + I believe you should add documentation in some later patch for features in = each of the patch Which add a certain feature. Generic documentation should be part of your first patch where you introduc= ed the driver. > +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 file. > + > +* ``CONFIG_RTE_LIBRTE_PMD_NITROX=3Dy`` > + > +Initialization > +-------------- > + > +Nitrox crypto PMD depend on Nitrox kernel PF driver being installed on t= he > +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 = SDK > +and it's installation instructions can be obtained from: > +`Marvell Technical Documentation Portal > < https://support.cavium.com/websilo/portal>`_. > diff --git a/drivers/crypto/nitrox/Makefile b/drivers/crypto/nitrox/Makef= ile > 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 Capabilities should be added in the patch where they are supported. > include $(RTE_SDK)/mk/rte.lib.mk > diff --git a/drivers/crypto/nitrox/meson.build > b/drivers/crypto/nitrox/meson.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/nitrox_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) > +{ > +} Why are these functions empty? Atleast a comment can be added here. I see that you have used __rte_unused, you can also use RTE_SET_USED. > + > +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, I see that in this patch, none of the ops are really implemented except the= dev_infos_get. This patch may be squashed in your previous patch after removing the capabi= lities and documentation Which again need to be squashed in some other patch. > + > + .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/crypto/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= { Should not be part of this patch. > + { /* 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/crypto/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(voi= d); > + > +#endif /* _NITROX_SYM_CAPABILITIES_H_ */ > -- > 2.13.6