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 BF2D6A00C2 for ; Wed, 17 Mar 2021 09:41:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF655242B9A; 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 A576A242B9A 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-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-570-XvDpCLihOkS1zDqMrGKApw-1; Wed, 17 Mar 2021 04:41:04 -0400 X-MC-Unique: XvDpCLihOkS1zDqMrGKApw-1 Received: by mail-vs1-f69.google.com with SMTP id g21so1977364vso.20 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=dXyGL3krR27QWtJyzMSm7xHc4KZ2NiJxaY5dYX8BpHJH0Y9esUiz9qjPOopj1zM8oZ Ptydl+jKx4tx0ZJ74x272B47BkjY+2rxS0cMcIUsAYya3xG4FKHNfoawlQT28830bqqW z4SugdHP8OYlxXKNvARNVryiHiGWSYtAa5e2JC0A6WPz6lzmXKNDF+CQcp9c1GYLPsuX xH7T2bZwfnvr8KCG973fq3+oZp4PFQuH118zkKgYf3YJiJ7Mb8u4Umtlr8kWXI/YNfDu uvjFSQDmYxOV/c/e3uqbyrxvDzOoMUSCLtn0i3obn5wIYS1RGSXv9Ls6yPjyd7HiB8CG ottA== X-Gm-Message-State: AOAM532OcAM8C8/NXj/0HFhJ07BhrDcToAYnvWAEKVa79kNxzbE5X7Vb hGMQlw+MTKSZsEwvUGZRUbbPsK5MSyUacYne1N/5xeA9CVFdytt6O141YbE5+q8U1rbrCzF3b6t /vZ6Cd8bcnyw2depTvnJ0YdU= X-Received: by 2002:a9f:3591:: with SMTP id t17mr1775306uad.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-stable] [PATCH v2] eal: fix querying DPDK version at runtime X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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