All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] enable pmdinfo support on FreeBSD
@ 2016-07-08 20:37 Bruce Richardson
  2016-07-08 20:37 ` [PATCH 1/2] pmdinfogen: fix build " Bruce Richardson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bruce Richardson @ 2016-07-08 20:37 UTC (permalink / raw)
  To: dev; +Cc: thomas.monjalon, Bruce Richardson

This patchset fixes pmdinfogen and pmdinfo.py so that they can work on
FreeBSD. It's been tested with static binaries compiled using clang and gcc
on FreeBSD, as well as gcc-generated dynamic libraries. For some reason
clang wasn't able to build dynamic libraries for DPDK on FreeBSD so that is
untested. [Investigation of that issue is for another time]

Bruce Richardson (2):
  pmdinfogen: fix build on FreeBSD
  scripts: fix pmdinfo for FreeBSD

 buildtools/pmdinfogen/pmdinfogen.c |  2 ++
 tools/pmdinfo.py                   | 13 +++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] pmdinfogen: fix build on FreeBSD
  2016-07-08 20:37 [PATCH 0/2] enable pmdinfo support on FreeBSD Bruce Richardson
@ 2016-07-08 20:37 ` Bruce Richardson
  2016-07-08 20:37 ` [PATCH 2/2] scripts: fix pmdinfo for FreeBSD Bruce Richardson
  2016-07-09 21:57 ` [PATCH 0/2] enable pmdinfo support on FreeBSD Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Bruce Richardson @ 2016-07-08 20:37 UTC (permalink / raw)
  To: dev; +Cc: thomas.monjalon, Bruce Richardson

error on compilation caused by missing include for libgen.h.
  HOSTCC pmdinfogen.o
/usr/home/bruce/dpdk/buildtools/pmdinfogen/pmdinfogen.c:402:4: error: implicit declaration of function 'basename' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
                        basename(argv[0]));

Fixes: 840e5dfea3f8 ("pmdinfogen: fix usage message")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/pmdinfogen/pmdinfogen.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/buildtools/pmdinfogen/pmdinfogen.c b/buildtools/pmdinfogen/pmdinfogen.c
index 717c8d4..e1bf2e4 100644
--- a/buildtools/pmdinfogen/pmdinfogen.c
+++ b/buildtools/pmdinfogen/pmdinfogen.c
@@ -15,6 +15,8 @@
 #include <limits.h>
 #include <stdbool.h>
 #include <errno.h>
+#include <libgen.h>
+
 #include <rte_common.h>
 #include "pmdinfogen.h"
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] scripts: fix pmdinfo for FreeBSD
  2016-07-08 20:37 [PATCH 0/2] enable pmdinfo support on FreeBSD Bruce Richardson
  2016-07-08 20:37 ` [PATCH 1/2] pmdinfogen: fix build " Bruce Richardson
@ 2016-07-08 20:37 ` Bruce Richardson
  2016-07-09 21:57 ` [PATCH 0/2] enable pmdinfo support on FreeBSD Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Bruce Richardson @ 2016-07-08 20:37 UTC (permalink / raw)
  To: dev; +Cc: thomas.monjalon, Bruce Richardson

There were a couple of issues which prevented pmdinfo.py from running on
FreeBSD, both of which are fixed by this patch.

* The path to python is not /usr/bin/python as on Linux, so use
  /usr/bin/env to find it on both OS's.
* The path to the pci ids DB is in a different location on FreeBSD,
  so use the platform python library to look in different default
  locations depending on the underlying OS. [There are two possible
  locations to look on FreeBSD, as defined by pciconf manpage, so
  check in both in order of better to worse]

Fixes: c67c9a5c646a ("tools: query binaries for HW and other support information")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 tools/pmdinfo.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/tools/pmdinfo.py b/tools/pmdinfo.py
index e531154..662034a 100755
--- a/tools/pmdinfo.py
+++ b/tools/pmdinfo.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # -------------------------------------------------------------------------
 # scripts/pmdinfo.py
 #
@@ -10,6 +10,7 @@ import sys
 from optparse import OptionParser
 import string
 import json
+import platform
 
 # For running from development directory. It should take precedence over the
 # installed pyelftools.
@@ -557,6 +558,14 @@ def main(stream=None):
     global raw_output
     global pcidb
 
+    pcifile_default = "./pci.ids" # for unknown OS's assume local file
+    if platform.system() == 'Linux':
+        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):
+            pcifile_default = "/usr/share/misc/pci_vendors"
+
     optparser = OptionParser(
         usage='usage: %prog [-hrtp] [-d <pci id file] <elf-file>',
         description="Dump pmd hardware support info",
@@ -568,7 +577,7 @@ def main(stream=None):
     optparser.add_option("-d", "--pcidb", dest="pcifile",
                          help="specify a pci database "
                               "to get vendor names from",
-                         default="/usr/share/hwdata/pci.ids", metavar="FILE")
+                         default=pcifile_default, metavar="FILE")
     optparser.add_option("-t", "--table", dest="tblout",
                          help="output information on hw support as a hex table",
                          action='store_true')
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] enable pmdinfo support on FreeBSD
  2016-07-08 20:37 [PATCH 0/2] enable pmdinfo support on FreeBSD Bruce Richardson
  2016-07-08 20:37 ` [PATCH 1/2] pmdinfogen: fix build " Bruce Richardson
  2016-07-08 20:37 ` [PATCH 2/2] scripts: fix pmdinfo for FreeBSD Bruce Richardson
@ 2016-07-09 21:57 ` Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2016-07-09 21:57 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

2016-07-08 21:37, Bruce Richardson:
> This patchset fixes pmdinfogen and pmdinfo.py so that they can work on
> FreeBSD. It's been tested with static binaries compiled using clang and gcc
> on FreeBSD, as well as gcc-generated dynamic libraries. For some reason
> clang wasn't able to build dynamic libraries for DPDK on FreeBSD so that is
> untested. [Investigation of that issue is for another time]
> 
> Bruce Richardson (2):
>   pmdinfogen: fix build on FreeBSD
>   scripts: fix pmdinfo for FreeBSD

Applied, thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-09 21:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-08 20:37 [PATCH 0/2] enable pmdinfo support on FreeBSD Bruce Richardson
2016-07-08 20:37 ` [PATCH 1/2] pmdinfogen: fix build " Bruce Richardson
2016-07-08 20:37 ` [PATCH 2/2] scripts: fix pmdinfo for FreeBSD Bruce Richardson
2016-07-09 21:57 ` [PATCH 0/2] enable pmdinfo support on FreeBSD Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.