From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by dpdk.org (Postfix) with ESMTP id 676861B152 for ; Tue, 10 Jul 2018 15:07:05 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 27A5C671; Tue, 10 Jul 2018 09:07:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 10 Jul 2018 09:07:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=19fd5Nc06Lv2/L8ZiiPx9OYYCa ahIaXg20fbNMRj/jc=; b=RzPBuYpusjE8GMPbyGzMJDBiinEtLOjoVqdN7u3ahk XUyp/94EdqHVp1vrfiIS5uTRPYdzwt9zH3c2thU29AxTnfDLA1ZUrrwDunGL8z5B 1xBgkDjwVldZbTreSh0M91pzguH2Pn94Z7mLuSvnmIEr8zJAyJ0rzLFJGOFgULy7 U= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=19fd5N c06Lv2/L8ZiiPx9OYYCaahIaXg20fbNMRj/jc=; b=nCxDA8QDi49zHnMO34gaXT r3rf0twhTG0lp6Sc6Cw9kJya7mp/XRbQUXCbJ/WGwBD3+VH8lvYqtCvwsDAk3Tu7 rOhgmy6fAq0xfgPJD5PUWFVKp/0Qb4+rRTGlK7+qZ/oGH460GqwyYTBS7PDbsLUB OJXFiavAz+9f7/ApnAJjmqcqgF4N5HkPUVgb+cpD23umEYP9sNt2aeQn74Qkqe0J zvQ9j6XG8MISUMtUo5D0T8kTUs+iDExYFoa/alYN7ySm8uzJbSP0n9TxoXMDBeiQ gYuns2jAY5nP6njCCnSV6kt+CWhGP3uqmhqYTLCuhrBUN72uZBpfRzTjl3dpMc0A == X-ME-Proxy: X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id A45D2E490D; Tue, 10 Jul 2018 09:07:01 -0400 (EDT) From: Thomas Monjalon To: =?ISO-8859-1?Q?Ga=EBtan?= Rivet Cc: dev@dpdk.org, shreyansh.jain@nxp.com Date: Tue, 10 Jul 2018 15:06:59 +0200 Message-ID: <13825708.2VSpJNBVIU@xps> In-Reply-To: <20180710125625.4izywtqnex2rwdgf@bidouze.vm.6wind.com> References: <2903699.tLnOVabUjO@xps> <20180710125625.4izywtqnex2rwdgf@bidouze.vm.6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Subject: Re: [dpdk-dev] [PATCH v10 05/27] eal: introduce dtor macros X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2018 13:07:06 -0000 10/07/2018 14:56, Ga=EBtan Rivet: > Hi Thomas, >=20 > On Tue, Jul 10, 2018 at 01:40:01PM +0200, Thomas Monjalon wrote: > > 05/07/2018 13:48, Gaetan Rivet: > > > Signed-off-by: Gaetan Rivet > >=20 > > Please justify why you need destructors, by providing a commit log. > >=20 > > > --- a/lib/librte_eal/common/include/rte_common.h > > > +++ b/lib/librte_eal/common/include/rte_common.h > > > @@ -111,6 +111,29 @@ static void __attribute__((constructor(RTE_PRIO(= prio)), used)) func(void) > > > #define RTE_INIT(func) \ > > > RTE_INIT_PRIO(func, LAST) > > > =20 > > > +/** > > > + * Run after main() with low priority. > > > + * > > > + * @param func > > > + * Destructor function name. > > > + * @param prio > > > + * Priority number must be above 100. > > > + * Lowest number is the last to run. > > > + */ > > > +#define RTE_FINI_PRIO(func, prio) \ > > > +static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(v= oid) > >=20 > > I don't like the name of this macro. > > What about RTE_CLEAN_PRIO? > >=20 > >=20 >=20 > FINI is symmetrical to INIT in referencing the related ELF section. >=20 > RTE_CLEAN presumes that the intended purpose of the function will be to > cleanup resources. As far as we are concerned, this code could send a > signal, dump config info or format / (which would be a pretty advanced > cleanup, granted). >=20 > Sometimes, it could be used to release resources, presumably. >=20 > I'm not a fan of FINI either, but I appreciate the symmetry. > It's pretty neutral about what it does, as its meaning is literally > "The following function will be part of the .fini section". >=20 > Alternatives: >=20 > FINALIZE > UNINIT >=20 > But they have the same issue as RTE_CLEAN, IMO. OK, you convinced me. And I remember now that you already convinced me earlier with the same argument :) Acked-by: Thomas Monjalon