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 C2F34A0C49; Tue, 20 Jul 2021 10:55:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 480584068F; Tue, 20 Jul 2021 10:55:41 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 105364068B for ; Tue, 20 Jul 2021 10:55:38 +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 16K8o1aq014767; Tue, 20 Jul 2021 01:55:38 -0700 Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2100.outbound.protection.outlook.com [104.47.70.100]) by mx0b-0016f401.pphosted.com with ESMTP id 39vytqdhj7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Jul 2021 01:55:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EO4fysm/ZNYvIncPbMogXigY+WfSFq9jF5wn/6SgMlYartFvbf0iW3viI5qxxXGxT5dJC+N7L1QN/qvXXdybjJ/JPl+Ta7hN17BXeNqwUzw0HMhvqw21VXuA+m2Jytb40R3THsVbq4t4aBiCaWkZXvLb/DGqTSW+uBj/TRjSS86MyBrYJhY6HxB86T+AaDWIYn53YhudrrhrdbiFi9JudSBiWSLPZFYzt5i1SNp03xBMcSWhE+jwRoVGKtu7AUsnqdZ0gc2hv1C9+HkotyijhJmDcOuSrDZhBQh9NQgz9bfDj+2ypoIwj4p9yz3ZksBeJUQ+abVXpEYo/5T9Ui/uow== 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=tryxpN+Z/JEIzqxQtTBC/8detDbXz/A0PigcHda5IHQ=; b=AMNk372nDvlzGSnSBLbf00gWnvMPkIO3H7kWTaAvihPSt5hOyZSKr+FTKenj6ok09rN0zulfBDz1yOEO9yGeHrtaf8CeREamWdAwz31PykNBkWxpYY7zQNPFN5p7FMTP5CTsQUIOTWrrXdbvsvPLA6lJnDrlrEwF9okHtmzUo20VRvl60E8HBEMJe2FcLC4b5uhFZJk3i2kGxDMisdlJRy9+tH2nGXkoUB/X5Kr0maIB5a4w/vL/iU2XzD1rVGS3FnsVoJYaN93/EdQsGy4bBhwVbvZP1ZQDtOax4w4SmJgFgt/UwNLv0yvcD8x71192EiVeGgFIiHs/YvkurYQtqQ== 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=tryxpN+Z/JEIzqxQtTBC/8detDbXz/A0PigcHda5IHQ=; b=c87KFK7SR3NbW8oUv8ft4ZNIG7H6W3CE5WSOKxLaXXkkvtDS5WOV1iOXlBzzHg+kJ3uObo5iaLs0LLDxdlxbZP0TkjWMZj33k9BiNOOm8X8mts7QC85+l1dxO4gRnuGCCnVDWNypIpUYYRzq5v+EbWn6CyXSjJK8QRjA6fgjEZQ= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO1PR18MB4779.namprd18.prod.outlook.com (2603:10b6:303:ee::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21; Tue, 20 Jul 2021 08:55:35 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::1455:9a67:a6e7:e557]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::1455:9a67:a6e7:e557%6]) with mapi id 15.20.4331.034; Tue, 20 Jul 2021 08:55:35 +0000 From: Akhil Goyal To: Suanming Mou , Shiri Kuzin , "dev@dpdk.org" CC: Matan Azrad , "david.marchand@redhat.com" Thread-Topic: [EXT] [PATCH v8 02/16] crypto/mlx5: add DEK object management Thread-Index: AQHXeZhaMdCELImi8ki1pN4sYTFFgKtF/HPQgAWTlwCAAAEOoIAABA6AgAAAVRA= Date: Tue, 20 Jul 2021 08:55:34 +0000 Message-ID: References: <20210715150817.51485-1-shirik@nvidia.com> <20210715164126.54073-1-shirik@nvidia.com> <20210715164126.54073-3-shirik@nvidia.com> In-Reply-To: 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-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ed0a68cc-9f2d-47c6-c9d2-08d94b5c2343 x-ms-traffictypediagnostic: CO1PR18MB4779: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Srn9pLMVMz9i5RxTKl9DCa2l7GmIS7Ln2rOsc0O6rv+BpU2jOrxDkD4SDb4LDJzIlHBPUfh/urOy7d0fJTp9Ssx7Ky1eALP8Cq6gHwFqlc2MJ/+9vDMnSvIWh3/8a9367qrYMYXO6c+N2vKmOxxlZdiK0H5vWWZTXDGO6+cr47VPqZXrt/3+OOSJr+C6AatKiWUvPUUN3BOmj5aGUJuAH8GPIS++ZHMIc7IErmMghfF/T06BaLVYKnesmypxct1mshZ8QyQlctlhJe1BUco3adkqEWC1UQLrgcWZ5qcU0Suf1vmKjngFyddyVYC9wtVD/OvanBeJviq8DcU7jIHEx+nojuuzSuGryhx0Ffe0pJsMZMcbpyrhMHeQ+w6MqjWwfU/hYktjcveOn9/EdsBUGsropWcZJccHPePpL+J7dyyjuqKl7XOaxfUI/zEbQEyDHGWzswy3HCT5f+47U9Av/0AqEr93S3+9Jnn+w3XrOKCXbl7KsSB6k9KEdHhggcQrxACMFWwNvuWbZC2V3FFSZ0FZ0bxI90czCKA5apxnW9Fg7M9aBY7UtK59Y1kFgHipRxSCBWddE5K8iXe8a1enMMPvWeUAmjN45lBMu3qA0AqbN4G2T3eez1CLlm+ghfl7sEeRSBUhqOFrt0AzzdA42C6RA8FslKQ2bYcah6Wb5bEKPxHrQEl8pkKlfVK6Kkq0E53oz6G92j3vz4ou2gF40g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(376002)(366004)(136003)(39860400002)(5660300002)(26005)(316002)(66946007)(54906003)(478600001)(66476007)(8936002)(7696005)(55236004)(6506007)(86362001)(186003)(110136005)(66556008)(66446008)(64756008)(8676002)(38100700002)(52536014)(33656002)(4326008)(2906002)(71200400001)(55016002)(83380400001)(76116006)(9686003)(122000001)(38070700004); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?dAnmgtJwV1LVlc75gbZjQz8f6zMMes+/YIYgEjY6BeNkRX3nV/kxs36gqHIk?= =?us-ascii?Q?9qt2vtrRE6Tv/8VSv9lvk8EWVy5YVBNk3nSPmLfUYMpuIVAn691hb4BQW/g+?= =?us-ascii?Q?MGYt9WkhoikTvL6CB9SBYUpdKh0ZGqC52WsCoOATCAZHBVIfApnBGy2XzQaY?= =?us-ascii?Q?ZLJTwP/o6fQxbIcA5FAePSPYvgqZ1gUZeIt6KkY/5l5fw011j+LO1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ob77WlCJ/7WxT/MXRgLM1WVUBFAQgKQJkciCPsm?= =?us-ascii?Q?xpQtFWgswPz7fJVCNXqkJ68m2HD+uCqtjcajFoASRZbRL2Ii07S/nE/47XDa?= =?us-ascii?Q?f+B+rmJJ9fLmyqIL0ebufXZbgKtOmkY3y7LdOTtAe42b+tXDkqas/weB/PxY?= =?us-ascii?Q?9krnYJQuPHnjpMOgJeU6+GjhYHInm4v5sVpWz7ddTZ+v6tZ86ydgrKw8blkv?= =?us-ascii?Q?YQCSEfP5DERsZ80y+VoDPqTU?= 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: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed0a68cc-9f2d-47c6-c9d2-08d94b5c2343 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2021 08:55:34.9011 (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: vGwAdS1CRMxqZd9Ub0qGI3ir/Hv3tC8JMFWOomtSfC6YSOhSu0zeUdtYvhQLr3D8NOLiJ+hTPzxtkANdmi9IIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR18MB4779 X-Proofpoint-ORIG-GUID: p1Y_YSp0DcQ9I0HD9YvFX4ahUZsiDHH1 X-Proofpoint-GUID: p1Y_YSp0DcQ9I0HD9YvFX4ahUZsiDHH1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-20_04:2021-07-19, 2021-07-20 signatures=0 Subject: Re: [dpdk-dev] [EXT] [PATCH v8 02/16] crypto/mlx5: add DEK object management 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" > > > > > A DEK(Data encryption Key) is an mlx5 HW object which represents > > > > > the cipher algorithm key. > > > > > The DEKs are used during data encryption/decryption operations. > > > > > > > > > > In symmetric algorithms like AES-STS, we use the same DEK for bot= h > > > > > encryption and decryption. > > > > > > > > > > Use the mlx5 hash-list tool to manage the DEK objects in the PMD. > > > > > > > > > > Provide the compare, create and destroy functions to manage DEKs > > > > > in hash-list and introduce an internal API to setup and unset the > > > > > DEK management and to prepare and destroy specific DEK object. > > > > > > > > > > The DEK hash-list will be created in dev_configure routine and > > > > > destroyed in dev_close routine. > > > > > > > > > > Signed-off-by: Shiri Kuzin > > > > > Acked-by: Matan Azrad > > > > > --- > > > > > drivers/crypto/mlx5/meson.build | 1 + > > > > > drivers/crypto/mlx5/mlx5_crypto.c | 42 ++++--- > > > > > drivers/crypto/mlx5/mlx5_crypto.h | 51 ++++++++ > > > > > drivers/crypto/mlx5/mlx5_crypto_dek.c | 161 > > > > > ++++++++++++++++++++++++++ > > > > > 4 files changed, 239 insertions(+), 16 deletions(-) create mode > > > > > 100644 drivers/crypto/mlx5/mlx5_crypto.h create mode 100644 > > > > > drivers/crypto/mlx5/mlx5_crypto_dek.c > > > > > > > > > > diff --git a/drivers/crypto/mlx5/meson.build > > > > > b/drivers/crypto/mlx5/meson.build index 6fd70bc477..d55cdbfe6f > > > 100644 > > > > > --- a/drivers/crypto/mlx5/meson.build > > > > > +++ b/drivers/crypto/mlx5/meson.build > > > > > @@ -11,6 +11,7 @@ fmt_name =3D 'mlx5_crypto' > > > > > deps +=3D ['common_mlx5', 'eal', 'cryptodev'] sources =3D files= ( > > > > > 'mlx5_crypto.c', > > > > > + 'mlx5_crypto_dek.c', > > > > > ) > > > > > cflags_options =3D [ > > > > > '-std=3Dc11', > > > > > diff --git a/drivers/crypto/mlx5/mlx5_crypto.c > > > > > b/drivers/crypto/mlx5/mlx5_crypto.c > > > > > index fbe3c21aae..d2d82c7b15 100644 > > > > > --- a/drivers/crypto/mlx5/mlx5_crypto.c > > > > > +++ b/drivers/crypto/mlx5/mlx5_crypto.c > > > > > @@ -3,12 +3,9 @@ > > > > > */ > > > > > > > > > > #include > > > > > -#include > > > > > #include > > > > > +#include > > > > > #include > > > > > -#include > > > > > -#include > > > > > -#include > > > > > > > > There is some issue in the splitting of the patches, The above > > > > headers are > > > added > > > > in first patch and moved to a header file in this patch. > > > > Take reference of the cnxk crypto driver which got merged recently. > > > > > > The main reason is that in the patch we add a new c file: > > > drivers/crypto/mlx5/mlx5_crypto_dek.c > > > Now mlx5_crypto.c and that new c file both share the new h file > > > mlx5_crypto.h, so all the common includes are moved to the > > > mlx5_crypto.h file. > > > The header files include are changed due to the new add codes. > > > > > Is it not good to add these headers to mlx5_crypto.h in the first place= ? >=20 > As we can see the single c file satisfied everything in the first patch, = add an > extra h file with only with includes seems weird in the first patch. > Then in this patch, we have two c file, we adjust the includes to the new > shared h file. Everything is changed based on the new added codes. > Please let us know if you insist on that or not. When you add the base infrastructure patch, it places all the necessary pie= ces which are required for the subsequent patches so that when needed, code can be added = and unnecessary pieces of code are not moved again and again which is happening= in the current case. This looks cleaner and easy to understand while reviewing. Frequent movemen= t of code Looks complex and difficult to understand.