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 AAF83A0C42; Sat, 8 May 2021 14:27:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3AAD040140; Sat, 8 May 2021 14:27:44 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id ECAD04013F for ; Sat, 8 May 2021 14:27:42 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 148CGIN1019112; Sat, 8 May 2021 05:27:42 -0700 Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2171.outbound.protection.outlook.com [104.47.57.171]) by mx0b-0016f401.pphosted.com with ESMTP id 38dt5rg1ps-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 08 May 2021 05:27:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bByxEYreXWXEwMhSE6X+RH0cFj/qMXLtvqlAoDFRfd0UcH2dWqYsbMM7LbNCKR/YvjKCkajCZR5B29Gmp9MwwzpuK6fCdOtSFe5a3Jaw5iWBuzXoTKGa6nKVnL4UZ/qYcmrvFR/IEwChxCYx7EzkEdjtYS82Y19ZSzbA9+AKUZ4rF8L3vEGm4XXs0AkC+t3/zX0ZaoYLFHET21QIaDAIxNg2joMzl4Q/3jEMcVN4TBQq97kweqajXJvVPghvG4HoXmpzCaKgYad8oKdOL4hoJx1DTT4ntYzMGz6UDB4pzQZjytSF/N7UUuZGYbouZf2TTj1CSDxsjFeEzl+Q/uJ/mA== 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=YntF6608Ae/2VUGEvD/GB8LEd6zUUN3SnnsmscZh5i0=; b=SABqMj3C39rNO6spRmCi/sdxfdQcaOt5pBqHxm+3cL9WoMA0p8NJUdwzAOAqol0lnubnloxvQ0y3B+LhlXAvlx/l4Qch1u7hDR7PQQPkklFVMisJB6uuYsnA9fgUxP1qDBah01S6AaxaFZXlk777IupcbIgQdrmkZEXCtEXQn+Yts9A/nAmvdlZOhEJ/9fBDZssDncmddzaXUUix/qT2qpjbHsTnFfDABBbee6QAA0ImcKAYD5KS4l16KNPKrztwXhPcJlSKaOGtRImoE/XAotowEg1295dyRMq6CzJme6PpPR30/f6lWcdzwly5t7uAMIT0jDEHn82odDQ9pdqTmw== 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=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YntF6608Ae/2VUGEvD/GB8LEd6zUUN3SnnsmscZh5i0=; b=Sp1/WzePDQzm/wEKCVN8fPR3PToIZGM7hs8ueSxdmLMNva67YCSgr2f6OT+6gC7IjTqu2+dJuGucstcOBaejvEcJfNMHcdVz6/XCYlqxVUC7iK4afRUwU0tcS+pekc3BiexEyOheW+YP9IfKZ33nhMeBqavHZfBIoI4raAJ3ruA= Received: from MW2PR18MB2284.namprd18.prod.outlook.com (2603:10b6:907:10::16) by MWHPR18MB0976.namprd18.prod.outlook.com (2603:10b6:300:9a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25; Sat, 8 May 2021 12:27:39 +0000 Received: from MW2PR18MB2284.namprd18.prod.outlook.com ([fe80::3168:cb00:6607:743f]) by MW2PR18MB2284.namprd18.prod.outlook.com ([fe80::3168:cb00:6607:743f%7]) with mapi id 15.20.4108.030; Sat, 8 May 2021 12:27:39 +0000 From: Akhil Goyal To: Matan Azrad , "dev@dpdk.org" CC: "suanmingm@nvidia.com" , Thomas Monjalon , Shiri Kuzin Thread-Topic: [EXT] [PATCH v3 09/15] crypto/mlx5: adjust to the multiple data unit API Thread-Index: AQHXQSnPWST5nsDOH0Wf5VoieFG/G6rZh6kw Date: Sat, 8 May 2021 12:27:38 +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: <20210504210857.3398397-10-matan@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=marvell.com; x-originating-ip: [171.48.51.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0aba0dae-062c-4188-4451-08d9121cab35 x-ms-traffictypediagnostic: MWHPR18MB0976: 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: P2/zh2bcgF2Jnf9O1yxydQ+PHhvVP2UZQQUf5WYxOqpMe1shnn+Uci9ulXtZWTA36Des4wokzQnBNJpRAzHfl6eURM3tDjRoivwP6CSkjo8VJU2K83EbAfFwg1U8KyM0y095iLt1SuzQxuCaGehSF09xIEXdhewyK5J6e6FSmnbXTmPR2aQ9ekwMTmJtrKkLH2fkh1l0K3vydiR5uA6pJauBb0tOyofwywoWuNNGahBLL9rE2VeX73jYfDbjC34yLQdcGeSxhiYKr0yrOGeBUVxrn3i/spiSJ8b95vkWRrAykKjcfWVWIi2j6QuGmPut/n0Fr5oxNbqIT2jQaPqgf+RLLM/EZIky9+DB9GiZimO0DrKOY0PYTCR0/y9670NjSJg6jtZrL3ATWcd8gFoJxAy95lbLT9CibXe8g+slxUZQFSTvY4I0SU+SuQC9mLvQPoq79eQg4MwEx1VGvzTJv8QLfGGO1sq7KwMoOaoGHCG/6cyGbzDwzWeKHZb8VtwQB+3Nff0+0UUBodm0j+A0JJ+ZvaoGH5X0fc/zBzCVofpcjIkGIVET4WJ6v0tHXkinEFOm1ui9G5G84POAI1WB7innH6d3FbZnWEd48T6jfZj2kdYge0SJnm6I+y1YO3S8DMYMXNmzt1qaczbrF6PcAB+USOwCPLuu3aZ0ZN+Mv8niCHmDNyU9yWIA1/JWrB3Z x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR18MB2284.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(376002)(39860400002)(346002)(396003)(86362001)(76116006)(186003)(5660300002)(9686003)(33656002)(316002)(8936002)(122000001)(6506007)(52536014)(38100700002)(66476007)(66556008)(83380400001)(64756008)(7696005)(71200400001)(54906003)(110136005)(4326008)(966005)(26005)(2906002)(66946007)(478600001)(66446008)(55016002)(8676002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Vlx0acAOOfz9SBCW20Pg+05Y+YxP/eNBKuCR+LzWe8kQhnnUrLTKwCzBWGz6?= =?us-ascii?Q?yliCxpFmueCxIpD4qQgt4qsWGsdUttOSwktuajbTQRbgoUYhQDLF/fTkV/Ao?= =?us-ascii?Q?aYOFVZjtJTJ3R3zw2xhjdYXrLmHTDA3Ixeoapl3pAGAHsMpcmeXoXsO0cxRO?= =?us-ascii?Q?8C8dZ5iciWN3mxdq2gMYHa/jNOkbNMStb6Pik0tIAQ0XTBRdlV87AwQV7T5F?= =?us-ascii?Q?HUo/UjwXqDWGY3L6irPkEXZg9K29WVOVAq3XQO/uvTSe3VWgNzSAJVQBjLjG?= =?us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yQ+bcw7v+fSLpVB/a9mTUshZDSVALkBa?= =?us-ascii?Q?YIxo4e9fusHehG4b+nKSFuQkZFFlrCuYUAf05Sm99U4klLXz3QUIwPragbnw?= =?us-ascii?Q?16fZxvtr4g1PmFPLFtOYCF1jcLTyFWC1vaKcjBWBWzD+7d/9OYhx9p+tCnac?= =?us-ascii?Q?fXE=3D?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR18MB2284.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0aba0dae-062c-4188-4451-08d9121cab35 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2021 12:27:38.8336 (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: QLRe5eu66XJLVxMnF5OlC/FljtE+fRjD/DDIamEfbsSyufbs/jHjVoZ3rKpw3nhJoxfmoY+/GNrKp3qAUMlvmA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR18MB0976 X-Proofpoint-ORIG-GUID: T-8vrQ2FE3JDVqDO14O8Zdf9cU6-stON X-Proofpoint-GUID: T-8vrQ2FE3JDVqDO14O8Zdf9cU6-stON X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-05-08_06:2021-05-06, 2021-05-08 signatures=0 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: Shiri Kuzin >=20 > 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. >=20 > 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. >=20 > 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. >=20 > [1] https://www.mail-archive.com/dev@dpdk.org/msg205337.html=20 >=20 Since [1] patch is already merged, no need to refer it in the patch descrip= tion. Title can be rephrased as Crypto/mlx5: support multiple data units 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. > Signed-off-by: Shiri Kuzin > --- > drivers/crypto/mlx5/mlx5_crypto.c | 23 +++++++++++++++++++++++ > 1 file changed, 23 insertions(+) >=20 > 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 endian > + * 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