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 BFFC84590E; Thu, 5 Sep 2024 17:26:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A49B742E61; Thu, 5 Sep 2024 17:26:34 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id 5CB4942E5F for ; Thu, 5 Sep 2024 17:26:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725549993; x=1757085993; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=dbyJvqNfsnFCry5t+QZAn2f+Byd2he84CAE/e/rdcSk=; b=EYk9/OmdTGpoVbg42dL8IeZB+T6Dmuv4pFyTGfwijO7qDTGHxvzhnMvE O4/yVLjlRXTzANw3qJTB6/Yws1pn6j6AC9RG2nV8elC3/x87usuR5NO7Y 6kWkzR79gUH9W/0ykMG+SfWDPTVbB7wHeAdudFkBUZBN8DoPoKZQhPCJR JpNSdn9qVVQnGk0c2yazv0YHxo8ilTX7soYZ4OV6DM2+SZku4o4u87Rhl UFVJ6z3mFMbZPEALQQcRhIm7vNmKhLjqs69T4brY27HPCOM2oGKvJe4Es 6vt4IdWovghBdzppBGs0MXDR+i0Nlb5898zOrxJypUhbibDQQ2M2LSvqZ A==; X-CSE-ConnectionGUID: b+kHRbQlRNWeRPcDU2DhyQ== X-CSE-MsgGUID: krF7WxadRh21iAwJxFfqeg== X-IronPort-AV: E=McAfee;i="6700,10204,11186"; a="46806725" X-IronPort-AV: E=Sophos;i="6.10,205,1719903600"; d="scan'208";a="46806725" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2024 08:26:28 -0700 X-CSE-ConnectionGUID: vW4vt3IeQxC1PVZawqEt3w== X-CSE-MsgGUID: 9hBgqQNnQ0yK9GnP5fvrzA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,205,1719903600"; d="scan'208";a="65690942" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa008.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Sep 2024 08:26:27 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 5 Sep 2024 08:26:26 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Thu, 5 Sep 2024 08:26:26 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.45) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 5 Sep 2024 08:26:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QiAbUMxQvgymCtU1DXQYSFdj68yIhIt5eUJ85FJhNB+my+la+9hzH4U+zcMVLFhx6fhyNGhItlIbsPQrUhWGLvW48IN9u5NyWHVZ4lDRQPlEmI92V/QeGKXejcNqgtz6Vh8mFoPvyiw8PZQfckBuD8tWWSZ36iYu3dUWAIELkm77ZiyQtVtYpn1QS92wAu+W+2ZQUVtwPsSO0PiljiZldLX5pk7SBsb+kYcU4NHM5SGcP0U5keVjXCWbbZ0pShBkCSKiRCtvmRCw3tHyYfiKpOpog9OuQ3WTNF/UyChs4959bjJJIFX5JC+Tnrqs+0sjqGKLxNB2661hdC3kow9PAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ckZrJ5XmPAXJ2EAP7zPWdI1fjjZtdqrwA8DPr1DQccc=; b=J7srK5XYdtmryOh0rYnvagYrU+5Zayv6qLrcH7bwzI5/EPGK0c3O+eWhrz5qxk6JDd4hMPPTRsXEO6isC0RAW8pTKPiR8tYucKIo6N3Z20baQqD/Yu26xwjlUiHibEuXPxHyzRHXaT3/okZ4peR8h9UGzrgYCfI8uq4DT4wL3goMykybpw+0KWSVa8M6J2lLqJy4D6z00XtcRbnV2VKkGX554RByWjWi2czv0tDyEdtT3dTum689Z9Q++RW1ZL33hIx5yJPfIvqFiaGtPXUcO4pCR6YkRm0rJd9V/AEVGk4/4RlgZvySpAqm60rndPv6KNSLOhmswhBbIqLeurmizg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH0PR11MB5013.namprd11.prod.outlook.com (2603:10b6:510:30::21) by MN2PR11MB4695.namprd11.prod.outlook.com (2603:10b6:208:260::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27; Thu, 5 Sep 2024 15:26:21 +0000 Received: from PH0PR11MB5013.namprd11.prod.outlook.com ([fe80::1c54:1589:8882:d22b]) by PH0PR11MB5013.namprd11.prod.outlook.com ([fe80::1c54:1589:8882:d22b%7]) with mapi id 15.20.7918.024; Thu, 5 Sep 2024 15:26:19 +0000 From: "Kusztal, ArkadiuszX" To: =?iso-8859-1?Q?Morten_Br=F8rup?= , Akhil Goyal , "dev@dpdk.org" CC: "thomas@monjalon.net" , "Marchand, David" , "hemant.agrawal@nxp.com" , "anoobj@marvell.com" , "De Lara Guarch, Pablo" , "Trahe, Fiona" , "Doherty, Declan" , "matan@nvidia.com" , "g.singh@nxp.com" , "fanzhang.oss@gmail.com" , "jianjay.zhou@huawei.com" , "asomalap@amd.com" , "ruifeng.wang@arm.com" , "konstantin.v.ananyev@yandex.ru" , "Nicolau, Radu" , "ajit.khaparde@broadcom.com" , "rnagadheeraj@marvell.com" , "mdr@ashroe.eu" Subject: RE: [PATCH] [RFC] cryptodev: replace LIST_END enumerators with APIs Thread-Topic: [PATCH] [RFC] cryptodev: replace LIST_END enumerators with APIs Thread-Index: AQHa/3yMZWrb07atS0Ggx1sKtXLB2bJJTBkAgAACVkA= Date: Thu, 5 Sep 2024 15:26:19 +0000 Message-ID: References: <20240905101438.3888274-1-gakhil@marvell.com> <98CBD80474FA8B44BF855DF32C47DC35E9F6A8@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F6A8@smartserver.smartshare.dk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR11MB5013:EE_|MN2PR11MB4695:EE_ x-ms-office365-filtering-correlation-id: fbfcd9f3-a31a-4a7f-b46d-08dccdbf175a x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|366016|7416014|1800799024|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?E7INL31WSc6u+z2+dTE4Kyx8owGiOgmv4lT7iAOtHLCKiV5j9cl8omDl63?= =?iso-8859-1?Q?i3afDnsE6bfYrvr9+yR3pREsdlzdRVcM3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7?= =?iso-8859-1?Q?+OPlWxOTByUbFRNqCjy+jtDdPKYMALsIQ7PDizPkY2smTwwRubtX8mrTBV?= =?iso-8859-1?Q?ZP0axA814PHjALtm6j4T3nFqcNbbpoy5BongRXAItwveGxCfYatEWqRg02?= =?iso-8859-1?Q?kjjsmIn1SIOD0ayya1S5qqhTa0J4BoNUpK1H/Bic+mI//eyEFUuMfVa4uM?= =?iso-8859-1?Q?e9Uy9OS1qrAA/wvtl6OFF/12gWTazF7e2+4M2SQ04d3RpVgv955sFK1pUw?= =?iso-8859-1?Q?A0/166CNoy4C4EjOZb219N+O4imgCtyA2sJEzQegipzK008s+JaPopYaZV?= =?iso-8859-1?Q?MUMbCwViuqZpECGD5W2sHUZCE7FaFOXvuF7EodB31PSnI6qY4hHNIRL9FG?= =?iso-8859-1?Q?IhCJ7uMX/9/PY6mepn4G80KiX7hk3Bcm2xPbKQ4K6pM6y+pXqgy6Dy8mgD?= =?iso-8859-1?Q?u9spR2V+2qaqrSoa1otH8kesC2RJgfKOMfP7KNDSl61QYikRFr6uy5S/bH?= =?iso-8859-1?Q?JYyuAKynvaU8hFz8mohw35apL6DbEV8Q6hIqoQ=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5013.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(7416014)(1800799024)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?QJCA3bj+JWKdpWMq1UdCHq+AuZIKa/YvdO4kW7xMxwh88680EaOJVzuUdl?= =?iso-8859-1?Q?UQRiUM+HTbDtrS/jg8TCVZuq9k70lXVwXokg79rejaWunNXjof2pfo0EAj?= =?iso-8859-1?Q?eKJ/tDr2u77oBGkv4vy6c64mfJS1Za3OIMkF3sDMFOp25q1k1QWV9RiMci?= =?iso-8859-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obtjc8d6Sp?= =?iso-8859-1?Q?owjeMTLWb+doxcWK37QcAU6GwACINVFqyZGDXcWTw5BYItxzpo8KUbyEFU?= =?iso-8859-1?Q?843bLlmbQK2d54dLoN3e157koeDuMjkZFF1KGEI1Tf9Ho37XD9eCPJ4qvr?= =?iso-8859-1?Q?TzU+xJ4kn6VKXcpLFg8XcV/8d1pUzRE7iiVmEFNmKIRUgWCDFjLHa6vJEA?= =?iso-8859-1?Q?Egcp0Z5IHAG1qBNj/hFRC6P68kB4qP2LUvlshnqUupz/ksQFRLrnXAT5it?= =?iso-8859-1?Q?jFwEIxvS+QrFxIeGi3q2zdGgNwKFVlBcEOPYNED5kk0TteNvAFqssjeXD7?= =?iso-8859-1?Q?t966hQpxHU8d0XQIvKA4prI0bsyZCuVPFNNEL4bxZ7Apt2vpd1C3UEkdnZ?= =?iso-8859-1?Q?c68/repQ/sQRpBNsccNPAZKJsieEj6bJgiqEcyjgTFGtdaKLIRJYFduAZD?= =?iso-8859-1?Q?RjxuS6RCKv7984vAOl/B9uhgItlKRplTg5XnEeG5OHbzqWi7GMlTRWN1Ty?= =?iso-8859-1?Q?x5ITG0PyfFYPJAJ2V/6DpQhKY60qldzW8/Eb96Dwop1YEkssSOeOHA8vYO?= =?iso-8859-1?Q?ZddpmtZk3q/ItktHZGVwdflDFgaRhD145EKAebm4OwaP8Glkam1y23Pw?= =?iso-8859-1?Q?=3D=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5013.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbfcd9f3-a31a-4a7f-b46d-08dccdbf175a X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Sep 2024 15:26:19.3477 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0saQG3Dj/ugYNfPuivXnoUF40wLk1iCWZaKINrHjX2z/2ZFEVHDSvrZY0koWVjoMj0n/l9ZTbF4mtolUXnPgrHWr8YhgcxBVmEqVsih5ReI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4695 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Morten Br=F8rup > Sent: Thursday, September 5, 2024 5:09 PM > To: Akhil Goyal ; dev@dpdk.org > Cc: thomas@monjalon.net; Marchand, David ; > hemant.agrawal@nxp.com; anoobj@marvell.com; De Lara Guarch, Pablo > ; Trahe, Fiona ; > Doherty, Declan ; matan@nvidia.com; > g.singh@nxp.com; fanzhang.oss@gmail.com; jianjay.zhou@huawei.com; > asomalap@amd.com; ruifeng.wang@arm.com; > konstantin.v.ananyev@yandex.ru; Nicolau, Radu ; > ajit.khaparde@broadcom.com; rnagadheeraj@marvell.com; mdr@ashroe.eu > Subject: RE: [PATCH] [RFC] cryptodev: replace LIST_END enumerators with A= PIs >=20 > > +++ b/app/test/test_cryptodev_asym.c > > @@ -581,7 +581,7 @@ static inline void print_asym_capa( > > rte_cryptodev_asym_get_xform_string(capa- > >xform_type)); > > printf("operation supported -"); > > > > - for (i =3D 0; i < RTE_CRYPTO_ASYM_OP_LIST_END; i++) { > > + for (i =3D 0; i < rte_crypto_asym_op_list_end(); i++) { >=20 > > +++ b/lib/cryptodev/rte_crypto_asym.h > > +static inline int > > +rte_crypto_asym_xform_type_list_end(void) > > +{ > > + return RTE_CRYPTO_ASYM_XFORM_SM2 + 1; } > > + > > /** > > * Asymmetric crypto operation type variants > > + * Note: Update rte_crypto_asym_op_list_end for every new type added. > > */ > > enum rte_crypto_asym_op_type { > > RTE_CRYPTO_ASYM_OP_ENCRYPT, > > @@ -135,9 +141,14 @@ enum rte_crypto_asym_op_type { > > /**< Signature Generation operation */ > > RTE_CRYPTO_ASYM_OP_VERIFY, > > /**< Signature Verification operation */ > > - RTE_CRYPTO_ASYM_OP_LIST_END > > }; > > > > +static inline int > > +rte_crypto_asym_op_list_end(void) > > +{ > > + return RTE_CRYPTO_ASYM_OP_VERIFY + 1; } >=20 > I like the concept of replacing an "last enum value" with a "last enum fu= nction" > for API/ABI compatibility purposes. >=20 > Here's an idea... >=20 > We can introduce a generic design pattern where we keep the _LIST_END enu= m > value at the end, somehow marking it private (and not part of the API/ABI= ), and > move the _list_end() function inside the C file, so it uses the _LIST_END= enum > value that the library was built with. E.g. like this: >=20 Why asym crypto API does need these ENDs at all? Will any PMD or the user e= ver or use it? Sym crypto does not have this at all, as well as rte_crypto_= asym_ke_type in asym crypto. >=20 > In the header file: >=20 > enum rte_crypto_asym_op_type { > RTE_CRYPTO_ASYM_OP_VERIFY, > /**< Signature Verification operation */ #if RTE_BUILDING_INTERNAL > __RTE_CRYPTO_ASYM_OP_LIST_END /* internal */ #endif } >=20 > int rte_crypto_asym_op_list_end(void); >=20 >=20 > And in the associated library code file, when including rte_crypto_asym.h= : >=20 > #define RTE_BUILDING_INTERNAL > #include >=20 > int > rte_crypto_asym_op_list_end(void) > { > return __RTE_CRYPTO_ASYM_OP_LIST_END; > }