From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id AC04695D0 for ; Thu, 19 May 2016 11:02:30 +0200 (CEST) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD588B537B; Thu, 19 May 2016 09:02:29 +0000 (UTC) Received: from sopuli.koti.laiskiainen.org (vpn1-5-221.ams2.redhat.com [10.36.5.221]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4J92R8w027840; Thu, 19 May 2016 05:02:28 -0400 To: Neil Horman , dev@dpdk.org References: <1463431287-4551-1-git-send-email-nhorman@tuxdriver.com> <1463605687-649-1-git-send-email-nhorman@tuxdriver.com> <1463605687-649-5-git-send-email-nhorman@tuxdriver.com> Cc: Bruce Richardson , Thomas Monjalon , Stephen Hemminger From: Panu Matilainen Message-ID: Date: Thu, 19 May 2016 12:02:27 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <1463605687-649-5-git-send-email-nhorman@tuxdriver.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 19 May 2016 09:02:30 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCHv2 4/4] pmdinfo.py: Add tool to query binaries for hw and other support information 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: Thu, 19 May 2016 09:02:31 -0000 On 05/19/2016 12:08 AM, Neil Horman wrote: > This tool searches for the primer sting PMD_DRIVER_INFO= in any ELF binary, > and, if found parses the remainder of the string as a json encoded string, > outputting the results in either a human readable or raw, script parseable > format > > Note that, in the case of dynamically linked applications, pmdinfo.py will scan > for implicitly linked PMDs by searching the specified binaries .dynamic section > for DT_NEEDED entries that contain the substring librte_pmd. The DT_RUNPATH, > LD_LIBRARY_PATH, /usr/lib and /lib are searched for these libraries, in that > order Scanning /usr/lib and /lib does little good on systems where /usr/lib64 and /lib64 are the standard path, such as x86_64 Fedora / RHEL and derivates. With the path changed (or LD_LIBRARY_PATH set manually), I can confirm it works for a shared binary which is --whole-archive linked to all of DPDK such as ovs-vswitchd currently is (because it needs to for static DPDK linkage and is not aware of plugin autoloading). It doesn't help testpmd though because its not linked with --whole-archive in the shared case, so its not working for the main DPDK executable... In any case, using --whole-archive is a sledgehammer solution at best, and against the spirit of shared libs and plugins in particular. I think the shared linkage case can be solved by exporting the PMD path from librte_eal (either through an elf section or c-level symbol) and teach the script to detect the case of an executable dynamically linked to librte_eal, fish the path from there and then process everything in that path. > > If a file is specified with no path, it is assumed to be a PMD DSO, and the > LD_LIBRARY_PATH, /usr/lib/ and /lib is searched for it Same as above, /usr/lib/ and /lib is incorrect for a large number of systems. > > Currently the tool can output data in 3 formats: > > a) raw, suitable for scripting, where the raw JSON strings are dumped out > b) table format (default) where hex pci ids are dumped in a table format > c) pretty, where a user supplied pci.ids file is used to print out vendor and > device strings c) is a nice addition. Would be even nicer if it knew the most common pci.ids locations so it doesn't need extra arguments in those cases, ie see if /usr/share/hwdata/pci.ids or /usr/share/misc/pci.ids exists and use that unless overridden on the cli. - Panu -