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 ED903A034D; Wed, 9 Feb 2022 20:52:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BA85C41141; Wed, 9 Feb 2022 20:52:49 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 6AF8641101 for ; Wed, 9 Feb 2022 20:52:48 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 219Bewp2013166; Wed, 9 Feb 2022 11:52:42 -0800 Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2049.outbound.protection.outlook.com [104.47.66.49]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3e4cpj252w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Feb 2022 11:52:41 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I/MqDhQScWKsoUkrjPdVdnkoOe/E63jC7ygDZpc4TMIiNFF521mDzel6fXotCRE9Knie20u70ZWT7o8BvOZrhndv6volseQvR6YlISpWAKPPG4uYfuFCsKRWVH3eVeNwbzfmxbt+27YOssIp6r9lTnGgB9Kma8IP9Z55HjiRkaCAQ4gcwE+qMwhrQkTiywir0kT+iCgLrfIA6nU7KXQBkSATjXkeY+isYZHxyD5Qki7/3N7SrygQisKVI45kVxeHqMb2x2WrBQmlurHE5crMSCDvfkoXkm7WTT22C9M+4GVkILHasaFg4AidA2Nmodaeu/QBo/uVd4Eqje9hX2uVhw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8STGDLNuC25+aPzOnZ24+PCR62KuuV/AR4im60J7z50=; b=HIUc3IGjUqvPDxsF4SXGgQMpdoqYIY2utXsxKu4iH14BOI2GgkTJDAG1q+pCkJFFcibrTq+Ms6jRzj1Ml3R0h5v73JvBEG5tMOpylyhrGQgZWoeXhx+abVlGNdJNNsAATQFm35xsfXSn5A7nmQPcGiv0yvf46MWf+KWeMtgvc6YVakghCPuKAtfAJ2TtInPUr7RjMUU7b2KnpVmRpriH4bfZqhZBeVcqM9BXIILEP0RqxH95d4A0U0tzHxPBTG2rYTcoINd+Z2dU780RKm0XVKhaIZ7LlYBy+gCG7bs1PGTOY5nqsMb0vKcMVPuPSwRlGTYDsJAPaovWu45rsdBGGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=8STGDLNuC25+aPzOnZ24+PCR62KuuV/AR4im60J7z50=; b=I58RQUzRN0zjgx/Lqh5lSS1UHyMZwhzWltLpZ0oN6d9gOh4EP3YhhaoCiuy76za6A8Ekx0LwWdc03q7ziC9fuL6Y04kAaUkMckah23l3R13y9cHrl4yEcAAgsCBBqHUaiBP9HaiFBpIrNfJ18it597QgsnXha1eM16Ot9+EVUww= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by MN2PR18MB2623.namprd18.prod.outlook.com (2603:10b6:208:102::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19; Wed, 9 Feb 2022 19:52:36 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::9985:c3ca:2f91:7fc]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::9985:c3ca:2f91:7fc%5]) with mapi id 15.20.4951.019; Wed, 9 Feb 2022 19:52:36 +0000 From: Akhil Goyal To: Ciara Power , "dev@dpdk.org" CC: "roy.fan.zhang@intel.com" , Anoob Joseph , "mdr@ashroe.eu" , Declan Doherty , Ankur Dwivedi , Tejasree Kondoj , John Griffin , Fiona Trahe , Deepak Kumar Jain Subject: RE: [EXT] [PATCH v4 2/5] crypto: use single buffer for asymmetric session Thread-Topic: [EXT] [PATCH v4 2/5] crypto: use single buffer for asymmetric session Thread-Index: AQHYHcswlnVhS9IGQEKVvBSyGvdTw6yLk6Bw Date: Wed, 9 Feb 2022 19:52:36 +0000 Message-ID: References: <20220209153854.2740455-1-ciara.power@intel.com> <20220209153854.2740455-3-ciara.power@intel.com> In-Reply-To: <20220209153854.2740455-3-ciara.power@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dae6908c-be7b-410c-d763-08d9ec05b88f x-ms-traffictypediagnostic: MN2PR18MB2623:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8VwiaiKBSrqOJ48wPG3S0pVuIwcn+Ghw/hHNj0uSQ37RiLmRRuBWx/PSr8Qd6TGYGoXyg64albfoK0+WpCWsfwXDnGmDYyTPRga7GMq9U6UO3/KdbzRchiYkngIn+8EgSsm1iUx8+HJKGjt0f7nwKb0RTQiqBcq1TqpHdta2aQYCqM9Jc0ch1KeSaJ1jyMUhIfKpnaLcFs7Y5bjy+WcszYimvIn+ieGA06xNIfg+UmS/SK15ie9FKrdLLFBRSnD4VXoSltYDXMXILpLAdtvEuxwJQ9Xs/dZXNrjVNjoAorTAcnSX12CcnBlDkiLIGkOTN333nhJdBEIdzAUuhFeaCHVbj2RNXAPX4klpV1jMIBeWQIxJyTFzvErsW6K7uef1wS4OO3so8f8XGXA/UeLRJm1MVHCyVgfrFK7VEeOGApVf4zubJu6hlv/pjVc5NPdZ+jQedqhHefTjhGb/XIFsifJvOkYivRuOv9cvOdkA1nW4dCQikHJorLNxtGCAKFFYZhJw5BFswgXplXbztIBob60cx1eXvrQj3+T/wf0O3Cwu6SkCt2Uhn/QI0UhugQDVhjf9TTadzbbl/enPafmmTqb4PZP9HCmN0TjTBnqeMMqk4GgBTpjoEbiyLUX9NTtZUTYCHEBkpHP4qdkbpCLls/jCIP1WIA4DF9VDhKs9Nv6g+tKpxpEarI2xHnnoocUVtuAZTgT4XxxgEAoEgsUyJw== 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:(13230001)(4636009)(366004)(66556008)(38070700005)(66476007)(76116006)(508600001)(38100700002)(186003)(26005)(66946007)(316002)(110136005)(54906003)(8936002)(66446008)(64756008)(52536014)(5660300002)(6506007)(4326008)(55016003)(9686003)(83380400001)(122000001)(33656002)(8676002)(7696005)(86362001)(71200400001)(55236004)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?S7KGNj0XmGtVxhh9xX37EcjVwQTOar3p1jwuNevWExgxdPGfUv62IYlX9htz?= =?us-ascii?Q?CA00kR4IP1MMi7dc7d1DnNQrFaCpGcNEJm7+idKR0KdZctzgKCicoW6mq/D5?= =?us-ascii?Q?PxYinXTB5i/zhfGL4KneqWg1SsIIRGdkCzzupi1dphLddBJAHeIjnTIVup/k?= =?us-ascii?Q?XQDH4hLPaIfipKVPixEX52djGcrprzVqhH+D43Z5r2VAIgaXsOZ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SxmKmG83Km8yjI+aTxW04a6je4qzwGmJosJHcUVtRH9vFxc0Jncx?= =?us-ascii?Q?ij3J/VWrIajJELDKIkD88MQEK7S5PYSM/pFrGERrvfUiSLB+kpgOjSdgWKtH?= =?us-ascii?Q?XVt4CgN/E7wVxjYF8ksWOP3KQosFGfiPiAYvIQFzRj3lAiLUrOMbyZ7FLeNn?= =?us-ascii?Q?ikJ4QcXUP5JycfUTa179cZ0rDM66iLr+U7u8PL8Mx6pBsBZ7M2xEfTHxDe6I?= =?us-ascii?Q?3oWqnfgAtyD4mE/ad8f+wVDQS7rTDAMVppJh4tIgHYN8bgV9RHqKlglpCLz8?= =?us-ascii?Q?04P54adI8kSmaFxX2o3YyssSfVwBJ7Ut0W2Dj3VEnSgPIl1hJPo5Bam3MJoX?= =?us-ascii?Q?Djnhp2HYkQtDFyKWzEemdXfWSlsA4/1DUCdjBxDZDT9AQ5luDiXtXJIH8vpn?= =?us-ascii?Q?ONgER4j4v7Qad8RV3OtwGe2qn4J4rev7KJCE3CGjBJvxA6xphWpiR3nvKkCh?= =?us-ascii?Q?I5MqCPtCaouCMq34xHCgXYj7Yk4OsZK006tFsnzwZxQBfdVv7A29PDT1ia/U?= =?us-ascii?Q?3+uVI3bnN4tX3E/nrG/R7EI=3D?= 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: dae6908c-be7b-410c-d763-08d9ec05b88f X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Feb 2022 19:52:36.4124 (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: QnHwfb+FPMAUtcDUpB4x2eFr7tFwg2BqYMCcFM33EpFhAIOv6JaarxM7HSCVyLVkBiq9wEF+WhiFIcG/uBZ3Jg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2623 X-Proofpoint-GUID: PK0vX8QKG-_xixu8wiMdfkEArbNV7k1D X-Proofpoint-ORIG-GUID: PK0vX8QKG-_xixu8wiMdfkEArbNV7k1D X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-09_10,2022-02-09_01,2021-12-02_01 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 Hi Ciara, Few minor comments. > - /* setup asym session pool */ > - unsigned int session_size =3D RTE_MAX( > - rte_cryptodev_asym_get_private_session_size(dev_id), > - rte_cryptodev_asym_get_header_session_size()); > - /* > - * Create mempool with TEST_NUM_SESSIONS * 2, > - * to include the session headers > - */ > - ts_params->session_mpool =3D rte_mempool_create( > - "test_asym_sess_mp", > - TEST_NUM_SESSIONS * 2, > - session_size, > - 0, 0, NULL, NULL, NULL, > - NULL, SOCKET_ID_ANY, > - 0); > + ts_params->session_mpool =3D > rte_cryptodev_asym_session_pool_create( > + "test_asym_sess_mp", TEST_NUM_SESSIONS * 2, 0, > + SOCKET_ID_ANY); I believe TEST_NUM_SESSIONS * 2 is no more required. It can be simply TEST_NUM_SESSIONS. >=20 > TEST_ASSERT_NOT_NULL(ts_params->session_mpool, > "session mempool allocation failed"); > @@ -1107,14 +1052,6 @@ test_dh_gen_shared_sec(struct =20 > @@ -628,16 +626,9 @@ set_sym_session_private_data(struct > rte_cryptodev_sym_session *sess, > } >=20 > static inline void * > -get_asym_session_private_data(const struct rte_cryptodev_asym_session > *sess, > - uint8_t driver_id) { > - return sess->sess_private_data[driver_id]; > -} > - > -static inline void > -set_asym_session_private_data(struct rte_cryptodev_asym_session *sess, > - uint8_t driver_id, void *private_data) > +get_asym_session_private_data(struct rte_cryptodev_asym_session *sess) > { > - sess->sess_private_data[driver_id] =3D private_data; > + return sess->sess_private_data; > } I think we can safely remove this get API as well and use sess->sess_privat= e_data Directly. Since we are removing set API, get can also be removed as session struct is= visible to PMD. > /** > * Create symmetric crypto session header (generic with no private data) > * > @@ -971,15 +998,19 @@ rte_cryptodev_sym_session_create(struct > rte_mempool *mempool); > /** > * Create asymmetric crypto session header (generic with no private data= ) This line need an update. > * > - * @param mempool mempool to allocate asymmetric session > - * objects from > + * @param dev_id ID of device that we want the session to be used on > + * @param xforms Asymmetric crypto transform operations to apply on = flow > + * processed with this session > + * @param mp mempool to allocate asymmetric session > + * objects from > * @return > * - On success return pointer to asym-session > * - On failure returns NULL > */ > __rte_experimental > struct rte_cryptodev_asym_session * > -rte_cryptodev_asym_session_create(struct rte_mempool *mempool); > +rte_cryptodev_asym_session_create(uint8_t dev_id, > + struct rte_crypto_asym_xform *xforms, struct rte_mempool > *mp); > diff --git a/lib/cryptodev/rte_cryptodev_trace.h > b/lib/cryptodev/rte_cryptodev_trace.h > index d1f4f069a3..f4e1c870df 100644 > --- a/lib/cryptodev/rte_cryptodev_trace.h > +++ b/lib/cryptodev/rte_cryptodev_trace.h > @@ -83,10 +83,22 @@ RTE_TRACE_POINT( > rte_trace_point_emit_u16(sess->user_data_sz); > ) >=20 > +RTE_TRACE_POINT( > + rte_cryptodev_trace_asym_session_pool_create, > + RTE_TRACE_POINT_ARGS(const char *name, uint32_t nb_elts, > + uint32_t cache_size, void *mempool), > + rte_trace_point_emit_string(name); > + rte_trace_point_emit_u32(nb_elts); > + rte_trace_point_emit_u32(cache_size); > + rte_trace_point_emit_ptr(mempool); > +) > + > RTE_TRACE_POINT( > rte_cryptodev_trace_asym_session_create, > - RTE_TRACE_POINT_ARGS(void *mempool, > - struct rte_cryptodev_asym_session *sess), > + RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *xforms, > + void *mempool, struct rte_cryptodev_asym_session *sess), Sess is not an argument to sess_create API yet. This would be updated in yo= ur later patch. > + rte_trace_point_emit_u8(dev_id); > + rte_trace_point_emit_ptr(xforms); > rte_trace_point_emit_ptr(mempool); > rte_trace_point_emit_ptr(sess); > )