From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A12EC25B74 for ; Thu, 30 May 2024 11:45:48 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 53F6B40608; Thu, 30 May 2024 13:45:48 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id C8F69402E4 for ; Thu, 30 May 2024 13:45:47 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id A5A5C20904; Thu, 30 May 2024 13:45:47 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [EXTERNAL] [PATCH v2 1/2] crypto: fix build issues on unsetting crypto callbacks macro X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Thu, 30 May 2024 13:45:42 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F4D8@smartserver.smartshare.dk> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [EXTERNAL] [PATCH v2 1/2] crypto: fix build issues on unsetting crypto callbacks macro Thread-Index: AQHasdY+VQlBT0PFPEGB76JakVCKkLGvbqWAgAAvM4CAAANMgIAAB2sQgAAAupA= References: <20240416081222.3002268-1-ganapati.kundapura@intel.com> <20240529144025.4089318-1-ganapati.kundapura@intel.com> <98CBD80474FA8B44BF855DF32C47DC35E9F4D7@smartserver.smartshare.dk> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Kundapura, Ganapati" , "Akhil Goyal" , , "Gujjar, Abhinandan S" , , , "Richardson, Bruce" , , 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 > From: Kundapura, Ganapati [mailto:ganapati.kundapura@intel.com] > Sent: Thursday, 30 May 2024 13.42 >=20 > Hi, >=20 > > From: Morten Br=F8rup > > Sent: Thursday, May 30, 2024 4:44 PM > > > > > From: Akhil Goyal [mailto:gakhil@marvell.com] > > > Sent: Thursday, 30 May 2024 13.02 > > > > > > ++ Morten for comment on #if vs #ifdef > > > > > > > > Subject: [EXTERNAL] [PATCH v2 1/2] crypto: fix build issues on > > > > > unsetting > > > crypto > > > > > callbacks macro > > > > > > > > > > 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. > > > > > > > > > > Used #if instead of #ifdef and also wrapped crypto callback > > > > > changes under RTE_CRYPTO_CALLBACKS macro to fix build issues = when > > > > > macro is unset. > > > > > > > > > > Fixes: 1c3ffb95595e ("cryptodev: add enqueue and dequeue > > > > > callbacks") > > > > > Fixes: 5523a75af539 ("test/crypto: add case for = enqueue/dequeue > > > callbacks") > > > > > > > > > > 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 > > > > The DPDK convention is #ifdef, not #if. > > Ethdev also uses #ifdef, e.g.: > > = https://elixir.bootlin.com/dpdk/v24.03/source/lib/ethdev/rte_ethdev.h#L61= > > 12 > > > > PS: Personally, I prefer #if too. But we should set personal = preferences > aside, > > and follow the existing convention in DPDK and use #ifdef. > Irrespective of RTE_CRYPTO_CALLBACKS value set to 0/1, > #ifdef RTE_CRYPTO_CALLBACKS returns true always. Yes, because it is defined in both cases. So according to the #ifdef convention, rte_config.h must contain either: #define RTE_CRYPTO_CALLBACKS 1 Or: /* RTE_CRYPTO_CALLBACKS is not set */