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 3BE5B4410E; Thu, 30 May 2024 10:12:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15617402F1; Thu, 30 May 2024 10:12:56 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 64A4D40041 for ; Thu, 30 May 2024 10:12:54 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44U1uK94024565; Thu, 30 May 2024 01:12:51 -0700 Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3yeg7ws12m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 May 2024 01:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WvRWF/Mt5xnq31wN7MXgk2y4yM3tf63qW9rAZ2pL5EAeH2LWkSDnLvYOYHzHOjnQvXwKoWqUmLNDPwNfBxyk/6+kqA9pRrshwobkkmT4kchV6ohIjDM15dS8mRsOWTNU1k4fpRQ9u5vYPyadh5XOKz9qTNb0yyuA6Jr1pn1VZpEzAU8d3MAHvJ92+55cgIJWSpTovR/MMUcQQ1qgk6xY65FqGwzatqY2VkC68ZO7yTkTIwDhr2ZvOJG4lckIv5w1vZIjtKMbdkg3n+lw6uya5gKCuHxn6cFIH3CdVy3RTe2+PCja99vAlVuCFtm6pbd83hsjYaEsrpzk1+KyH6wtXw== 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=9VIxX1cL8QSHYq92SlSHFO99Y01ZUixoUKEXppteoas=; b=k91HvY7allRceC/xgYuqeM9Re9MKFN7TCaOyaWjoC+WkP6AmbNGn0O09NhfFkgx80sERXz3ZPhOONOQdAV4Ew2/EHtkG8UMmbouoKN8OdLjvUm2A/JlCpReizm/lwPq16fPiB/5TDVI98Pd1Vm419VWP76NpBqHbIooE9oHQ5BkesNze+omLCatpgxQm38yH4/BtQygwtcoWR1rLlMVkKt2mQLpdLhuqeCLO8d1cPAILRL3YYUtyNY26r4IDJ6JYQuEIlQu6MsUICE7YD+nbBzTbYbD2OCG7yG1NsAVFXDmfepQymPxPrilnmeH1Npp3W/PLiqFBeocOyg0OjxbfPw== 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.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9VIxX1cL8QSHYq92SlSHFO99Y01ZUixoUKEXppteoas=; b=c9iX4dxjoxntuqdIv/5njoHF4rb4nriCkylUiV6gV1aAwkwJnq2D3SL/RcfSzXv7BZcXqw6G0BTx1rkP3tm0mlvPH6FfAnc9o3Igb3N6E1uQgyLUy0iU4GL9UtlpP1MZyLlyeZPAtWRMzC8OSC9WLIwAFCHT6FIisK3j2moo1bk= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by DM4PR18MB5097.namprd18.prod.outlook.com (2603:10b6:8:50::18) 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 08:12:49 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d%4]) with mapi id 15.20.7633.018; Thu, 30 May 2024 08:12:49 +0000 From: Akhil Goyal To: Ganapati Kundapura , "dev@dpdk.org" , "abhinandan.gujjar@intel.com" , "ferruh.yigit@amd.com" , "thomas@monjalon.net" , "bruce.richardson@intel.com" , "fanzhang.oss@gmail.com" , "ciara.power@intel.com" 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: AQHasdYqBA7BiFARTUmhLk6iVntHPbGvZbfQ Date: Thu, 30 May 2024 08:12:49 +0000 Message-ID: References: <20240416081222.3002268-1-ganapati.kundapura@intel.com> <20240529144025.4089318-1-ganapati.kundapura@intel.com> In-Reply-To: <20240529144025.4089318-1-ganapati.kundapura@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO6PR18MB4484:EE_|DM4PR18MB5097:EE_ x-ms-office365-filtering-correlation-id: daa9a532-378d-4484-dd36-08dc80804b9f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|1800799015|376005|366007|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?bO8tHGC7M/f1aQcw9r2E6fDyiM7Pjf55SvtUFr/GL93AcxazKRsEMsZwXH00?= =?us-ascii?Q?+THug+VylHIkiCmd/JD1sJ+pr5y3mgWhxsrkfW/p0GNWSKlL8yp1TbdGIlTT?= =?us-ascii?Q?muHwG6wIWCU8hI50PhpJ7cJUua+B6Px22UMGvBYhBNgS9jieGOJWLITgykcp?= =?us-ascii?Q?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Fjiy3I0SG5Dq?= =?us-ascii?Q?KPNkPqjc+quaJLV3tUbB/7kzR/m19WgGwMo9Rq3euIJ94vP4uBINwr1/Iu/B?= =?us-ascii?Q?PCI2wajuN26PFDL8wpA4Nz0QlHyIJ3xPF127vwpGdNMUwjBD3W+rJEX790YH?= =?us-ascii?Q?fMutV5tK45eG3SME2uA4/P9Ojv3tzd48fGQi7xh+Rxutfy4BLWKV8wcncRNn?= =?us-ascii?Q?r89uS20asKUe1sjEpL+7V5bebg1R9HQvvLKncOdj9iAilP+gBgt6NeV7cRAN?= =?us-ascii?Q?q9OiwpKI3mTFby9zvzq6nLxIwrka/0zUZVDoIdLi9Cns+g=3D=3D?= 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:(13230031)(1800799015)(376005)(366007)(38070700009); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?AmbKVVdmjYVEWu0rXDX4Uj/a0rw9HeaqBIeJEbidKG1HfIavp9kfaE4s1k0O?= =?us-ascii?Q?WWonaH/nAmA1FSRYKMniageaooYcwwGomYTHIgtYJFzom+v2QT6nVSSWoK9w?= =?us-ascii?Q?ud6Q/vLqBD9siOvKgxqATq52EPLKLkvAEdPdVfxhatjFr94OcugjoJDGWEXG?= =?us-ascii?Q?4tTTMtK6tk40oyqBaaOCdKmuAyK+1mgpwijEPaJ5GnEJbzBKBf1xYc/mHQWY?= =?us-ascii?Q?9YKI3WHKXAWP7bFa5yUiYXwUgqdhQ/sUAas5Qb9c2tIKZrCQocMtiGx9jZuW?= =?us-ascii?Q?5MjQotUQEVx2eo/inFGHkdnQIGZqsuYJnFdpgIGHzGN6e5ZpfFF1OEsdLU44?= =?us-ascii?Q?GkpUjxNmK0tNXdsyAGdh+0qQPddSmSRHu6ov26xUPV5J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29ttnMv+lQQ1Sr+n7w3aVBRaw4A+j4d4ngBjLXIQdMgVDN0Yapm?= =?us-ascii?Q?9ML5ki70utzMOu5KAA6QFiRTnCQecCem9dKMs7XNaVGtBLR98p0uAFTQUuEU?= =?us-ascii?Q?JTzzdzGms7502GTQsl0oEYqT868SwRil4YDmtqg1BfZ9CIB0Goz/aZuMUgDl?= =?us-ascii?Q?+xBdAo3du94aX4X88QPw/pHC49sEIK6dzSKCQrQZK7fCFIaIY3nnMAlkOC+F?= =?us-ascii?Q?aBYKGaOc9fSpHiszKJDUHVbe/9BOZ8dPSRHkjvIYcNOd0EARo9d1wXPWfT9+?= =?us-ascii?Q?6sN2efCYtFA/ffcgqDJwnq+5V4M0O52EbAC2OZmZ?= 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: daa9a532-378d-4484-dd36-08dc80804b9f X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2024 08:12:49.2474 (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: /E+tjwAhh070/rY3ru1Oz0TkuRXTevfM80OtOM4Rv5fCjA+266/uSU5U5CaZQSxp4rPlPngAyyKWXCDQTJp9ag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR18MB5097 X-Proofpoint-GUID: 2KCFdhpNzzXd5vHxk89RrMro48rcutTL X-Proofpoint-ORIG-GUID: 2KCFdhpNzzXd5vHxk89RrMro48rcutTL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-30_05,2024-05-28_01,2024-05-17_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 > -----Original Message----- > From: Ganapati Kundapura > Sent: Wednesday, May 29, 2024 8:10 PM > To: dev@dpdk.org; Akhil Goyal ; > abhinandan.gujjar@intel.com; ferruh.yigit@amd.com; thomas@monjalon.net; > bruce.richardson@intel.com; fanzhang.oss@gmail.com; ciara.power@intel.com > Subject: [EXTERNAL] [PATCH v2 1/2] crypto: fix build issues on unsetting = crypto > callbacks macro >=20 > Prioritize security for external emails: Confirm sender and content safet= y before > clicking links or opening attachments >=20 > ---------------------------------------------------------------------- > Crypto callbacks macro is defined with value 1 and being used with ifdef, > on config value is changed to 0 to disable, crypto callback changes > still being compiled. >=20 > Used #if instead of #ifdef and also wrapped crypto callback changes > under RTE_CRYPTO_CALLBACKS macro to fix build issues when macro is > unset. >=20 > Fixes: 1c3ffb95595e ("cryptodev: add enqueue and dequeue callbacks") > Fixes: 5523a75af539 ("test/crypto: add case for enqueue/dequeue callbacks= ") >=20 > Signed-off-by: Ganapati Kundapura > --- > v2: > * Used #if instead of #ifdef and restored macro definition in config > * Split callback registration check in a seperate patch >=20 > diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c > index 1703ebc..72cf77f 100644 > --- a/app/test/test_cryptodev.c > +++ b/app/test/test_cryptodev.c > @@ -14547,6 +14547,7 @@ test_null_burst_operation(void) > return TEST_SUCCESS; > } >=20 > +#if RTE_CRYPTO_CALLBACKS > static uint16_t > test_enq_callback(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op = **ops, > uint16_t nb_ops, void *user_param) > @@ -14784,6 +14785,7 @@ test_deq_callback_setup(void) >=20 > return TEST_SUCCESS; > } > +#endif /* RTE_CRYPTO_CALLBACKS */ >=20 > static void > generate_gmac_large_plaintext(uint8_t *data) > @@ -18069,8 +18071,10 @@ static struct unit_test_suite > cryptodev_gen_testsuite =3D { > TEST_CASE_ST(ut_setup, ut_teardown, > test_device_configure_invalid_queue_pair_ids), > TEST_CASE_ST(ut_setup, ut_teardown, test_stats), > +#if RTE_CRYPTO_CALLBACKS > TEST_CASE_ST(ut_setup, ut_teardown, > test_enq_callback_setup), > TEST_CASE_ST(ut_setup, ut_teardown, > test_deq_callback_setup), > +#endif > TEST_CASES_END() /**< NULL terminate unit test array */ > } > }; #if may not be needed in application. Test should be skipped if API is not available/supported. > 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; > } >=20 > +#if RTE_CRYPTO_CALLBACKS > /* spinlock for crypto device enq callbacks */ > static rte_spinlock_t rte_cryptodev_callback_lock =3D RTE_SPINLOCK_INITI= ALIZER; >=20 > @@ -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); > } >=20 > +#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 to 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.