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 4D6624410E; Thu, 30 May 2024 13:46:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3DC7040608; Thu, 30 May 2024 13:46:53 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 3910C402E4 for ; Thu, 30 May 2024 13:46:51 +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 44UAQ3GX022209; Thu, 30 May 2024 04:46:48 -0700 Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3yeqpx0981-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 May 2024 04:46:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g1l1wIEOxUPsyO45fexlKR8YdMSSeHzJ90IyAmvixElZL6drkaInRWMQ+vo0zStdqQIfMgoimXnJz7NgOBoUD9yp1xgjWa1sHLxqBwuaXN8gq/XL3oYW5rtZfvSR7VB5+MO9s6Ev+YbOx5L2FfRpag/Uqd3avf5NMmR3kHHeytSsyXfUlF5ylnf/NYE+Vcycjgo45MvbVJ7BN1Y+1MiIq0CWUK0hfB08mUcU3tWbF+BrX7EmRYPceJNS4O1PFRbu2iM3xUrr//uiDuJG2Bal08dSbVuIRojzbJL15jP/kqEJkNc+e/PqJGogW7SexaA1j0p5KIiLvqfOF8iD2D4aPA== 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=XqlLgtJRV3Sbl/Zt44+u0wZ9qnSXZ0f/gGnguyb1D6o=; b=NoUBhrvMSyhhJ6Vx5mxSkfPGDnFqj5VrgRl4UYwJSmnt3OUN4TVqpgi9WxENVPYb8ACDlleWITEIyOcMkUU8wpBBEpBwdh27YcqKwq4enDGI2X67HOt/wn9WmynITI+S8zzpabmzDKDzvkgPzHPXF+rphv5A3RQ0Zi+Rsmol8o4VD6Q9NLkQeiw8+f/U8CEYWtOXznQEMsxxGSU+LTeYGm+hZlydPY/2pmr45cU5RA4jN2VfJBtHmY7Z9TJglVhwB302oInQMFbrFdHMFOcNPlGH4e68/VbiYrAVa42ALjBxhecko4ua+E0ni61O6nZ9W3RBhvvTJ6+Tv1t+0NHkIw== 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=XqlLgtJRV3Sbl/Zt44+u0wZ9qnSXZ0f/gGnguyb1D6o=; b=RzutNeG/5euDowp5kVdAcYg3dAsqDfieeSj3GH/KZKZM5dJ3z9Uqmd7lY6fieuxyH2OrqGJOirC3L3fWBsjN7pQXjwndYxq/cT+X9HMLTFmWM0xCjyxy5lD2WJfhSo2QwJfSybJ5ToybAJ5j61nRfNsGSYvN/RAOd70RO3tQQcI= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by MW5PR18MB5149.namprd18.prod.outlook.com (2603:10b6:303:1c7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Thu, 30 May 2024 11:46:45 +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 11:46:45 +0000 From: Akhil Goyal 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" , =?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: AQHasdYqBA7BiFARTUmhLk6iVntHPbGvZbfQgAA31SCAAAr8AIAAAGqQ Date: Thu, 30 May 2024 11:46:45 +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: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO6PR18MB4484:EE_|MW5PR18MB5149:EE_ x-ms-office365-filtering-correlation-id: 9e9f6b70-c223-44c9-c763-08dc809e2eab x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|1800799015|376005|366007|38070700009|921011; x-microsoft-antispam-message-info: =?iso-8859-1?Q?TYc+yno09tX8Mc7mEBtf6iVJuKEGhsieDJKXxr+vWSLDAKhJaS/v4enXGg?= =?iso-8859-1?Q?LR8QA0KhIiNkatAZTKF1B5r9pyinhH1E6XpE4J+uFj6fGwcrlVPnFyFqR8?= =?iso-8859-1?Q?ZF16G4OE0gZiVoKUsb6A0ak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?RsyxjYhtlqggXh4boZwe3mFNpcdwA/GjovHYGz9GYyhJPAsmQw83LGGo1+?= =?iso-8859-1?Q?8J3nxpvHOjptuRIaGKN0r8vduq8KcVoh2q0jy5ocKPJZc6zoNtD6S392b4?= =?iso-8859-1?Q?MUz9VaI6MRnEjDLwYGQLOYyDAETzSMukM5m7JJ9iFiJi3BN/dVcMF26Rnl?= =?iso-8859-1?Q?FZXHW7OF6JSajpZa7lbpMQ/gu3bpsvsfeN8gWRzksN1lmnVF45Jj0FASX8?= =?iso-8859-1?Q?jQo1q/Cb3guIvOTO/K8gPzKn2uETw8HHLWQYPuBvea2+Na87CNTFZyTGaO?= =?iso-8859-1?Q?P+gVKp1HfZ3+IhFLb8859o0i1w64kjxDIMdDT+2m/cpWRRmct3pDX1RA6w?= =?iso-8859-1?Q?LyUniLAVMx73KnJLUYO+jC22ki2iXvk4IzvNLSpqzxe7A7c8R8wGs=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)(921011); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?B8bpXvL9+IRBuA86bUJLZL7BZjnyqRVTZGc00FRN0CMVmVAUKARdBnHffD?= =?iso-8859-1?Q?uP60wkW1LqYR4cLY1gYiKmG31FGl0A+D0PC+/W8D7TjPNyseeKI7v61sjc?= =?iso-8859-1?Q?mba001Glic5Egq2zcedZGrVCsAp7T7LYGEY5TR9ztPjY2ikkXFHBt4SzQD?= =?iso-8859-1?Q?/3K3Q3nVwwCULa5UpPFBp85+rGfyySBg9Ff1S4NmxodtpVogcbf3Pvj95/?= =?iso-8859-1?Q?x67S+zZrS5/jDfYaPKGSyk0deptlvR15pyZkmTn8CGR1AYHZ6uH7jiVZrm?= =?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JxLJmdlr1myTWT5q23tYvoQgZDafM2sWlmSuez21ALh?= =?iso-8859-1?Q?Lruo4cdWskHZ4jwsYEKrS+PS/a439YtCkf8AmH6D5r/4pavBo2LA0nCOYK?= =?iso-8859-1?Q?Q1N8tgnLakemB+i2on41VsiAbw7gteyNTadGRh1z7dg2cAM8lBrcTlAwE5?= =?iso-8859-1?Q?bo3V+asJLM/gg+MAq81GoD9x0Yqm1ZCGo1wZHtOxV/G0qeTYsp61ox9VAf?= =?iso-8859-1?Q?bWEqVGxD2GbCCTdiLIzXqagIQci6g7odVx4bCtTdhWxZjzMnYp8Oe8UjPR?= =?iso-8859-1?Q?2uC+ytTPZpd/r+hVLRpLCmx4U337Kh6GaPHEQxY/F6W3HmQ2IDbzENU3Vq?= =?iso-8859-1?Q?ybacmE1jXUoVBBEwqcZVCV781MoM66qg52LfCbMs66E3t1io/XLYBBZpDE?= =?iso-8859-1?Q?en0nfByMi6Bv9YjJqHQTcmf3BvtH66X/lmp3A1dAmX+ev+loM39JfEGc8c?= =?iso-8859-1?Q?euB7s6fWiC0HUhAOXsDadxGszfx56BIjMR?= Content-Type: text/plain; charset="iso-8859-1" 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: 9e9f6b70-c223-44c9-c763-08dc809e2eab X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2024 11:46:45.5646 (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: WQVuTAoI3VNvu0A74QsJa2H6GdVezbY0r98N6e7+JGU2l8vTutwSa+Sj9uIqS8MZAm3bYl7xoR2pQxSSUxaR/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR18MB5149 X-Proofpoint-GUID: y-Bn20X3ekkqWajRUI29RshllkwaP7lU X-Proofpoint-ORIG-GUID: y-Bn20X3ekkqWajRUI29RshllkwaP7lU 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_08,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 > > > #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 implementati= on 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. > > > > 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 to = use. > > > But the API implementation is compiled out. > > > Rather, you should add a return ENOTSUP from the beginning of the API= s > > > 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. No, that is not the correct way. Application should check the return value. And we cannot force it to add ifdefs.