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 7B386A00C2; Wed, 17 Mar 2021 09:41:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D9FB4242BB8; Wed, 17 Mar 2021 09:41:08 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id BA3E1242B9F for ; Wed, 17 Mar 2021 09:41:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615970467; 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: in-reply-to:in-reply-to:references:references; bh=hG3CrPvMYqkVYA5FBd/Lu749hMz8VTyr8faNLOexkYs=; b=QmAKRLv2KK94SudXGqJmNSQk6Is55FR7iHvYD85ceqwf8WrnzKADpIKMbg2HnCaItUq7lA d4Ly0R2p8lfbzIx6ARzlTjkmbJUlfjrCktvuOSzJVMuZMmxdmnq+FS9CgAH5YcC78Nu1Er 2iVFxu0bhpKEZgYdJ79eEzn+z4P7v1Q= Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-484-t4HJrLoSNESRagCQv3v4bw-1; Wed, 17 Mar 2021 04:41:04 -0400 X-MC-Unique: t4HJrLoSNESRagCQv3v4bw-1 Received: by mail-vs1-f71.google.com with SMTP id x142so10114601vsc.12 for ; Wed, 17 Mar 2021 01:41:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hG3CrPvMYqkVYA5FBd/Lu749hMz8VTyr8faNLOexkYs=; b=n4GWwQVPVIVr7tjeSk8PCHvMbJWlkERR3/zaDhjAqog+NI0miTh4q1M/Y8HweBv346 hy5lBM1AX75ER4tg+L3XeP4DjBcgcQikh2WXD2L1ottAPV20gfr8GC+vJEbqmKHVcU2n o/QG0OHyKYkLSIwxBvKLuZnSk3hMeGABEP2jJ7nA0t1tLxRZgn8MKDkuKrgQk+3x42g4 4U8ZXOavcIm378nz/huT0g6FP9he8+Celt9YOsDnfbIri+HH2kUyKeFrGuLm6VotMcXs Zzfjj0y8SlvdWzIiOaLMbNjqemrvKbTyblgxnqxwDfnl5QXCXGeT/aseq201IgxKNd9z tCAQ== X-Gm-Message-State: AOAM531oiCjqcjaoP6hbnBgJNlafBZ3VIlffAmkNzNAnMjWTAnhQvlYo cGmWe99G35cDKfsw6ibkkQgKRCiyZn6c2yF9OR5t80tA2qNFK/C0ZU59Ns0O5UfVt6LSTdlhnae zAM4jTYaOlA08u3aZyRg= X-Received: by 2002:a9f:3591:: with SMTP id t17mr1775307uad.41.1615970464161; Wed, 17 Mar 2021 01:41:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzTX/igVsu6m7QSZ9nTG/TgCO+cH4QJprthcWNrv2sPlwvaf2ls1NzsDqsoiTh2NtB//pBDHa/xrcK+QRjLOA= X-Received: by 2002:a9f:3591:: with SMTP id t17mr1775300uad.41.1615970463917; Wed, 17 Mar 2021 01:41:03 -0700 (PDT) MIME-Version: 1.0 References: <20210205193933.410011-1-bruce.richardson@intel.com> <20210216151329.290332-1-bruce.richardson@intel.com> In-Reply-To: <20210216151329.290332-1-bruce.richardson@intel.com> From: David Marchand Date: Wed, 17 Mar 2021 09:40:52 +0100 Message-ID: To: Bruce Richardson , Thomas Monjalon Cc: dev , Ray Kinsella , Kevin Laatz , dpdk stable Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] eal: fix querying DPDK version at runtime 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" On Tue, Feb 16, 2021 at 4:13 PM Bruce Richardson wrote: > > For using a DPDK application, such as OVS, which is dynamically linked, the > DPDK version in use should always report the actual version, not the > version used at build time. This incorrect behaviour can be seen by > building OVS against one version of DPDK and running it against a later > one. Using "ovs-vsctl list Open_vSwitch" to query basic info, the > dpdk_version returned will be the build version not the currently running > one - which can be verified using the DPDK telemetry library client. > > $ sudo ovs-vsctl list Open_vSwitch | grep dpdk_version > dpdk_version : "DPDK 20.11.0-rc4" > > $ echo quit | sudo dpdk-telemetry.py > Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2 > {"version": "DPDK 21.02.0-rc2", "pid": 405659, "max_output_len": 16384} > --> > > To fix this, we need to convert the rte_version() function, and any other > necessary parts of the rte_version.h, to be actual functions in EAL, not > just inlines/macros. The only complication in doing so is that telemetry > library cannot call rte_version() directly, and instead needs the version > string passed in on init. > > Fixes: af75078fece3 ("first public release") > Cc: stable@dpdk.org > diff --git a/lib/librte_eal/include/rte_version.h b/lib/librte_eal/include/rte_version.h > index f7a3a1ebc..2f3f727b4 100644 > --- a/lib/librte_eal/include/rte_version.h > +++ b/lib/librte_eal/include/rte_version.h > @@ -28,38 +28,47 @@ extern "C" { > * All version numbers in one to compare with RTE_VERSION_NUM() > */ > #define RTE_VERSION RTE_VERSION_NUM( \ > - RTE_VER_YEAR, \ > - RTE_VER_MONTH, \ > - RTE_VER_MINOR, \ > - RTE_VER_RELEASE) > + rte_version_year(), \ > + rte_version_month(), \ > + rte_version_minor(), \ > + rte_version_release()) It breaks SPDK and applications relying on RTE_VERSION in preprocessor directives. RTE_VERSION* macros should be left alone, and applications that need the runtime value should call rte_version(). See logs in https://lab.dpdk.org/results/dashboard/results/results-uploads/test_runs/2f636aaf4ce244eba20844f9ff006033/log_upload_file/2021/3/dpdk_6857cb635821_2021-03-17_06-34-34_NA.zip CC lib/env_dpdk/pci_virtio.o CC lib/env_dpdk/pci_vmd.o CC lib/env_dpdk/pci_idxd.o In file included from env_internal.h:42:0, from pci_vmd.c:34: /dpdk/build/include/rte_version.h:31:20: error: missing binary operator before token "(" rte_version_year(), \ ^ /dpdk/build/include/rte_version.h:25:36: note: in definition of macro 'RTE_VERSION_NUM' #define RTE_VERSION_NUM(a,b,c,d) ((a) << 24 | (b) << 16 | (c) << 8 | (d)) ^ env_internal.h:49:5: note: in expansion of macro 'RTE_VERSION' #if RTE_VERSION < RTE_VERSION_NUM(19, 11, 0, 0) ^~~~~~~~~~~ In file included from env_internal.h:42:0, from pci.c:34: /dpdk/build/include/rte_version.h:31:20: error: missing binary operator before token "(" rte_version_year(), \ ^ -- David Marchand