From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A0E94A046B for ; Mon, 22 Jul 2019 19:20:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6FA9C1BEB2; Mon, 22 Jul 2019 19:20:42 +0200 (CEST) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by dpdk.org (Postfix) with ESMTP id 878771BE4D for ; Mon, 22 Jul 2019 19:20:41 +0200 (CEST) Received: by mail-pl1-f194.google.com with SMTP id c2so19439156plz.13 for ; Mon, 22 Jul 2019 10:20:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cPudWtuSamv60r11nWLMjYpEo7EnFy7gqCCooYOVPYM=; b=G7zcnLF/p7ZorS6O63MUAFY0BqEeRd9wJTmoA6Hn2UoMymuTG+BwnIf3meDVjHdn/9 sBYO2T28EKWxvk/ckWYLXNgiz8byQ00Solp/x3q8Ql6b3wNRzq6sXwxoAAV4GgC8U38l bUQMxqgBRcOXPVujAlMu9msDT7scjr4ZRv90ebWKI2oFD27frxcjtW/uqGKKEF0TnkP7 hY2/dgyYeGjMd587WueqQxWlPvT0ZIav2XnMZim54N24P2evhM7AM6LvJhEo9R2M2xIy g+lZue7jUu3XpzhsKMCoRaCQ9NTA5t0gyOtCFtIfUwfegdG/5uv9g7QNDEqwXezx3u5D LsRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cPudWtuSamv60r11nWLMjYpEo7EnFy7gqCCooYOVPYM=; b=l9+lmZweo6oXUWNGV8xHnOkuGe0+RBEhui6QOAuYZ23x1liwDxvcXXkUwbLk496zEF H0yQV/m6XsGwBZ1oa7QwoclD4ZTu8A6iEfwkdDJ67UcO7rAL20K9IIElqi6mfqelDP6T wZOemYsKRFQ87jvF0LlwFOxEzc9hDlRCowxfgB7/uoHH6Dfy/n0Hg7+dOjaS9L58O3jL yTmTLV6V4TIaC9FwYFQ47zpOSIQcfY6I0ulawMCV/RcmJlU1azUnTCBoJcpev8v/fUR+ 2fBvD7DEKolRGBm/OWri6Y4rzYboi3CXLBa5gamL5ojZ7roUa32I5GCD00wBjTMOK5MN 1XVQ== X-Gm-Message-State: APjAAAUTlSGzcQmbXCFSODlIrFoRgRSmKAzJFavYEtxoEKVrfRNeLXqt 6bdFpDu6rqD/hsJZkC1UA8gkdTnJ X-Google-Smtp-Source: APXvYqw678a3KdueLprZ1XDok6dCSJ5gLu/OmimkKnsCW4mrsGXYU0vt8EaaUJquU/I2Do3t5NchUg== X-Received: by 2002:a17:902:9689:: with SMTP id n9mr77404506plp.241.1563816040774; Mon, 22 Jul 2019 10:20:40 -0700 (PDT) Received: from xps13 ([167.220.105.181]) by smtp.gmail.com with ESMTPSA id t96sm36210746pjb.1.2019.07.22.10.20.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jul 2019 10:20:39 -0700 (PDT) Date: Mon, 22 Jul 2019 10:13:16 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: Bruce Richardson , dev@dpdk.org, stable@dpdk.org Message-ID: <20190722101316.33121639@xps13> In-Reply-To: <3107061.JzsCpgzbfO@xps> References: <20190715234136.3526-1-stephen@networkplumber.org> <20190722090610.GA289@bricha3-MOBL.ger.corp.intel.com> <20190722094323.613cb090@xps13> <3107061.JzsCpgzbfO@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] pci: fix missing pci bus with shared library build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, 22 Jul 2019 19:04:55 +0200 Thomas Monjalon wrote: > 22/07/2019 18:43, Stephen Hemminger: > > On Mon, 22 Jul 2019 10:06:11 +0100 > > Bruce Richardson wrote: > > > On Mon, Jul 22, 2019 at 09:38:27AM +0200, Thomas Monjalon wrote: > > > > 19/07/2019 22:55, Stephen Hemminger: > > > > > The root cause is that recent gcc won't run constructor on unused libraries. > > > > > Testing a patch to take --as-needed off of PCI library. > > > > > > > > > > See: https://stackoverflow.com/questions/11631161/force-to-link-against-unused-shared-library > > > > > > > > The constructor is run when calling dlopen, right? > > > > > > > > Note: dlopen with -d is a feature. > > > > The original idea was to be able to specify which driver we want to use. > > > > If we want an automatic dlopen, like modprobe, then we need more scripts. > > > > But I understand you are against the whole dlopen idea. > > > > > > This issue is more of a problem for development systems where we EAL path > > > is not really usable for finding the drivers. For a properly deployed > > > system where we use DPDK installed to /usr/local or /usr, the EAL PMD path > > > will be correctly configured and properly probe all drivers. > > > > The problem is that bus drivers register themselves in constructors and > > these construtors are not run with as-needed. > > Are the constructors run on dlopen of the bus driver? > > > Yes, constructors are run on dlopen. But application should not have to ask DPDK to dlopen the bus devices. The core principle is that dynamic build of DPDK should act the same as old statically linked DPDK. Otherwise, the user experience is even worse, and all the example documentation is wrong.