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 CEAA9A04A2; Mon, 31 Jan 2022 15:35:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59BFC41186; Mon, 31 Jan 2022 15:35:52 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 15D5741183 for ; Mon, 31 Jan 2022 15:35:50 +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 20VE0X8Z018867; Mon, 31 Jan 2022 06:35:47 -0800 Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2171.outbound.protection.outlook.com [104.47.58.171]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3dx1pa24gg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Jan 2022 06:35:46 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dhp3FfaDpXVbxfN5qJ1Z5Fwt79dJ+1EdiNWoIH0CIuBk20CCz2sA1DSGXIAe5w9NL7nKQdFOBVA6eUXxTE+sDSsOKyR5tJx2YjiYKz0p8T7kAR393rrOv0qfSyMzVkZUhuOiadQlpBNQ44nk+1dgjfb+kbAPrmK87fO4Ckb8NZPc7rjejwi1IqZRZHyqpg6KFyTb9uaswNi+AlXPkuQdh5KmyfET9lSdyNWs6EZN4PC8TN4PfIbPKBmBFa3WGN0KMi/yZwyqZARlXcMn9qBZeVQJiBXSOwk5z16zz0AEjm+fAd4dVqlRObsT+7GuYvDbpEetRSq2z9o9zFZA4FeY/w== 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=mjO076t+xSk0i8/zQklYnOsDzxYXASkkZ5aGP5OFWBI=; b=PAVC/cdZLOqf976bGuxvvgiJAi3sdHVNUp7bMi03phX0EEyZ8str2tGVyN4p+tieU53AdjKUUv6SmMq724dazsrZkK4H8H2iPVKmGl1rACW9mh0NBMhckGPXNhwWiABBWWmLrgZ7Zr9C4sD2kuym9B82mEL9hmD8gdzqac5wazC+7v59eiiuIjG1BZXRTfKFPP26yCsfhFBI4J3X2CcJhnL8ds/ONJyvMA6la5hYGVcjKfBbH3xnInDKEIT3ByvU8BCFSNqHAeCbAljSVRr7ElP9XV9vNPx+w8t6m63OiPtHEaONUhgw3FvFKw7ofj/nFy4qvb/82hvxgLDHwcJgxQ== 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=mjO076t+xSk0i8/zQklYnOsDzxYXASkkZ5aGP5OFWBI=; b=Ee6P2jcGqzH8DVoYGnuF/B7FMcbmRYArWeh5fBV4a3hUjvO79sNKBLSiMaAkwt/hfw8kFq10U62uItN07uDEA3SIw1dTWLWT0xdPXQqOBEqF9B9/zx/HynU6MQiMdX5DPOGIv8RmXaOFyRfkKnDg2yJ0J7m2C8NMIF+4ic7362c= Received: from PH0PR18MB4672.namprd18.prod.outlook.com (2603:10b6:510:c9::16) by BL1PR18MB4168.namprd18.prod.outlook.com (2603:10b6:208:30a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.22; Mon, 31 Jan 2022 14:35:44 +0000 Received: from PH0PR18MB4672.namprd18.prod.outlook.com ([fe80::9490:685c:8235:9b93]) by PH0PR18MB4672.namprd18.prod.outlook.com ([fe80::9490:685c:8235:9b93%4]) with mapi id 15.20.4930.022; Mon, 31 Jan 2022 14:35:44 +0000 From: Anoob Joseph To: Ciara Power , "dev@dpdk.org" CC: "roy.fan.zhang@intel.com" , Akhil Goyal , "mdr@ashroe.eu" , Declan Doherty Subject: RE: [EXT] [PATCH v2 4/4] crypto: modify return value for asym session create Thread-Topic: [EXT] [PATCH v2 4/4] crypto: modify return value for asym session create Thread-Index: AQHYETOf/w+Dh9rxuk+y6cy0ryDErqx9NIsg Date: Mon, 31 Jan 2022 14:35:44 +0000 Message-ID: References: <20220124150339.280090-1-ciara.power@intel.com> <20220124150339.280090-5-ciara.power@intel.com> In-Reply-To: <20220124150339.280090-5-ciara.power@intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 89b4a7ca-f749-4701-b5b7-08d9e4c6f6a7 x-ms-traffictypediagnostic: BL1PR18MB4168:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 72K13IpPaAq/Ufz/VSL40mR+q9R1v6uMKHFnK4dNEj9wUNDOo68nWjr/c/BjfxtBSB3d0oLNh//vp/0g4bFg+Gs24ELme/6BrmfTuy9GS4RUBRg4ZK4A8NnUU8HyrUEIRs3lvxnZ2Q9EXNOD6j92hqOqBTF+IDfOy8aUDXyfqTLIHR0nPhlicBfUt3FCcr4NyIHQKCirf0zFOoM41NZ2clYj2D3jIaD9WKIMZcbAHYvYKtHyH+AKg+/et0LtPHbf/lVsVxhnVcqKfGkOkDsVBAOGWdJydOmCmC+D/e/BN7Kewx5irSyTsoJuCM9jxZW2JopKzopEoj00608a7mleRf0qEW7jFRT2L2cmFDGnV7qWs10p6nk/iZZqqMl2ANzG7fh8JNLpT05FglXBRxHS9y1ulQ8nbsSyfbz449T/VSJeRro6X/tZSwr0CHULL0H/k7EzUR2ebP0goBxHqwbJvnaVZPthsoDenVI29pohoVUQjN9OFDkeJLnJzKDdfmMYBU8JtvYfIMpHqxy2nFcUH22zZ0rRpbfgreUiJzES5oLPp4i583a947xR3YbSzLdy8w2tDtpOf3ef6kRd6WoaVt5z4mv/GWmIC0aVJQuY7lD2MpaKVF1gaivqBZat3tJ7ssrFtvA23g0Y1BfZoCZZxr+QZp+KBFVNyp59hWeiSmABVL88j8jTPifjk0G6gesk7nYvakjqFPhFcNoe2IYGURXmNJo3NoAntnPjqr5GTM1rlggFRtbqG8h4rLxIngKBvNGTUalWjILaTDY6UbFhzdodMtYOIbUEeALTNc3NvN0= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB4672.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(76116006)(122000001)(38070700005)(38100700002)(8676002)(66476007)(4326008)(66946007)(316002)(66556008)(66446008)(64756008)(8936002)(508600001)(54906003)(86362001)(966005)(71200400001)(110136005)(55016003)(9686003)(26005)(53546011)(186003)(52536014)(6506007)(7696005)(5660300002)(83380400001)(33656002)(2906002)(20210929001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?3ALMrbU1rJWfa+8E3pLcUbMG5XUmLqUmJqTPjWsElMywOSCpGReMaeNyVf0d?= =?us-ascii?Q?JQzV1iijUO1gWE7AT4SXDxk+W1xXs0LIPcM1OITWkaULe3O++rPR9aNWH4wX?= =?us-ascii?Q?j58KrvB+15Bk/QexKhpEcOnEnLH/siY93XviQlvPsQMTYjsAsI+rmx2dUqP3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bCuVFCLWmbhS08ZSw39ndYJB9ejsMDc3IW?= =?us-ascii?Q?XqGScbbyg+no1/ba+KCDZWwqmlExnW5oHJKa5DKrzYRPscrk9HMgovTKSQNS?= =?us-ascii?Q?RxMxSdjTksdHjF0kgjOOnhDW9ulwMfjtBsMLw0yxqTNyjOn1y1gWy90Hptsb?= =?us-ascii?Q?s0lNL3zrsBYSf9z3NhzPTfl4e0aZuA8aNlVybpQ7aPsBxnD8EAVmiaueZpXi?= =?us-ascii?Q?4b1lbVapMtNC8XBy7ampJiWvAbqM1mKki6pvJ4qy2FZ0kmPsFJlOnWMi/X74?= =?us-ascii?Q?JCUTP+OMZydMPQabOsFq6lEZC7zGDsBYby60aV7OvRA4+tIFlEg7PtJOZlCX?= =?us-ascii?Q?bCEvUq9EIzvtdtj85U7xZb3Q3csRhIlb4E1m1Dba9qM21p7plT1hDaULo2w6?= =?us-ascii?Q?grgZ1+9D1kg2KiDPxV6JClqfYsMgo4/Wm0PYhS6mJKRoI+vCth6S4AfyOSPI?= =?us-ascii?Q?Ov/YmmL+LWAQcciKM9Gm2YiBoXsDOaZajW7q502Gly0z9R+jGjLc49zcTUQ7?= =?us-ascii?Q?1Vbcux9iiCjrqrCVAQ8U0Oeh1iLwnr8koNRsqs0st/hhOB6NGfRMmAjlJov+?= =?us-ascii?Q?ug=3D=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: PH0PR18MB4672.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89b4a7ca-f749-4701-b5b7-08d9e4c6f6a7 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jan 2022 14:35:44.1229 (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: AqnfTIn7EKnCtwW+wruxXPWvtyqEkumMbOHSAfMaSSCIvKF8glbmgqkuBxaz5xQVdT8B9B918mWVg9eQly+4uA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR18MB4168 X-Proofpoint-ORIG-GUID: FdjKmQbymWripl7CU0CwtfLc9rx5prJd X-Proofpoint-GUID: FdjKmQbymWripl7CU0CwtfLc9rx5prJd 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-01-31_06,2022-01-31_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, Minor nits. Please see inline. With the fixes, Acked-by: Anoob Joseph Thanks, Anoob > -----Original Message----- > From: Ciara Power > Sent: Monday, January 24, 2022 8:34 PM > To: dev@dpdk.org > Cc: roy.fan.zhang@intel.com; Akhil Goyal ; Anoob Jose= ph > ; mdr@ashroe.eu; Ciara Power > ; Declan Doherty > Subject: [EXT] [PATCH v2 4/4] crypto: modify return value for asym sessio= n > create >=20 > External Email >=20 > ---------------------------------------------------------------------- > Rather than the asym session create function returning a session on succe= ss, and > a NULL value on error, it is modified to now return int values - 0 on suc= cess or - > EINVAL/-ENOTSUP/-ENOMEM on failure. > The session to be used is passed as input. >=20 > This adds clarity on the failure of the create function, which enables tr= eating the > -ENOTSUP return as TEST_SKIPPED in test apps. >=20 > Signed-off-by: Ciara Power > --- [snip] > @@ -744,11 +746,13 @@ cperf_create_session(struct rte_mempool *sess_mp, > xform.modex.exponent.data =3D perf_mod_e; > xform.modex.exponent.length =3D sizeof(perf_mod_e); >=20 > - sess =3D (void *)rte_cryptodev_asym_session_create(sess_mp, > dev_id, &xform); > - if (sess =3D=3D NULL) > + ret =3D rte_cryptodev_asym_session_create(&asym_sess, > + sess_mp, dev_id, &xform); > + if (ret < 0) { > + RTE_LOG(ERR, USER1, "Asym session create failed"); [Anoob] Don't we need \n at the end? [snip] =20 > @@ -644,9 +645,9 @@ test_rsa_sign_verify(void) > struct crypto_testsuite_params_asym *ts_params =3D &testsuite_params; > struct rte_mempool *sess_mpool =3D ts_params->session_mpool; > uint8_t dev_id =3D ts_params->valid_devs[0]; > - void *sess; > + void *sess =3D NULL; > struct rte_cryptodev_info dev_info; > - int status =3D TEST_SUCCESS; > + int status =3D TEST_SUCCESS, ret; [Anoob] May be move status to the end? Here and in other places. https://doc.dpdk.org/guides/contributing/coding_style.html#local-variables =20 >=20 > /* Test case supports op with exponent key only, > * Check in PMD feature flag for RSA exponent key type support. > @@ -659,12 +660,12 @@ test_rsa_sign_verify(void) > return TEST_SKIPPED; > } >=20 > - sess =3D rte_cryptodev_asym_session_create(sess_mpool, dev_id, > &rsa_xform); > - > - if (!sess) { > + ret =3D rte_cryptodev_asym_session_create(&sess, sess_mpool, > + dev_id, &rsa_xform); > + if (ret < 0) { > RTE_LOG(ERR, USER1, "Session creation failed for " > "sign_verify\n"); > - status =3D TEST_FAILED; > + status =3D (ret =3D=3D -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED; > goto error_exit; > } >=20 [snip] > diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.= h index > 6a4d6d9934..89739def91 100644 > --- a/lib/cryptodev/rte_cryptodev.h > +++ b/lib/cryptodev/rte_cryptodev.h > @@ -990,18 +990,21 @@ rte_cryptodev_sym_session_create(struct > rte_mempool *mempool); > /** > * Create asymmetric crypto session header (generic with no private data= ) > * > + * @param session void ** for session to be used > * @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 > * @return > - * - On success return pointer to asym-session > - * - On failure returns NULL > + * - 0 on success. > + * - -EINVAL on invalid device ID, or invalid mempool. [Anoob] PMD can also return an -EINVAL if some invalid configuration is req= uested. May be better to leave this open, like, "- EINVAL Invalid arguments" > + * - -ENOMEM on memory error for session allocation. > + * - -ENOTSUP if device doesn't support session configuration. > */ > __rte_experimental > -void * > -rte_cryptodev_asym_session_create(struct rte_mempool *mempool, > +int > +rte_cryptodev_asym_session_create(void **session, struct rte_mempool > +*mempool, > uint8_t dev_id, struct rte_crypto_asym_xform *xforms); >=20 > /** > -- > 2.25.1