From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 04 Jul 2016 08:22:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,575,1459839600"; d="scan'208";a="1010736152" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.220.53]) by orsmga002.jf.intel.com with SMTP; 04 Jul 2016 08:22:01 -0700 Received: by (sSMTP sendmail emulation); Mon, 04 Jul 2016 16:22:01 +0025 Date: Mon, 4 Jul 2016 16:22:00 +0100 From: Bruce Richardson To: Thomas Monjalon Cc: Neil Horman , dev@dpdk.org, Panu Matilainen 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 Content-Disposition: inline In-Reply-To: <1467594845-3487-1-git-send-email-thomas.monjalon@6wind.com> Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?= =?iso-8859-1?Q?opment?= Ireland Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v9 0/7] export PMD infos X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2016 15:22:05 -0000 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')