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 C7701A046B for ; Mon, 22 Jul 2019 20:53:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 897991BEF5; Mon, 22 Jul 2019 20:53:31 +0200 (CEST) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by dpdk.org (Postfix) with ESMTP id 562481BEEB for ; Mon, 22 Jul 2019 20:53:30 +0200 (CEST) Received: by mail-pg1-f194.google.com with SMTP id i18so18093834pgl.11 for ; Mon, 22 Jul 2019 11:53:30 -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=uaoG7zyNAHRrhlOl7EQHjpsYbIoKiaJS4R4E0zNsok0=; b=dfCowOhqq9ilgs0ojiLY7VvOuoezDy+sZURifR7Vi1/C5TByNq5WnNPTW8GProA2vm GMAdMR2AV1SUfd2ENIKze7zjLMuV9PrXcSHMO0ldF0hHlzBlrRmkJCBaqx8MJfogFboC Bxeb/OjKWFALRg28H8q04wtXl3Xt7PBOj5f37j5nJu0997E/qIIdsies5J1b0R/Ki5oS +PeHtyhpj6Uqu1S599oVCIscXMcrboMxaoox9T8CI0mS+lTz3Z1wPb7Dy4sUOtVC4tJ1 aeUnYRgbCwOC/PHm/XCKoje4HbWqukrVul2xeVMbbO/Bq/u9ncsU6aROIMImkobaoE4W Lgew== 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=uaoG7zyNAHRrhlOl7EQHjpsYbIoKiaJS4R4E0zNsok0=; b=swPnMSwkPjTWIthZWE82+jkfjHsIIEnDyMZLCnogJyeiRTepUBJT6b8w/i6V04bee/ nmFeJ83/cxh2CXb/eK43c39Q1W6FBsuY4pLSMW6qgWcyjqIlaDSZJz+idTFwTTazs4bc c1AnVJFeHwO08zRKNIomv2K/rMEDylkCyqrQipkXsUIY0KqWIHl3LXNLeM3+LbpunHUU CCzj2ph0lT1Mr/p34wnIFFvYAyRM5UdUzl0Mo4ga2lZ7cXj0cVkHOtAV8bwh8fmqdyZO soPqICmiAkWUrtsbkHVcObXazH+TbApBwQghyY0VA9Y2tsmLJApF+mLzs21+sw52JS18 qr8w== X-Gm-Message-State: APjAAAWUltSPFX9yI1A4BCNCVCWxhWQavkOurTYrR7nVBXiNtGY8y5DG 5+mg57wq3xnd/jJFVwIa8/jnV5JQ X-Google-Smtp-Source: APXvYqxQ1IVbbswXOq6k8KpzgAu6Qs6XVAiHz3xWy0tYgItS8X7oa549A3gq5/kipDrVs3wb2Rnd1w== X-Received: by 2002:a63:fd57:: with SMTP id m23mr6153018pgj.204.1563821609342; Mon, 22 Jul 2019 11:53:29 -0700 (PDT) Received: from xps13 ([167.220.105.181]) by smtp.gmail.com with ESMTPSA id f20sm37784936pgg.56.2019.07.22.11.53.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jul 2019 11:53:29 -0700 (PDT) Date: Mon, 22 Jul 2019 11:53:26 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: Bruce Richardson , dev@dpdk.org Message-ID: <20190722115326.25a201b8@xps13> In-Reply-To: <4987111.cxvgFvst8F@xps> References: <20190715234136.3526-1-stephen@networkplumber.org> <3107061.JzsCpgzbfO@xps> <20190722101316.33121639@xps13> <4987111.cxvgFvst8F@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:31:08 +0200 Thomas Monjalon wrote: > 22/07/2019 19:13, Stephen Hemminger: > > Thomas Monjalon wrote: > > > 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. > > OK, this is where I wanted to bring the discussion. > You are arguing against a design which is in DPDK from some early days. > So this is an interesting discussion to have. > Do we want to change the "plugin model" we have? > Or do we want to simply drop this model (dlopen calls) > and replace it with strong dynamic linking? > > What I think should happen (and isn't is): 1. The PCI bus library is linked with --whole-archive, and --no-as-needed. This causes constructor to be called and register the bus. 2. As part of the build process all the PCI drivers pmdinfo would get constructed into a table of vendor/device to PMD shared library name. 3. PMD's are linked as --whole-archive, and --as-needed. 4. New code in PCI probe which looks for existing entries (static or -d) for devices. If device is still not found it refers to the table of PMD's (from #2) and calls dlopen for that device (and adds it to static table). This would allow examples and customer applications to Just Work without having to know the PMD that is present. It would also solve the problem that currently if applications is linked with -ldpdk linker script then all PMD's get pulled into the application address space.