From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 89E49A0548; Sun, 9 May 2021 10:05:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 644F8406FF; Sun, 9 May 2021 10:05:58 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2087.outbound.protection.outlook.com [40.107.102.87]) by mails.dpdk.org (Postfix) with ESMTP id 7A18B40140 for ; Sun, 9 May 2021 10:05:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PD5wASoMRd9PSUzCF5gifoVFYIQpWawTBd+LqktNrg+6/jaARWBwvqLLbnOJFLnocgbm8uWN8zQN84TaWtnfY5mCSbfPz5nRBb12KGdWRDWY5WLm5P+/m9sTm9afUH8fwrDshL+hvA6MzIK5U9TulTPBjJJr/sYICf48dKPTOyYPCGi0qIExhWXqH+0bpTh5fxY4WwrcljOzDinKVHXYQK+Rz9Zl6o4wYkEyd5Ik29Ns29E78I2cwGQXO7UxkDCtUWxNXEyhswNEKGpR0AdIcz2fQdi3PGv8ddmta9UEEDnWNdfOR/4Rli6UbtOeAUtA/9NOnpy4je12J+dASND0zQ== 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=decux8zw0t1psYG7Zy/H/PVRg+EdJxDOU83NwFbALwk=; b=E3MuzSZewn8uFkLKUOmwIpop445O8vkTmoEADO9Y1TY4rN3IFirjVxd4nUfMRSNyjZwj2V0Mtbx+Nk73MBzqrvHxEMKRozTx6Fj0XIXlfpNBuNtdwioh67/wFBo+Nl5BIa48WhBHnHS+ELGO24aqAFaNfPpMZvPaM60ghDbq9kjsTPz34T1zFbV1OKw14VOafg5SL7RSSGwQvXV70H7lCRGWRxgdBTkg+IB+uPkluU+kvsP4Cag9v7Q+VEk8IxFt3rRq1Jsb6dgtj4qkH3QD021tXQmUihiViBUlED/4JqGMCfnrh/JLU1pmMLf9sZpbuFrJYnEHbfpOWz5wOC1ihw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=decux8zw0t1psYG7Zy/H/PVRg+EdJxDOU83NwFbALwk=; b=J7y4TO+q+k/M9vKKsdyOUz9mgHZzbC0gEs3LexV2NtwTlkebgebtucr8d5NEmCeX+aB/ePmsA/giOetWuBVNlTvK9muy9AL70wYwX+0Usn6laKzOE45bFGbqfqYpC9HK56z7etseUFXAppmUMxWJ87iBhdvIvw8m4vI5Yr6rgX0Q9gcW/We49VW9S+GkQ77gsasU8scamzMK+xC14HF2MsahYSn2mj707JKC97kCxT1Ib4fdTb83ep4C0hbb3UF5ukkP5RbUrAIOsifhaDPZBSvJqlhqabLNTjvfLjGO/iGIKA/yXk+ap2zy7GDE3E0bHqNdDf69vsqz0RX4ELrt7g== Received: from DM4PR12MB5389.namprd12.prod.outlook.com (2603:10b6:5:39a::7) by DM4PR12MB5310.namprd12.prod.outlook.com (2603:10b6:5:39e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24; Sun, 9 May 2021 08:05:54 +0000 Received: from DM4PR12MB5389.namprd12.prod.outlook.com ([fe80::70df:ef1e:d98c:ce4]) by DM4PR12MB5389.namprd12.prod.outlook.com ([fe80::70df:ef1e:d98c:ce4%6]) with mapi id 15.20.4108.031; Sun, 9 May 2021 08:05:54 +0000 From: Matan Azrad To: Akhil Goyal , "dev@dpdk.org" CC: Suanming Mou , NBU-Contact-Thomas Monjalon , Shiri Kuzin Thread-Topic: [EXT] [PATCH v3 09/15] crypto/mlx5: adjust to the multiple data unit API Thread-Index: AQHXQSnP8YRys76jrE+A2XkRErsVIqrZiLwAgAFIw6A= Date: Sun, 9 May 2021 08:05:53 +0000 Message-ID: References: <20210429154712.2820159-1-matan@nvidia.com> <20210504210857.3398397-1-matan@nvidia.com> <20210504210857.3398397-10-matan@nvidia.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [79.179.26.253] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7e03b48e-e045-4aa7-4c2f-08d912c144ca x-ms-traffictypediagnostic: DM4PR12MB5310: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CbBSIfA4lWJy5kiNa5X3DnfubGUorUzIPE3awE+aszmzSmrpeQdlaR/abNqE787gkdSFgfCv+vkS7NyiML+IhpLm08DSripiKeKdPCbRBZitxiG4PJvctdgPXoNFmFpYCVRvCCqWTjn97HT1I0cioBUMTWUUsH8IIr0E82SnWFv2oAKpXFF5dfJmiTMBemRiPEfR6jFjYiTf4xQhyvyPsF6yA7HCycDhXfESqubwN9aHVTNNDizOY0U5+PqTs4SvLTIbPkdn3jR0NQroeHu3qb+fIAyU0ZNgi/8wUKIuspm9nAULS7iRqqF6iONyz94rGUjJyxYg3il+lSHbJL4NXdVXmEMDpMNP68JfyQ65oG5LUgfEzAvi0JDgcSsVnRES7a6GYyHYjZWRYNTwSxgr5cls5FUZCoSDLI7y9y07X0Kq7ECL6FHk57g2A5Bn5vgsgZrZsv6Ma7TTRAv3191FGHvPucSal9h3QUd5MeKCkzBNjm/0OsgoXcF6kQMa3ztkzMjXh5OqgX97vC2VsGs7OX1epVDJ0QXReduM8RoX8xt9+Upa91vquPr6aAsd25Ag7HuTQNt2m1+lrAJFiTtd2ZvfQFfO2AmPeIM1NqafwcLipd9J+5ciFV/P6z1RuYFsbsSRrosfyJOseu7V/e74lIluXRxQdCj74EPGQIqivLhE2NqTAtLME/dQdr7yW+Nc x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5389.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(39860400002)(346002)(366004)(396003)(136003)(8676002)(54906003)(2906002)(107886003)(38100700002)(52536014)(7696005)(71200400001)(316002)(110136005)(6506007)(186003)(478600001)(26005)(122000001)(66476007)(8936002)(83380400001)(9686003)(76116006)(86362001)(4326008)(55016002)(66446008)(966005)(64756008)(66556008)(66946007)(33656002)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?0atZ6cal66RTwEZE4hVS160nvwHJ9HGoHfhId/hwJ+Gzo1txKA2+gRyD9Q98?= =?us-ascii?Q?juUixMjur2a/RkCaURWScM9lQvwUbZ6vqiZzTTrvyOojIqK1P725EnXWrF/J?= =?us-ascii?Q?YNQ5PNkWUmdTrq/R6bcpAGodVLuscgU7SKcz8FqSI9+2ekFDsi/VW7a+Qk9W?= =?us-ascii?Q?PG6fp2PnymYS+dJys9BxmjjBlWGIIoNdZFZOQLT4njBgFmAXCKnRXWdsoQOu?= =?us-ascii?Q?n40+MbGzLarOmAtp4Lr7te97xkjGCOwA08YXTbfAB/6FxvmPY91tbCMcND1p?= =?us-ascii?Q?xuZ6OghJPfT9avp5E1gDV4WZPa697tD+SsB1lVKIiqdb8T6BnZugjbQXPFL2?= =?us-ascii?Q?qqCfyl4bsofX8uUHZ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ascii?Q?IxKnJ8qN5/jgn51VcGSyCaG1qVhg4pWhXbh1moUhPLVMX2FVd+mBe5M/tcQJ?= =?us-ascii?Q?tyvcleAeiNY4kI91UrMaw63v?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5389.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e03b48e-e045-4aa7-4c2f-08d912c144ca X-MS-Exchange-CrossTenant-originalarrivaltime: 09 May 2021 08:05:54.0039 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: v2cEJ8fBC8kEFwdUaqZ4ZnbP1B3JY4y+hJ1F4FT5bQX67seMyDzlPz7dP6+hw/0WSyBVJqA0/Rt+6o1CGpk+rg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5310 Subject: Re: [dpdk-dev] [EXT] [PATCH v3 09/15] crypto/mlx5: adjust to the multiple data unit API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Akhil Goyal > > From: Shiri Kuzin > > > > In AES-XTS the data to be encrypted\decrypted does not have to be in > > multiples of 16B size, the unit of data is called data-unit. > > > > As a result of patch [1] a new field is added to the cipher > > capability, called dataunit_set, where the devices can report the > > range of supported data-unit sizes. > > > > The new field enables saving the data-unit size in the session > > structure to the block size pointer variable in order to support > > several data-unit sizes. > > > > [1] https://www.mail-archive.com/dev@dpdk.org/msg205337.html > > > Since [1] patch is already merged, no need to refer it in the patch descr= iption. > Title can be rephrased as > Crypto/mlx5: support multiple data units Ok. =20 > Also set feature flag in the code and the documentation in this patch. > I see that you are setting all of them in a single patch in the end. > This is not correct. It should be added where the feature is supported. > Please fix this for all the feature flags. No, in this stage no feature is really supported, the actual time it will b= e supported is after the datapath patches and capabilities set. >=20 > > Signed-off-by: Shiri Kuzin > > --- > > drivers/crypto/mlx5/mlx5_crypto.c | 23 +++++++++++++++++++++++ > > 1 file changed, 23 insertions(+) > > > > diff --git a/drivers/crypto/mlx5/mlx5_crypto.c > > b/drivers/crypto/mlx5/mlx5_crypto.c > > index 18b1a6be88..8cc29ced21 100644 > > --- a/drivers/crypto/mlx5/mlx5_crypto.c > > +++ b/drivers/crypto/mlx5/mlx5_crypto.c > > @@ -48,6 +48,11 @@ struct mlx5_crypto_session { > > * bsf_size, bsf_p_type, encryption_order and encryption standard= , > > * saved in big endian format. > > */ > > + uint32_t bsp_res; > > + /* > > + * crypto_block_size_pointer and reserved 24 bits saved in big en= dian > > + * format. > > + */ > > uint32_t iv_offset:16; > > /* Starting point for Initialisation Vector. */ > > struct mlx5_crypto_dek *dek; /* Pointer to dek struct. */ @@ > > -171,6 +176,24 @@ mlx5_crypto_sym_session_configure(struct > > rte_cryptodev *dev, > > MLX5_BSF_P_TYPE_CRYPTO << > > MLX5_BSF_P_TYPE_OFFSET | > > encryption_order << > > MLX5_ENCRYPTION_ORDER_OFFSET | > > MLX5_ENCRYPTION_STANDARD_AES_XTS); > > + switch (xform->cipher.dataunit_len) { > > + case 0: > > + sess_private_data->bsp_res =3D 0; > > + break; > > + case 512: > > + sess_private_data->bsp_res =3D rte_cpu_to_be_32 > > + > > ((uint32_t)MLX5_BLOCK_SIZE_512B << > > + MLX5_BLOCK_SIZE_OFFSET); > > + break; > > + case 4096: > > + sess_private_data->bsp_res =3D rte_cpu_to_be_32 > > + > > ((uint32_t)MLX5_BLOCK_SIZE_4096B << > > + MLX5_BLOCK_SIZE_OFFSET); > > + break; > > + default: > > + DRV_LOG(ERR, "Cipher data unit length is not supported.")= ; > > + return -ENOTSUP; > > + } > > sess_private_data->iv_offset =3D cipher->iv.offset; > > sess_private_data->dek_id =3D > > rte_cpu_to_be_32(sess_private_data->dek->obj->id > > & > > -- > > 2.25.1