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 65118A00C2; Wed, 17 Mar 2021 11:01:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0122140F5C; Wed, 17 Mar 2021 11:01:29 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id 9A071140F5B; Wed, 17 Mar 2021 11:01:28 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 20EE95C009F; Wed, 17 Mar 2021 06:01:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 17 Mar 2021 06:01:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm3; bh= +SOBroLlvk+EADz5rXEihTSug8QIF5AstbmBTrelHGs=; b=mUxlewJmol9+0qL+ S5Khewuit6wXawz6GQPzWS1Mkt9zsmdrinPLm3Cc0shZrTlkWjFej9mrE2DXrjEO c7wE2XN5jHgAuk4IfSk/29zKHT58P+RpJ85NkZAdR/HHulgQ8HsZn/CM5EAz9Se4 E6lx+7LSmqh3UfQL3OI1cp9QCYkwkYtWd5sbMo4BZg97qofzlWuA7F8o2GNiYhyJ SXR5O2LrUxJV66cViVvFjVScwsn3+tUhe37qXnMh16tZKEp6QbVqV5tpdv4cseXI LiEgeqAvPkJ0DOHiSxresFxQVGE9tXmPwQ0x99ZmlFpIVouxnM9R2q2yhCJdaO++ 0HU3mA== 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-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=+SOBroLlvk+EADz5rXEihTSug8QIF5AstbmBTrelH Gs=; b=oyDATwQYFfHgsQyl1t0PFBb2mXxu/TNc5d126NITCSJqQTe4+qpj+bYNv d0cszLfcsMFaQQpMiWbnOu5XEW7E8A9mAgCSpLAF11h7lltnmB2ysrWC6xedNXRJ ffDS5Y2/5Tu8+IaOsTWRhgnADx7b20YwdEpjDLfpTMeCSYuDKH7ls8o9GX94PPEX 2F1YTaCRDM0dPgxOWWoe78fncjOyIb6ZgMFqiKXrdVwZIIWJw/o5ZRSdRm+0R31o ARAHklU4EZa0hCTY/7IrZXcQLOSCB9j74f3P0bT0V94nbj/4CY0pNIZqBOeBt9FM F7Szncf2orC1fzTbi6z0KkO+vbyuA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefgedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id D1EA01080064; Wed, 17 Mar 2021 06:01:26 -0400 (EDT) From: Thomas Monjalon To: David Marchand Cc: dev , dpdk stable , Bruce Richardson Date: Wed, 17 Mar 2021 11:01:25 +0100 Message-ID: <10994121.sJyVhAAg4N@thomas> In-Reply-To: References: <20210317093124.965624-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] eal: fix version macro 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 Sender: "dev" 17/03/2021 10:48, David Marchand: > On Wed, Mar 17, 2021 at 10:31 AM Thomas Monjalon wrote: > > > > The macro RTE_VERSION is broken since updated with function calls. > > It is a build-time version number, and must be built with macros. > > For a run-time version number, there is the function rte_version(). > > > > Fixes: 5b637a848195 ("eal: fix querying DPDK version at runtime") > > Cc: stable@dpdk.org > > > > Reported-by: David Marchand > > Signed-off-by: Thomas Monjalon > > --- > > lib/librte_eal/include/rte_version.h | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/lib/librte_eal/include/rte_version.h b/lib/librte_eal/include/rte_version.h > > index 2f3f727b46..736c5703be 100644 > > --- a/lib/librte_eal/include/rte_version.h > > +++ b/lib/librte_eal/include/rte_version.h > > @@ -28,10 +28,10 @@ extern "C" { > > * All version numbers in one to compare with RTE_VERSION_NUM() > > */ > > #define RTE_VERSION RTE_VERSION_NUM( \ > > - rte_version_year(), \ > > - rte_version_month(), \ > > - rte_version_minor(), \ > > - rte_version_release()) > > + RTE_VER_YEAR, \ > > + RTE_VER_MONTH, \ > > + RTE_VER_MINOR, \ > > + RTE_VER_RELEASE) > > > > /** > > * Function to return DPDK version prefix string > > The original patch wanted to fix rte_version() at runtime. > I don't see the need to keep the rte_version_XXX exports now that > RTE_VERSION is reverted. I think it may help to query the version numbers at runtime, in "if" condition. Is there another way I'm missing? We may argue that the runtime version number should not be used to decide how to behave in an application.