From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id C4A602617 for ; Wed, 4 May 2016 23:16:44 +0200 (CEST) Received: by mail-wm0-f47.google.com with SMTP id n129so205227168wmn.1 for ; Wed, 04 May 2016 14:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=RmSQYYi5cEwqGjogkEOAbpaLYNS0yhsUv9Jvpw5byok=; b=uw3bh/ucryk8hYmvg0lGUfucIDsUFm6kPt8FuDsu7UbplQ7cGgJ/F6nFZ0KhUusulf WXkd9wpmfkgsvGiO9PHdEqJ+QOnkVRVzixWeetYgVrRjkV9ZqN3R3yvFhjiVENNKdKM5 uErLxwhrPd+4rejbNrNyae6XSlavBknYFllzth1/b/z4SMlkx2HaY4f+c39Hjv0w7in6 jz61VN0e2UExpRG3VyfHNFDDWcD/okSDk8QXfNOSuORnOwJIVnonhFTr1QnavoTphxJq WYjb2jvy+t9IARRmB6GrVBBvyv0VB3IZLWm4wLcvj5kK179WwWOkSLaPJH3kDvmqXktf rRiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding; bh=RmSQYYi5cEwqGjogkEOAbpaLYNS0yhsUv9Jvpw5byok=; b=hQIsib2JXD9oLQEDqgslsPlc4ia8tXE3eWhdEs3qr73WAb8XY1NogSkIv7emc2+/48 Xr1NzZW0eCwcrs9F8XnH4B/BD3KHqmGTGPjpoT6tTPdRKz9mJ9WSUocb9nNhNmKFjm5+ UzHVD64x0wafUHPx5nZIOLNU2UAj25sI99v+bcmnTcslhcdCLRNE18FU1xw70UVktsRp 7RCOeFcPYwMzJ0FdUULUFB8KNnnGiz5WliGzS2eYVpBtRYkdQbgq1XkLMr0+DfN209lq KoSQvEbynsbb7xVc78IjagV7GRpaaUnn58INn24Xvx482mmweChJUqxBlB1KeLCdT8hc evQw== X-Gm-Message-State: AOPr4FWI/I4T3CaGLG6I1EOrww3cSzCGasRrE5Dy1ME/ropVOgBdTZ1RMDJv4EknrngCfwui X-Received: by 10.28.16.136 with SMTP id 130mr11398207wmq.23.1462396604604; Wed, 04 May 2016 14:16:44 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id i3sm6244229wjx.30.2016.05.04.14.16.43 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 May 2016 14:16:43 -0700 (PDT) From: Thomas Monjalon To: Neil Horman , dev@dpdk.org Cc: David Marchand , Stephen Hemminger , "Richardson, Bruce" , Panu Matilainen Date: Wed, 04 May 2016 23:16:42 +0200 Message-ID: <2684085.G5NnXQEQ33@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <20160504114305.GA27687@hmsreliant.think-freely.org> References: <1461692391-30093-1-git-send-email-nhorman@tuxdriver.com> <20160504114305.GA27687@hmsreliant.think-freely.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [RFC PATCH 0/4]: Implement module information export 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: Wed, 04 May 2016 21:16:44 -0000 This discussion requires more opinions. Please everybody, READ and COMMENT. Thanks If it is not enough visible, a new thread could be started later. 2016-05-04 07:43, Neil Horman: > On Wed, May 04, 2016 at 10:24:18AM +0200, David Marchand wrote: > > On Tue, May 3, 2016 at 1:57 PM, Neil Horman wrote: > > >> This approach has a few pros and cons: > > >> > > >> pros: > > >> 1) Its simple, and doesn't require extra infrastructure to implement. E.g. we > > >> don't need a new tool to extract driver information and emit the C code to build > > >> the binary data for the special section, nor do we need a custom linker script > > >> to link said special section in place > > >> > > >> 2) Its stable. Because the marker symbols are explicitly exported, this > > >> approach is resilient against stripping. It is a good point. We need something resilient against stripping. > > >> cons: > > >> 1) It creates an artifact in that PMD_REGISTER_DRIVER has to be used in one > > >> compilation unit per DSO. As an example em and igb effectively merge two > > >> drivers into one DSO, and the uses of PMD_REGISTER_DRIVER occur in two separate > > >> C files for the same single linked DSO. Because of the use of the __COUNTER__ > > >> macro we get multiple definitions of the same marker symbols. > > >> > > >> I would make the argument that the downside of the above artifact isn't that big > > >> a deal. Traditionally in other projects a unit like a module (or DSO in our > > >> case) only ever codifies a single driver (e.g. module_init() in the linux kernel > > >> is only ever used once per built module). If we have code like igb/em that > > >> shares some core code, we should build the shared code to object files and link > > >> them twice, once to an em.so pmd and again to an igb.so pmd. It is also a problem for compilation units having PF and VF drivers. > > >> But regardless, I thought I would propose this to see what you all thought of > > >> it. Thanks for proposing. > > - This implementation does not support binaries, so it is not suitable > > for people who don't want dso, this is partially why I used bfd rather > > than just dlopen. > > If you're statically linking an application, you should know what hardware you > support already. Its going to be very hard, if not impossible to develop a > robust solution that works with static binaries (the prior solutions don't work > consistently with static binaries either). I really think the static solution > needs to just be built into the application (i.e. the application needs to add a > command line option to dump out the pci id's that are registered). No, we need a tool to know what are the supported devices before running the application (e.g. for binding). This tool should not behave differently depending of how DPDK was compiled (static or shared). [...] > > - How does it behave if we strip the dsos ? > > I described this above, its invariant to stripping, because the symbols for each > pmd are explicitly exported, so strip doesn't touch the symbols that pmdinfo > keys off of. > [...] > > - The tool output format is not script friendly from my pov. > > Don't think it really needs to be script friendly, it was meant to provide human > readable output, but script friendly output can be added easily enough if you > want. Yes it needs to be script friendly. It appears that we must agree on a set of requirements first. Please let's forget the implementation until we have collected enough feedbacks on the needs. I suggest these items to start the list: - query all drivers in static binary or shared library - stripping resiliency - human friendly - script friendly - show driver name - list supported device id / name - list driver options - show driver version if available - show dpdk version - show kernel dependencies (vfio/uio_pci_generic/etc) - room for extra information? Please ack or comment items of this list, thanks.