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 E45EF44111; Thu, 30 May 2024 16:22:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C8CD40DC9; Thu, 30 May 2024 16:22:19 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by mails.dpdk.org (Postfix) with ESMTP id 32D9E40A7F for ; Thu, 30 May 2024 16:22:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717078937; x=1748614937; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=WIJw9mrEGk4J9OJsC8Km/MFGJXzXxCaCutzSlJHOONQ=; b=cR9U5N5RT+jZFXmofVsmINYf09lub5c3E5Y3+2H7E71p8RsMuRIxSf0b isGc36OGZ/eZ+arLDYk/k9XiRpLMUB4+LqwakCwqVr/t3ZhflV0plpAV+ HYrDhO4VSvXJ9NeEZfxxYNt+ngnerEK8NTy73NiACkPdKoIY2d8mPepVM iiD6cqgewFu49rVY8F/IzUovaDRC7XhAl9sFOOlltRbpzbPVcGfW4Qoab E8asGqei2WI06t6FlrC1IWz9D1+XhMUjsUTEyefi3BAaMoEXzEa3aWKdZ W4VRcvS1eweQIfCr9t4+hCnjG4TnYrH7k0IKRgumapZCr4g5Xy00MwHpo g==; X-CSE-ConnectionGUID: 0XmH/Q7BTHaTENv0R98EfQ== X-CSE-MsgGUID: hkvgS4bdQuykMyLyWhYy7w== X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="13328809" X-IronPort-AV: E=Sophos;i="6.08,201,1712646000"; d="scan'208";a="13328809" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 07:22:16 -0700 X-CSE-ConnectionGUID: ikxJEpB2Smq+nK9YVLSxRA== X-CSE-MsgGUID: g1wXfkWiSIK5KCdjTnM69Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,201,1712646000"; d="scan'208";a="35768631" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orviesa010.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 May 2024 07:22:16 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 30 May 2024 07:22:15 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 30 May 2024 07:22:15 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx612.amr.corp.intel.com (10.22.229.25) 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, 30 May 2024 07:22:15 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) 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, 30 May 2024 07:22:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=amlVGItoYxLnGOAppwc2aMgd6YJCW2HrDkArTQa0nAkTwYeTKNw8AOWVfGQH4jzpyfDRZ/6etualh8Lf2hxYY8Xaqgu4UiftfOrEaYbiXNi8ai8zDYg65vpmGVetpEZyUB8J1hmyc1mLA3TfGbYfOgdmJsmvewRCuSyUMRAAHbQ4f0mIFn/Cs1KwCTjJlTe22qn/kmUmJ4UdpRcVhmqzsDe6TRg1/sqZE1lmHax9eelwsivV002QQek8RJfO3azujJjvj1IBZPIuzdRx6D5JIdQ1kTzlM39/nSLtXNdF8ydl0Hr0HSXiGeQMm0+jzm4ivFP2ntbrJJaO1KK++VbDrQ== 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=jQT4J1EXMOcLs6pmcAZXQNnY8E/hHsqv7aRE/ZOAtm0=; b=mYnLSDFZT21Z4q/G3S2UH1LbavbvM46apCCCsD4Lb9NyPRmOPqXqtMtAQrC+wkEvOy4+7tjeUYURwNFzxWIyriPbLa5K0ySp8lZzsbTXM9eNYOQARiLjvwk1x+sB08zxCTZ+a4cASXH/nn4jvw8yyFqa1W/WBXkX4IIlNsJq/HDng4dxjcVBYXyTq3uZ5DA/M4VOGZ0Q1IuB4M0ABlSA5XY8WeF7HH/ZEN7dzsxnykkQAHUJ66jGcOSLjoT8Yju9lEtKEqThWGI+4N2dfI2zrSDkH/fNEbr24+VJepSrzpHb4UI0o9fqRO2odVFwu5JgedrQxQoT4bxR+cCA6oikjg== 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 MW4PR11MB5911.namprd11.prod.outlook.com (2603:10b6:303:16b::16) by DM4PR11MB6262.namprd11.prod.outlook.com (2603:10b6:8:a7::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Thu, 30 May 2024 14:22:12 +0000 Received: from MW4PR11MB5911.namprd11.prod.outlook.com ([fe80::1d00:286c:1800:c2f2]) by MW4PR11MB5911.namprd11.prod.outlook.com ([fe80::1d00:286c:1800:c2f2%3]) with mapi id 15.20.7633.018; Thu, 30 May 2024 14:22:12 +0000 From: "Kundapura, Ganapati" To: Akhil Goyal , "dev@dpdk.org" , "Gujjar, Abhinandan S" , "ferruh.yigit@amd.com" , "thomas@monjalon.net" , "Richardson, Bruce" , "fanzhang.oss@gmail.com" , "ciara.power@intel.com" , =?iso-8859-1?Q?Morten_Br=F8rup?= Subject: RE: [EXTERNAL] [PATCH v2 1/2] crypto: fix build issues on unsetting crypto callbacks macro Thread-Topic: [EXTERNAL] [PATCH v2 1/2] crypto: fix build issues on unsetting crypto callbacks macro Thread-Index: AQHasdY+VQlBT0PFPEGB76JakVCKkLGvbqWAgAAvM4CAAAlH0IAAA0yAgAAm7yA= Date: Thu, 30 May 2024 14:22:12 +0000 Message-ID: References: <20240416081222.3002268-1-ganapati.kundapura@intel.com> <20240529144025.4089318-1-ganapati.kundapura@intel.com> In-Reply-To: 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: MW4PR11MB5911:EE_|DM4PR11MB6262:EE_ x-ms-office365-filtering-correlation-id: 414c27a1-aa06-4284-29fc-08dc80b3e5af x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|366007|376005|1800799015|921011|38070700009; x-microsoft-antispam-message-info: =?iso-8859-1?Q?H4gXwTUK70JkV75uKncbjKaVHeRF5JljqAx5oc4isyLhpfGNxzoBXIRKYl?= =?iso-8859-1?Q?RsL3SM/0EXQpFO6nZrt55vPP6F1EmEXBkBNfsbsIhCliZ3/S74jiiMgTry?= =?iso-8859-1?Q?u0OrBkDERjjhs59Pqzcz0hOLZpox/oyrA9sV/2dzBiKDnzz52Ixx/9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kwsAqWbv4uquKyPRB4V+SNHy/?= =?iso-8859-1?Q?kzOu1h5We6mjqiGHZzoYBSr9c9JsUA75FbZkEV6cRtMX850KxkNRNweMFW?= =?iso-8859-1?Q?YU+ZCiXCg+n913v9C1KJ38FxjoUvxB/w65gcX3twHHaXuD/1n9dVgzLgCe?= =?iso-8859-1?Q?qgpdiLyHfxgYXQdqGh9ITGORXkOoj8Jra65OkX6EpZCcAHVt3YCMYViN6t?= =?iso-8859-1?Q?ATmIm11LMnNbqnrOi5q3Kbi3Ck4NPjKJG/nxmvpVqZ2yya8qyFRtlxhF5i?= =?iso-8859-1?Q?ggKEavs37/iHwoVnqWv11NzsQKqFw+qAtOJktEAYYiz8yqDI0eiDqndQ8A?= =?iso-8859-1?Q?/QARRb81rgPv5Y0kQotFFcpJ39WwU7VRSOOZcbg08rlv72qt/U54I=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR11MB5911.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(376005)(1800799015)(921011)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?xih9q2GdqXZngjqL+KKFvDcG7+R4TlEkcsWVSbl3/2iVVnfRecPW0KIVuz?= =?iso-8859-1?Q?XnHBkOGp66HjVM/q2MkBoaULIq7+06QKuCZrQtn1nNDqlSYppcZy72ImJW?= =?iso-8859-1?Q?X14vqBqg0oCDF+ReoQQqElOs6w7GXCSM5sVoMnTPDSGYtfmYOBaFvbsJNC?= =?iso-8859-1?Q?H9SlBO7xH9L0kHBNh0MhmLUftdnMnJMljhh4dppOUn5aM5VGRZGYDQJB6x?= =?iso-8859-1?Q?Vmjk5gpYSnhOb5bsdt3TRnWmoySb9ZTSPh6i78EDOlg0/94Fo3GhZ3lCZw?= =?iso-8859-1?Q?Qaiy2eIt41ER8/v8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JsaVm?= =?iso-8859-1?Q?4T8c2Xs7O66LDwPGXbmc8l9hl+wErrND0EuSy2qZ9CNO5zMGVPTu0e0p47?= =?iso-8859-1?Q?WP5lEi8Og0lhoIJFhIPfxUaBb1Q8ddyJVXvfyujmLBoOjKoLNcpzzlj/Bu?= =?iso-8859-1?Q?dy/oxYoIxsLCDLRr/OWGU0uvNN0cgk9CQxX6pSDDeJAr0eMlPLEzmkKhRe?= =?iso-8859-1?Q?EnfCtr/Cbg/IVLX0hmJhfWTRTHNtev/MhEKA2k50ZKg37RJeveR5N0CD+x?= =?iso-8859-1?Q?RUM6i117U2WFdKfhW0gx5YG2U+adrZr/v9pkbvs2IH8N98RVW4loATey3Q?= =?iso-8859-1?Q?HyZbCrhTMLVdc+w5b0VzK9NiV3GvwpMxihqrnMF7TB5Jom7kye3ESdHG6n?= =?iso-8859-1?Q?GtTUjGhecWZ71cueJg0D9Hc7tRQcGedaI1ERngi6vMGp81eL1F4vttwamU?= =?iso-8859-1?Q?xyH5gTjswwNh+jmYLlIr7MFNzQL4XI5LRQuPzw09sKUNbQW3Fimay3Ew?= =?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: MW4PR11MB5911.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 414c27a1-aa06-4284-29fc-08dc80b3e5af X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2024 14:22:12.0204 (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: YsW5KL5VArMAnJOkk+1cu3lSigUuyiBGdkM/BVN7enNq1RmUlwxusR0HvEd9wF0M0kIHI6BNdzMxhpjQQ3x9O4MU7lrFCJJKHA2rWG47XWY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6262 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 Hi, > -----Original Message----- > From: Akhil Goyal > Sent: Thursday, May 30, 2024 5:17 PM > To: Kundapura, Ganapati ; dev@dpdk.org; > Gujjar, Abhinandan S ; ferruh.yigit@amd.com; > thomas@monjalon.net; Richardson, Bruce ; > fanzhang.oss@gmail.com; ciara.power@intel.com; Morten Br=F8rup > > Subject: RE: [EXTERNAL] [PATCH v2 1/2] crypto: fix build issues on unsett= ing > crypto callbacks macro >=20 > > > > #if may not be needed in application. > > > > Test should be skipped if API is not available/supported. > > > > > > It's needed otherwise application developer has to check the > > implementation for supported/not supported or else run the application > > to get to know whether api is supported or not. > > >=20 > Application is always required to check the return value or else it will = miss the > other errors that the API can return. Currently RTE_CRYPTO_CALLBACKS is enabled by default and test application c= hecks the=20 return value of the APIs. This patch fixes build issues on compiling the DP= DK with unsetting=20 RTE_CRYPTO_CALLBACKS.=20 >=20 > > > > > diff --git a/lib/cryptodev/rte_cryptodev.c > > > > > b/lib/cryptodev/rte_cryptodev.c index 886eb7a..2e0890f 100644 > > > > > --- a/lib/cryptodev/rte_cryptodev.c > > > > > +++ b/lib/cryptodev/rte_cryptodev.c > > > > > @@ -628,6 +628,7 @@ > > > rte_cryptodev_asym_xform_capability_check_hash( > > > > > return ret; > > > > > } > > > > > > > > > > +#if RTE_CRYPTO_CALLBACKS > > > > > /* spinlock for crypto device enq callbacks */ static > > > > > rte_spinlock_t rte_cryptodev_callback_lock =3D > > > > RTE_SPINLOCK_INITIALIZER; > > > > > > > > > > @@ -744,6 +745,7 @@ cryptodev_cb_init(struct rte_cryptodev *dev) > > > > > cryptodev_cb_cleanup(dev); > > > > > return -ENOMEM; > > > > > } > > > > > +#endif /* RTE_CRYPTO_CALLBACKS */ > > > > > > > > > > > > > @@ -1485,6 +1491,7 @@ rte_cryptodev_queue_pair_setup(uint8_t > > > dev_id, > > > > > uint16_t queue_pair_id, > > > > > socket_id); > > > > > } > > > > > > > > > > +#if RTE_CRYPTO_CALLBACKS > > > > > struct rte_cryptodev_cb * > > > > > rte_cryptodev_add_enq_callback(uint8_t dev_id, > > > > > uint16_t qp_id, > > > > > @@ -1763,6 +1770,7 @@ > rte_cryptodev_remove_deq_callback(uint8_t > > > dev_id, > > > > > rte_spinlock_unlock(&rte_cryptodev_callback_lock); > > > > > return ret; > > > > > } > > > > > +#endif /* RTE_CRYPTO_CALLBACKS */ > > > > > > > > There is an issue here. > > > > The APIs are visible in .h file and are available for application t= o use. > > > > But the API implementation is compiled out. > > > > Rather, you should add a return ENOTSUP from the beginning of the > > > > APIs if RTE_CRYPTO_CALLBACKS is enabled. > > > > With this approach application will not need to put #if in its code= . > > API declarations wrapped under the macro changes in next patch. >=20 > No, that is not the correct way. Application should check the return valu= e. > And we cannot force it to add ifdefs. Test application is indeed checking the return value. Ifdefs are added to avoid build issues on compiling with RTE_CRYPTO_CALLBACKS is turned off Which is on by default. Even ethdev callbacks also doesn't return -ENOTSUP= =20 on setting/unsetting RTE_ETHDEV_RXTX_CALLBACKS config.