pmdinfo: check for pci.ids in /usr/share/misc

Message ID 20200312163027.20760-1-luca.boccassi@gmail.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series pmdinfo: check for pci.ids in /usr/share/misc |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS
ci/iol-intel-Performance fail Performance Testing issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed

Commit Message

Luca Boccassi March 12, 2020, 4:30 p.m. UTC
  From: Luca Boccassi <luca.boccassi@microsoft.com>

Debian and Ubuntu switched years ago from /usr/share/hwdata to /usr/share/misc,
and the former is just a compat symlink now.
We are starting to get bug reports to nudge us into changing.
So check the new path first, and the old one as a fallback.

Cc: stable@dpdk.org

Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
---
 usertools/dpdk-pmdinfo.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

David Marchand March 19, 2020, 2:47 p.m. UTC | #1
On Thu, Mar 12, 2020 at 5:30 PM <luca.boccassi@gmail.com> wrote:
>
> From: Luca Boccassi <luca.boccassi@microsoft.com>
>
> Debian and Ubuntu switched years ago from /usr/share/hwdata to /usr/share/misc,
> and the former is just a compat symlink now.
> We are starting to get bug reports to nudge us into changing.
> So check the new path first, and the old one as a fallback.
>
> Cc: stable@dpdk.org
>
> Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
> ---
>  usertools/dpdk-pmdinfo.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/usertools/dpdk-pmdinfo.py b/usertools/dpdk-pmdinfo.py
> index 9d5c6369a0..12f20735e0 100755
> --- a/usertools/dpdk-pmdinfo.py
> +++ b/usertools/dpdk-pmdinfo.py
> @@ -561,7 +561,10 @@ def main(stream=None):
>
>      pcifile_default = "./pci.ids"  # For unknown OS's assume local file
>      if platform.system() == 'Linux':
> -        pcifile_default = "/usr/share/hwdata/pci.ids"
> +        # hwdata is the legacy location, misc is supported going forward
> +        pcifile_default = "/usr/share/misc/pci.ids"
> +        if not os.path.exists(pcifile_default):
> +            pcifile_default = "/usr/share/hwdata/pci.ids"
>      elif platform.system() == 'FreeBSD':
>          pcifile_default = "/usr/local/share/pciids/pci.ids"
>          if not os.path.exists(pcifile_default):
> --
> 2.20.1
>

LGTM.
Acked-by: David Marchand <david.marchand@redhat.com>
  
David Marchand April 25, 2020, 8:11 p.m. UTC | #2
On Thu, Mar 12, 2020 at 5:30 PM <luca.boccassi@gmail.com> wrote:
>
> From: Luca Boccassi <luca.boccassi@microsoft.com>
>
> Debian and Ubuntu switched years ago from /usr/share/hwdata to /usr/share/misc,
> and the former is just a compat symlink now.
> We are starting to get bug reports to nudge us into changing.
> So check the new path first, and the old one as a fallback.
>
> Cc: stable@dpdk.org
>
> Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>

Acked-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.
  

Patch

diff --git a/usertools/dpdk-pmdinfo.py b/usertools/dpdk-pmdinfo.py
index 9d5c6369a0..12f20735e0 100755
--- a/usertools/dpdk-pmdinfo.py
+++ b/usertools/dpdk-pmdinfo.py
@@ -561,7 +561,10 @@  def main(stream=None):
 
     pcifile_default = "./pci.ids"  # For unknown OS's assume local file
     if platform.system() == 'Linux':
-        pcifile_default = "/usr/share/hwdata/pci.ids"
+        # hwdata is the legacy location, misc is supported going forward
+        pcifile_default = "/usr/share/misc/pci.ids"
+        if not os.path.exists(pcifile_default):
+            pcifile_default = "/usr/share/hwdata/pci.ids"
     elif platform.system() == 'FreeBSD':
         pcifile_default = "/usr/local/share/pciids/pci.ids"
         if not os.path.exists(pcifile_default):