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 9C9A144172; Thu, 6 Jun 2024 11:45:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4CA2B4027D; Thu, 6 Jun 2024 11:45:03 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 4CFAD40268 for ; Thu, 6 Jun 2024 11:45:01 +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 4567vaSV002934; Thu, 6 Jun 2024 02:44:58 -0700 Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2048.outbound.protection.outlook.com [104.47.66.48]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3yk9638cub-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jun 2024 02:44:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G9qaP8MRG9RoIdAEy/yWD2khKlWyQLI1TUEU9r6P00yk7lsZe5cNVNN99YeN2XnKOKEKR3oxszWvdOGstXp4V8fbDesqHB3bq4Y1GFmJBLv1zQq0P9QZPFCu3whpxg6qEMDvQZgFbcUvBuQ2rHOhPPSvywI8AYRT/ir0/CNLepyPFOh1IGMEiGVOWFdDLrmPxV0pokucxti6d1t1BnUygOCmYW8EMV44Ul2OyA4j5mAZFwOJLXJCbJuxgLTJzr6ZSKDmixFP/CsNs1O14JVSmSmwiteiNTSJYcm9HSbGndaC1ZGDUfSu95S9AdhA5annPFB1cSrk1vuBl19eW0almA== 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=ovQZWQVlZrHDtsFpS/iN1qUHAK3NKlNhkYrzGgQIIgY=; b=UVnoRIt8kk5m9N2YdqqglEC4PzkCrUd47AMWecv9Fim97lV5AzixhfBbnGsWpBkBd0xqOk5jRZlmggcyCkgT7JTjQLKAV0DnhBj74P3yd78wzc1ec6YQlr9A2cH6xFwNAJTqIyVf5n+uWx0AERKy5LvIKiBiuKgrazmvHbqmx8rrd1/BtKg0rIGm2n8G65x6dTZLrQRz4k2PbdmeMENXELPj9aRneFea5eLUMTXXn5/rwOU2/dkb5/oq+WuCIZbKz39X4drCQx6l1bmE0Ro9Z0qencvitoo4wW5uVN5pnrkbefvfYN+okHBRys1PXGMHyTpCqbpuKl5GOtAEt1B6UA== 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=ovQZWQVlZrHDtsFpS/iN1qUHAK3NKlNhkYrzGgQIIgY=; b=EqkVe2jFVXi1ueR+dQMaxATUuInt2O3L1YZsEx49vtZe4CmuiNlzX6awj9axkVsxQJcAFXJ1FSA9jeAzXrgEdCczDF6Rx2tDhMTy1pz1LP6t0d3kagQ1xM6rNmy9F6/YN05ZXpYTHDL3KxwTL0CXwdOETsvGttyN9vlZ1LnZCZ8= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by SA0PR18MB3663.namprd18.prod.outlook.com (2603:10b6:806:9a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.33; Thu, 6 Jun 2024 09:44:56 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d%5]) with mapi id 15.20.7633.033; Thu, 6 Jun 2024 09:44:55 +0000 From: Akhil Goyal To: =?iso-8859-1?Q?Morten_Br=F8rup?= , "Kundapura, Ganapati" , "dev@dpdk.org" , "Gujjar, Abhinandan S" , "ferruh.yigit@amd.com" , "thomas@monjalon.net" , "Richardson, Bruce" , "fanzhang.oss@gmail.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: AQHasdYqBA7BiFARTUmhLk6iVntHPbGvZbfQgAA31SCAAAr8AIAAAGqQgAAs6ACAAAeTgIAKqh8Q Date: Thu, 6 Jun 2024 09:44:55 +0000 Message-ID: References: <20240416081222.3002268-1-ganapati.kundapura@intel.com> <20240529144025.4089318-1-ganapati.kundapura@intel.com> <98CBD80474FA8B44BF855DF32C47DC35E9F4DC@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F4DC@smartserver.smartshare.dk> 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_|SA0PR18MB3663:EE_ x-ms-office365-filtering-correlation-id: 737d033f-c91e-4364-ea6b-08dc860d528f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|1800799015|366007|38070700009|921011; x-microsoft-antispam-message-info: =?iso-8859-1?Q?yte2ilf+jP+Dn/H/p0/OFwNUD7focFp5RwXh8oAkZw3wp2h9OkSZ3/wAhk?= =?iso-8859-1?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f+YRdhw1datO8Sw0LCnO2aAiUgG4lKs/?= =?iso-8859-1?Q?7X4SXyrVeNyIpkm0hxlVhOU0kSlLglGRfw3vpqu3WHCDDUShiFk9TBY+x+?= =?iso-8859-1?Q?S3mCM0qQ9NPjX2HOTGht9Ot94de3eI9vSKEJaLrdbgrokByF/Mnujduc8D?= =?iso-8859-1?Q?sL4nbvZqbytWMOsqcSDT/k9+Nmdg4wEAjbWdWUBwh7JhlwmkcuPslOtHK1?= =?iso-8859-1?Q?a4+sZX2MBWjK9jpr0dZTjfVsweOeQ2Be8FDwcQdgJsPO6DMhk0OdklZ5Fk?= =?iso-8859-1?Q?PPYG6UiZM4xptEi0Nx+9yIOxkOSdhpBOK/RkKUS67cdLBro3ptJhmxT/5H?= =?iso-8859-1?Q?xC0coRHT4zN/7nYBxuDcxYUZJFb3Jfj/sVSS32gncJi7Uk5MbMXcACTEJD?= =?iso-8859-1?Q?qpSYLHyZ7S6cJoqekjnSHr6PvK/btZEqmzig2CoIECav85p6kOBterMldL?= =?iso-8859-1?Q?J5yUMLaEMHlQ3CKQQiHrfMUWJRDIHFRIaDtKSrkaWm4PEGVV9Ew190+Pl4?= =?iso-8859-1?Q?HXsVdejhhR/ojnjA?= 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)(376005)(1800799015)(366007)(38070700009)(921011); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?mssCxuGXqL/ummf7yvuYjbNeH9bnldYlzo9iSEu70U6eeFN84DvCRdc/2a?= =?iso-8859-1?Q?sDGPNLBant933V4qhPvzDLKRehh6AvwaUEmp1z6C/A/A5HTJETfeEgRokn?= =?iso-8859-1?Q?ayCQbo9VpSoPbN7xf9EZt3MVQtm/qp+BgS+HU9F59ImcMLPzqu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T0uSU2OR06FgoHCL0EchJjtXPT1m37SRjxXwAp2b5QArvcMr/?= =?iso-8859-1?Q?J6EUVevr9IgFmvj4GHhXHB7tqx8DbbxPABwcE2ChTBItsZIPoPUxWH7uuN?= =?iso-8859-1?Q?c2//yithe9d7/njXQqo+pV5/gAEF8IhRM9+EE55+YowBlPikmdj+CVV3Co?= =?iso-8859-1?Q?nQTHqQDn0XrwJLu9wNd6gSV0v8Ejz0l7wJ0iBb+Uj266BqQP6H41j/B+GG?= =?iso-8859-1?Q?R2pvEP2V+Ls6KWDoNmsr0qjhdogtEQY31J+vKsVjrKsdl6/MMoefS2Mjjq?= =?iso-8859-1?Q?tjPnaXzZaElxOkO7co9j+5JVK0hPXzFGYesElG/AYY5Y1RDSE2Qz7jrd9r?= =?iso-8859-1?Q?JM5J/9OUsM2e7L2BzAg1OBHntn0NHEk/x12WYVID4ATfh5tTcuQAzR53sF?= =?iso-8859-1?Q?LMY/3wgw+tTkcgfzisBmc5XXk9ExPwcADnVoO634eGyMrrXuNZE6bnNBk+?= =?iso-8859-1?Q?ZTLj0ta5f3nyob2qo2tS/waNT3tK1PgJYFYO2UHdEgDMwLBBz7KXCYPxHt?= =?iso-8859-1?Q?41QQorQ3tZV5NbCc+u78MuB5Gxkkpos9f+kOA26xakdWYDLIV4RqiQSe9S?= =?iso-8859-1?Q?dKuTGRMhrRwHE=3D?= 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: 737d033f-c91e-4364-ea6b-08dc860d528f X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jun 2024 09:44:55.7380 (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: Yy4t9mFTq0liJfZV2q1GmYEEJsM17KgRW/XGfK7zL9IcIUmIOP9QBvhlZjltyYxBPkqBsaRtKZqB0ZWuXPN8VQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR18MB3663 X-Proofpoint-ORIG-GUID: fd8jcN3UbzIr92eagAFHv_AS2KYbawk4 X-Proofpoint-GUID: fd8jcN3UbzIr92eagAFHv_AS2KYbawk4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-06_01,2024-06-06_02,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 > > From: Kundapura, Ganapati [mailto:ganapati.kundapura@intel.com] > > Sent: Thursday, 30 May 2024 16.22 > > > > Hi, > > > > > From: Akhil Goyal > > > Sent: Thursday, May 30, 2024 5:17 PM > > > > > > > > > #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 applicat= ion > > > > to get to know whether api is supported or not. > > > > > > > > > > Application is always required to check the return value or else it w= ill > > miss the > > > other errors that the API can return. > > Currently RTE_CRYPTO_CALLBACKS is enabled by default and test applicati= on > > checks the > > return value of the APIs. This patch fixes build issues on compiling th= e DPDK > > with unsetting > > RTE_CRYPTO_CALLBACKS. > > > > > > > > > > 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 *d= ev) > > > > > > > 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 applicati= on to > > use. > > > > > > But the API implementation is compiled out. > > > > > > Rather, you should add a return ENOTSUP from the beginning of t= he > > > > > > 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. > > > > > > No, that is not the correct way. Application should check the return = value. > > > 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. >=20 > The test application should be able to build and run, regardless if the D= PDK library > was built with RTE_CRYPTO_CALLBACKS defined or not. >=20 > The test application should not assume that the DPDK library was built wi= th the > same RTE_CRYPTO_CALLBACKS configuration (i.e. defined or not) as the test > application. >=20 > > Even ethdev callbacks also doesn't return -ENOTSUP > > on setting/unsetting RTE_ETHDEV_RXTX_CALLBACKS config. >=20 > That would be a bug in the ethdev library. > I just checked the ethdev source code (/source/lib/ethdev/rte_ethdev.c), = and all > the add/remove rx/tx callback functions fail with ENOTSUP if > RTE_ETHDEV_RXTX_CALLBACKS is not defined. > Please note that some ethdev callbacks are not rx/tx callbacks, and thus = are not > gated by RTE_ETHDEV_RXTX_CALLBACKS. Hi Ganapati, Can you send a new version incorporating above comments and work on similar lines as ethdev is currently doing. I believe as Morten pointed out, use of ifdef is as per DPDK convention, So better move it that way. We can discuss later if we can incorporate these in meson options. Regards, Akhil