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 6948FA04C0; Mon, 28 Sep 2020 21:46:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BC6E91D164; Mon, 28 Sep 2020 21:46:39 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2043.outbound.protection.outlook.com [40.107.20.43]) by dpdk.org (Postfix) with ESMTP id 2795F1D164 for ; Mon, 28 Sep 2020 21:46:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OrqI20NJO1qOYlGRMAF559lWovgKgZ6h5L7nb+juDz/8EziOIqaMdGFyqipuOfeUNv1Kne23Xrre6oMSGsGHl8BRbevxxqYIc5R9ZvLGRPoNrnr5ter3+POcigPhOET8/750Qo3z8CRT9cY0chLFOxNuYFVLx5m/YHxf6SBBkZNTQTGLhfN0rPItXNz2xDYWKesXWgmDpwuWDNff/QP7z0kxXRUVcAHfM8z0jRVGE0DoW/qH2sXxzHfYQP9qBcCY7vZ8XxoxTXE5j1jhY3Pm7dXh5mTZYoPi2vzuyuUGkPo6qHq2YHRObd4DaSfzjQ2OvbqW1HDzNLnOfJMYEhfe1Q== 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=BcWJSxELb3ffy+QBNF0Yi0OB52ej5U/CfjJXEms0+Bw=; b=Ct2Su6Zk4D7c8MrQYJ7bxqlV25wdI3ZVy8aAiecka6byEsFaEyRQHO03u2udz7BKaAaUx9U7EKWCJV2+SAtVzjXLBRaLdqS355JSYVg5hpoJTFIjruXUsNptsGpP7Lt7uk+q4KKOJsUUfr3OPNWs3+ODM3qhCAQ2bmzhKTHz2ddl6/9WHaPI2VksBs4BvkdcdtKY0siBtOIIcFuFxWxkw2T0lM83us0HABtT9PqROxhun+f0t+HXX1iqSFsheYO6tjT+AZdNAuSzCTYM964j1VTgdOiZEP1YfuB4+R9+CRUGgYCd+wPFka2A4YnLNEOqmvy+e7HasiBwFqFVhBFzrQ== 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=BcWJSxELb3ffy+QBNF0Yi0OB52ej5U/CfjJXEms0+Bw=; b=jiALBTNuUhzi39TvbwaoBQFpwU/dLGKUqotK1RJCdavrQcLBH4ieIAMNLQl97xYDpJoM5hur3GwhC+AK4cmMcqrdgGUl4rhbl1pHnuCW9JXv3YeyNxe+nk3SKu+Hh24e7k7mJJC8lH/gDSdD83WwatFHHVMBUhs/b1bH4Itm1/Y= Received: from VI1PR04MB3168.eurprd04.prod.outlook.com (2603:10a6:802:6::10) by VI1PR04MB6094.eurprd04.prod.outlook.com (2603:10a6:803:f4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.22; Mon, 28 Sep 2020 19:46:34 +0000 Received: from VI1PR04MB3168.eurprd04.prod.outlook.com ([fe80::9513:3b55:931f:216e]) by VI1PR04MB3168.eurprd04.prod.outlook.com ([fe80::9513:3b55:931f:216e%4]) with mapi id 15.20.3412.029; Mon, 28 Sep 2020 19:46:34 +0000 From: Akhil Goyal To: Vikas Gupta , "dev@dpdk.org" CC: "vikram.prakash@broadcom.com" , Raveendra Padasalagi Thread-Topic: [PATCH v2 6/8] crypto/bcmfs: add session handling and capabilities Thread-Index: AQHWcZaWF/k2PvdMP0OSD1SJp/b1bql+uCag Date: Mon, 28 Sep 2020 19:46:34 +0000 Message-ID: References: <20200812063127.8687-1-vikas.gupta@broadcom.com> <20200813172344.3228-1-vikas.gupta@broadcom.com> <20200813172344.3228-7-vikas.gupta@broadcom.com> In-Reply-To: <20200813172344.3228-7-vikas.gupta@broadcom.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: broadcom.com; dkim=none (message not signed) header.d=none;broadcom.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [122.162.67.38] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 41dc2d44-3431-43cb-7ddc-08d863e734e0 x-ms-traffictypediagnostic: VI1PR04MB6094: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AfaCySB3I8XozN75zYwoFPqpn38EmhGQjpnOsxzP8abQKy9GY6ul9zTmGhD7dh2V6PMbUktqTaFLHX2MPMr95jNpyjlY+tlQuaclrfAjNa1crK+zLvKkmshr7AcuOSfYdbq0sdUnSDjObEffJrg0kGXrjiPA+6u2R3X6JeUuX2M4dBzQXeRXwCviWgMxQEQ/neLwRmhFe9Y6scANCylr9Dhv8rujkefwUU6GLjP7QXAifhF7FTTdGygBkCAA2h+9/JydUgS40vZ8iv3ogDOOgUfxphpyD6n3HVPDvCtdiqD2SeQZf/BEk/soPh8pCD+V6jNrcZZiBTvdEyqCGpVIoOn99A7aDm0SzaKVtVu01Q5ha+4cPz9iq7Nwwo5Rftxk x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB3168.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39860400002)(136003)(376002)(366004)(346002)(186003)(6506007)(2906002)(7696005)(26005)(76116006)(52536014)(66946007)(33656002)(8676002)(71200400001)(8936002)(83380400001)(478600001)(64756008)(66476007)(4326008)(316002)(86362001)(66556008)(110136005)(66446008)(5660300002)(44832011)(54906003)(55016002)(9686003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: BwkZCYEnO2Z7CqMyBKsQ6exQncEb+BVSxXoTa/VzEqfEQudmJUMlRV/7pryzsv+utHL2KgY9EdkjeO4HprCvYjFZAeIbCO22JJtt7GCpBavuXR++IAY+FA7XGrAIGRh7yPq1wsE9+9axCmQKnr0o1V0RwOJsycqjbKBZf5zFS+gHGCS5Vm6RWHCKDI9HGcyD0vLG+lijdL4Bh1DbyFaDDHmIdUfFLq9e+BuTAB0AbnHdZ3LGH93tVFWz+e0fl+Hcz+HCCczEneHMXkmRo5kGtVt4IE6Pbzxom1hlLwRabw9/qVgA77Fn6GEiY6Ck64gjq2O/aMnAfaNpPP5DysRSbXZrF/tFbIAsohkTiIhz7IJD/ja5ULZR0ex9dY3qh/PPmA/vDNhacwRyWhJVEIzEtEEQkDeyrd8Ddz+3Rl4nCCAqovuixNwn//XnqW81rSr8R91tZd4IwX/e+khX9TwLpoHhxNdlrj6Gl1kbELRNi9iEgz2T5ARCMNcDFJ67uLQRZLv+TULlHCurE4gUP8t4mXSM6MDJSopbi+UdNhk9eKpqp0e9XKf4mdWSQBlsS4MipoxUF7CoEyzKxXDMpDi4znl+bcK/C8JZsg2bGuaKUgXZCdjygeAs2UhbpK7ydoM9bqMrXnZgymBBRImvb/4AWw== 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-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3168.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 41dc2d44-3431-43cb-7ddc-08d863e734e0 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Sep 2020 19:46:34.7678 (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: olzt5YF56b7pdHRvO4hQFesKMNRs7bJEA09vA/D9coNOl4Lz1FK+uI9Tme7dln0K54h5ikvcxzFe9IoFilYNJg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6094 Subject: Re: [dpdk-dev] [PATCH v2 6/8] crypto/bcmfs: add session handling and capabilities 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 Vikas, > diff --git a/doc/guides/cryptodevs/features/bcmfs.ini > b/doc/guides/cryptodevs/features/bcmfs.ini > new file mode 100644 > index 000000000..82d2c639d > --- /dev/null > +++ b/doc/guides/cryptodevs/features/bcmfs.ini > @@ -0,0 +1,56 @@ > +; > +; Supported features of the 'bcmfs' 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 > +Protocol offload =3D Y > +In Place SGL =3D Y > + > +; > +; Supported crypto algorithms of the 'bcmfs' crypto driver. > +; > +[Cipher] > +AES CBC (128) =3D Y > +AES CBC (192) =3D Y > +AES CBC (256) =3D Y > +AES CTR (128) =3D Y > +AES CTR (192) =3D Y > +AES CTR (256) =3D Y > +AES XTS (128) =3D Y > +AES XTS (256) =3D Y > +3DES CBC =3D Y > +DES CBC =3D Y > +; > +; Supported authentication algorithms of the 'bcmfs' crypto driver. > +; > +[Auth] > +MD5 HMAC =3D Y > +SHA1 =3D Y > +SHA1 HMAC =3D Y > +SHA224 =3D Y > +SHA224 HMAC =3D Y > +SHA256 =3D Y > +SHA256 HMAC =3D Y > +SHA384 =3D Y > +SHA384 HMAC =3D Y > +SHA512 =3D Y > +SHA512 HMAC =3D Y > +AES GMAC =3D Y > +AES CMAC (128) =3D Y > +AES CBC =3D Y AES CBC is not an auth algo You should use AES CBC MAC Please use the same notation as there in default.ini Check for all the names. > +AES XCBC =3D Y > + > +; > +; Supported AEAD algorithms of the 'bcmfs' crypto driver. > +; > +[AEAD] > +AES GCM (128) =3D Y > +AES GCM (192) =3D Y > +AES GCM (256) =3D Y > +AES CCM (128) =3D Y > +AES CCM (192) =3D Y > +AES CCM (256) =3D Y // snip// > + { > + /* 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 0 Increment should be 1 for all HMAC cases. > + }, > + .digest_size =3D { > + .min =3D 20, > + .max =3D 20, > + .increment =3D 0 > + }, > + .aad_size =3D { 0 } > + }, } > + }, } > + }, //snipp// > + { > + /* AES CMAC */ > + .op =3D RTE_CRYPTO_OP_TYPE_SYMMETRIC, > + {.sym =3D { > + .xform_type =3D RTE_CRYPTO_SYM_XFORM_AUTH, > + {.auth =3D { > + .algo =3D RTE_CRYPTO_AUTH_AES_CMAC, > + .block_size =3D 16, > + .key_size =3D { > + .min =3D 1, > + .max =3D 16, > + .increment =3D 0 Do you only support key sizes of 1 and 16? I see increment =3D0 in many cas= es. > + }, > + .digest_size =3D { > + .min =3D 16, > + .max =3D 16, > + .increment =3D 0 > + }, > + .aad_size =3D { 0 } > + }, } > + }, } > + }, > + { //snip// > + > +const struct rte_cryptodev_capabilities * > +bcmfs_sym_get_capabilities(void) > +{ > + return bcmfs_sym_capabilities; > +} > diff --git a/drivers/crypto/bcmfs/bcmfs_sym_capabilities.h > b/drivers/crypto/bcmfs/bcmfs_sym_capabilities.h > new file mode 100644 > index 000000000..3ff61b7d2 > --- /dev/null > +++ b/drivers/crypto/bcmfs/bcmfs_sym_capabilities.h > @@ -0,0 +1,16 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2020 Broadcom > + * All rights reserved. > + */ > + > +#ifndef _BCMFS_SYM_CAPABILITIES_H_ > +#define _BCMFS_SYM_CAPABILITIES_H_ > + > +/* > + * Get capabilities list for the device > + * > + */ > +const struct rte_cryptodev_capabilities *bcmfs_sym_get_capabilities(void= ); > + > +#endif /* _BCMFS_SYM_CAPABILITIES_H__ */ > + > diff --git a/drivers/crypto/bcmfs/bcmfs_sym_defs.h > b/drivers/crypto/bcmfs/bcmfs_sym_defs.h > new file mode 100644 > index 000000000..d94446d35 > --- /dev/null > +++ b/drivers/crypto/bcmfs/bcmfs_sym_defs.h > @@ -0,0 +1,170 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2020 Broadcom > + * All rights reserved. > + */ > + > +#ifndef _BCMFS_SYM_DEFS_H_ > +#define _BCMFS_SYM_DEFS_H_ > + > +/* > + * Max block size of hash algorithm > + * currently SHA3 supports max block size > + * of 144 bytes > + */ > +#define BCMFS_MAX_KEY_SIZE 144 > +#define BCMFS_MAX_IV_SIZE 16 > +#define BCMFS_MAX_DIGEST_SIZE 64 > + > +/** Symmetric Cipher Direction */ > +enum bcmfs_crypto_cipher_op { > + /** Encrypt cipher operation */ > + BCMFS_CRYPTO_CIPHER_OP_ENCRYPT, > + > + /** Decrypt cipher operation */ > + BCMFS_CRYPTO_CIPHER_OP_DECRYPT, > +}; > + Why are these enums needed, Aren't these replica of rte_sym_crypto.h Are these enum values getting filled in some HW desc/registers. If so, then Probably move it to the hw folder. > +/** Symmetric Cipher Algorithms */ > +enum bcmfs_crypto_cipher_algorithm { > + /** NULL cipher algorithm. No mode applies to the NULL algorithm. */ > + BCMFS_CRYPTO_CIPHER_NONE =3D 0, > + > + /** Triple DES algorithm in CBC mode */ > + BCMFS_CRYPTO_CIPHER_DES_CBC, > + > + /** Triple DES algorithm in ECB mode */ > + BCMFS_CRYPTO_CIPHER_DES_ECB, > + > + /** Triple DES algorithm in CBC mode */ > + BCMFS_CRYPTO_CIPHER_3DES_CBC, > + > + /** Triple DES algorithm in ECB mode */ > + BCMFS_CRYPTO_CIPHER_3DES_ECB, > + > + /** AES algorithm in CBC mode */ > + BCMFS_CRYPTO_CIPHER_AES_CBC, > + > + /** AES algorithm in CCM mode. */ > + BCMFS_CRYPTO_CIPHER_AES_CCM, > + > + /** AES algorithm in Counter mode */ > + BCMFS_CRYPTO_CIPHER_AES_CTR, > + > + /** AES algorithm in ECB mode */ > + BCMFS_CRYPTO_CIPHER_AES_ECB, > + > + /** AES algorithm in GCM mode. */ > + BCMFS_CRYPTO_CIPHER_AES_GCM, > + > + /** AES algorithm in XTS mode */ > + BCMFS_CRYPTO_CIPHER_AES_XTS, > + > + /** AES algorithm in OFB mode */ > + BCMFS_CRYPTO_CIPHER_AES_OFB, > +}; > +