From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH v9 0/7] export PMD infos Date: Mon, 4 Jul 2016 16:22:00 +0100 Message-ID: <20160704152200.GA24556@bricha3-MOBL3> References: <1466189185-21952-1-git-send-email-nhorman@tuxdriver.com> <1467594845-3487-1-git-send-email-thomas.monjalon@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Neil Horman , dev@dpdk.org, Panu Matilainen To: Thomas Monjalon Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id EFC26FE5 for ; Mon, 4 Jul 2016 17:22:04 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1467594845-3487-1-git-send-email-thomas.monjalon@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 ', 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')