[dpdk-dev] [PATCH v9 0/7] export PMD infos

Bruce Richardson bruce.richardson at intel.com
Mon Jul 4 17:22:00 CEST 2016


On Mon, Jul 04, 2016 at 03:13:58AM +0200, Thomas Monjalon wrote:
> This is a respin of the series from Neil.
> It was planned to be integrated in 16.07-rc1 but the discovered issues
> make a new revision needed.
> There are still few things which could be improved but it is not mandatory
> to fix them for an integration in 16.07-rc2:
>   - fix make clean after pmdinfogen
>   - build installable pmdinfogen for target
>   - convert pmdinfo.py to Python 3
>   - document dependency pyelftools
> 
> Changes done in this v9:
>   - fix build dependency of drivers on pmdinfogen
>   - fix build of mlx4, mlx5, aesni
>   - fix new drivers bnxt, thunderx, kasumi
>   - fix MAINTAINERS file
>   - fix coding style in pmdinfogen
>   - add compiler checks for pmdinfogen
>   - remove useless functions in pmdinfogen
>   - fail build if pmdinfogen fails (set -e)
>   - fix verbose pmdinfogen run
>   - build pmdinfogen in buildtools directory (was app)
>   - install pmdinfogen in sdk package (was runtime)
>   - fix CamelCase in pmdinfo.py
>   - prefix executables with dpdk-
>   - rename PMD_REGISTER_DRIVER -> RTE_REGISTER_DRIVER
>   - separate commit for hostapp.mk refresh
>   - remove useless hostlib.mk
>   - spread doc in appropriate patches
> 
> Please review carefully.
> 
Haven't reviewed, but did test applying these patches on FreeBSD to see what
happens there. Compilation works fine after applying all patches, and when I
run: 
	strings testpmd | grep PMD_INFO_STRING

I get the appropriate metadata output of device ids etc. that shows that the
data is getting written into the static binaries ok.

For a shared library, rather than static build, there was a problem building
with clang - probably unrelated to this set, I haven't checked yet - but a
gcc shared build worked fine. Checking testpmd showed zero PMD_INFO strings
as expected, and librte_pmd_ixgbe.so showed two, again as expected.

For the script in the tools directory, the first problem is that python is
not to be found in "/usr/bin/python" as on Linux. To make it run on FreeBSD,
this should be changed to "/usr/bin/env python", as in dpdk_config.py.
For the "pyelftools" dependency, on FreeBSD, this is available in ports as
"py-pyelftools" and it installed ok for me. The final issue was the hard-coded
path to the pci-ids in /usr/share/hwdata. Patch to fix these script issues is
below.

Regards,
/Bruce

diff --git a/tools/dpdk-pmdinfo.py b/tools/dpdk-pmdinfo.py
index b8a9be2..8d19b90 100755
--- a/tools/dpdk-pmdinfo.py
+++ b/tools/dpdk-pmdinfo.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # -------------------------------------------------------------------------
 #
 # Utility to dump PMD_INFO_STRING support from an object file
@@ -9,6 +9,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.
@@ -556,6 +557,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",
@@ -567,7 +576,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')





More information about the dev mailing list