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 3DCB3A0542; Wed, 26 Oct 2022 11:21:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 182D340E28; Wed, 26 Oct 2022 11:21:42 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 95DDD40041 for ; Wed, 26 Oct 2022 11:21:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666776100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=731zZHpG3Fx0HytySacOfM9kBhQFGEUehvjdoE0sAQo=; b=h3VdkfrzDwlfO+AI9esT34l39TYjqYiAc9AdUcJkJ45mS9uzU37GjoIxkP8RVCtX0uJeq4 IYRw17r/9/ORbsouEa0j6Sk4yF8KWR4rG4wnSP/bDHCWGZdQBImcDNLj75jZ5mrzeGnzk9 MbhescY7T8kRDsv4hIHdXa/difbXssQ= Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-41-SBuCC6tYNnm8eS7dE-B4Jw-1; Wed, 26 Oct 2022 05:21:36 -0400 X-MC-Unique: SBuCC6tYNnm8eS7dE-B4Jw-1 Received: by mail-pf1-f197.google.com with SMTP id bq6-20020a056a000e0600b0056bcbc6720fso4177902pfb.22 for ; Wed, 26 Oct 2022 02:21:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=731zZHpG3Fx0HytySacOfM9kBhQFGEUehvjdoE0sAQo=; b=c38zBV2p5Oe/tj6x2LJ8PLmly+yNTwawm/hBB6XpxiYEHRxv60sKwa3AqgGfBukXAR V7NP5tqxRMKJBReGX0KFQD9S2SpSpjkDVs/m/M81rw0WL1OSIo9NpcC98kzCLYJ5g8KZ bF18FwkdTOhMXenvyi6IMGii8KtF+Hq/KVveiPQc/SHUKIEGgmDlrd36BXP5nwi7Hs22 S/SjTpi174OIFTR83ov5wvj+2CTCjNgu5HS702SNDdWMox39MamXIPyRuPalzdWKI+qn Y3qBNljXHhQCi0hKtUtc9Li9m7pOTLjWP+2GQXHywuWlPshXp0frulIg9ZyHrVyTuRHG nm7g== X-Gm-Message-State: ACrzQf1txFn7u8bZIMcQYwfTKMhwWaOaNFrat7t3plB7My/wh3U6foLq hKiO5otVFxSNyYZ6zHvME0JgVPMCPt2QopiFtptvTHg5muSDqtdxse7G7nj6A+DfsZetWE4qZ5v jIxRnMeQwiO7Gj+mOh5k= X-Received: by 2002:a17:903:2307:b0:181:e618:b4c5 with SMTP id d7-20020a170903230700b00181e618b4c5mr41400680plh.172.1666776095946; Wed, 26 Oct 2022 02:21:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5w0BwvcKOnCiHCt9xbMu/r5WbnTP5qov96OTQeyAHbLt6hGhSoq8BLUzAO8GPEpWMLlf4ANMW3OAI9fO7L1ms= X-Received: by 2002:a17:903:2307:b0:181:e618:b4c5 with SMTP id d7-20020a170903230700b00181e618b4c5mr41400664plh.172.1666776095693; Wed, 26 Oct 2022 02:21:35 -0700 (PDT) MIME-Version: 1.0 References: <20220628144643.1213026-1-david.marchand@redhat.com> <20220914075841.51555-1-david.marchand@redhat.com> <20220914075841.51555-9-david.marchand@redhat.com> <98CBD80474FA8B44BF855DF32C47DC35D87442@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D87442@smartserver.smartshare.dk> From: David Marchand Date: Wed, 26 Oct 2022 11:21:24 +0200 Message-ID: Subject: Re: [PATCH v6 08/27] eal: deprecate RTE_FUNC_PTR_* macros To: =?UTF-8?Q?Morten_Br=C3=B8rup?= Cc: dev@dpdk.org, thomas@monjalon.net, bruce.richardson@intel.com, Ray Kinsella , Fan Zhang , Ashish Gupta , Qiming Yang , Wenjun Wu , Shijith Thotton , Srisivasubramanian Srinivasan , Rosen Xu , Tianfei zhang , Sachin Saxena , Hemant Agrawal , Akhil Goyal , Chengwen Feng , Kevin Laatz , Ferruh Yigit , Andrew Rybchenko , Abhinandan Gujjar , Jerin Jacob , Jay Jayatheerthan , Olivier Matz , Ori Kam , Maxime Coquelin , Chenbo Xia X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Wed, Oct 26, 2022 at 11:05 AM Morten Br=C3=B8rup wrote: > > > From: David Marchand [mailto:david.marchand@redhat.com] > > Sent: Wednesday, 14 September 2022 09.58 > > > > Those macros have no real value and are easily replaced with a simple > > if() block. > > > > Existing users have been converted using a new cocci script. > > Deprecate them. > > > > Signed-off-by: David Marchand > > --- > > [...] > > > /* Macros to check for invalid function pointers */ > > -#define RTE_FUNC_PTR_OR_ERR_RET(func, retval) do { \ > > +#define RTE_FUNC_PTR_OR_ERR_RET(func, retval) > > RTE_DEPRECATED(RTE_FUNC_PTR_OR_ERR_RET) \ > > +do { \ > > if ((func) =3D=3D NULL) \ > > return retval; \ > > } while (0) > > > > -#define RTE_FUNC_PTR_OR_RET(func) do { \ > > +#define RTE_FUNC_PTR_OR_RET(func) RTE_DEPRECATED(RTE_FUNC_PTR_OR_RET) > > \ > > +do { \ > > if ((func) =3D=3D NULL) \ > > return; \ > > } while (0) > > rte_ethdev.h has somewhat similar macros [1]: > > /* Macros to check for valid port */ > #define RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, retval) do { \ > if (!rte_eth_dev_is_valid_port(port_id)) { \ > RTE_ETHDEV_LOG(ERR, "Invalid port_id=3D%u\n", port_id); \ > return retval; \ > } \ > } while (0) > > #define RTE_ETH_VALID_PORTID_OR_RET(port_id) do { \ > if (!rte_eth_dev_is_valid_port(port_id)) { \ > RTE_ETHDEV_LOG(ERR, "Invalid port_id=3D%u\n", port_id); \ > return; \ > } \ > } while (0) > > However, these log an error message. It makes me wonder about consistency= ... > > Are the RTE_FUNC_PTR_OR_* macros a special case, or should similar macros= , such as RTE_ETH_VALID_PORTID_OR_*, also be deprecated? > > Or should the RTE_FUNC_PTR_OR_* macros be modified to log an error messag= e instead of being deprecated? The difference is that those ethdev macros validate something expressed in their name "is this portid valid". The RTE_FUNC_PTR_OR_* macros were really just a if() + return block. I don't see what message to log for them. --=20 David Marchand