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 C8E39A0471 for ; Fri, 19 Jul 2019 22:39:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 547E64D27; Fri, 19 Jul 2019 22:39:35 +0200 (CEST) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id D890A322C for ; Fri, 19 Jul 2019 22:39:33 +0200 (CEST) Received: by mail-pf1-f194.google.com with SMTP id f17so10672159pfn.6 for ; Fri, 19 Jul 2019 13:39:33 -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=vKUJbI1fz1vhLVUqUgjpXMfr4J7GRDkoMU0lQGCnbNM=; b=rtYNQgWAfhuhBjrxbZDPRJw1y3mSNOKh/wxy4asnSCTpwgv/PlMJ1sPDWELSduf33s N92qr7Yd0lzz3Gwds+HOJmGNRvtM3STnIg9uTQ923uIIFAu+mMGfJu6a2qb6PB/saTY2 Ll7PlUnWri+o2wH6DejkXF8mf5r+NjnnELuXG6jVVqvSs9THg7AIaMDa4hX5eut8r+QO luxIuwDMqQqOH2Y/Fc5vO3whyELVWk1JqUBe2CnnTh/vl7HinQlAZSgWutQ2hf2GA29/ kGohXFjVw7YTN6n83cf2RbiyuR4yNOCq7LKXCMC9ciMlJB7gIn4DvM488SxNZQKrwjxF q9AQ== 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=vKUJbI1fz1vhLVUqUgjpXMfr4J7GRDkoMU0lQGCnbNM=; b=lG8hIzp0EUch+h/v9KfyUFB04tSit4r73riUrzREijs15UHRQ5iCJrvKwVVjwVMQMM AZUK2Ae4HGlSrEX4b4EFpQI3pCvvrcGFo1Kcxv1JWP+oOVK4Xwz0F3qomSAbOiLWAM/x BW8orBRt65oK1IJV6eqlKoXw9/FdfolDVr+K7LnmsDMIheA/jWI40b+TV92FvULAxB3b bQ3UX3ZFMfqsS7elLhhXNQg/3JfNhAc2FOiaXHfowBZCiIKO99k9CQ4L/kqoBVFFaAs2 8ACYEX4q7kCYd/Wir7eRUgYDrWTulRiuvUuRvvEQmYLPvg+0ST7dSs/VLXFvnNgA0+nP uzXA== X-Gm-Message-State: APjAAAWkr+4uq0lEwlPTl9c4AfqYlwOzC3D/Gidih3OvJZZq5N8gKjw9 iUoqe4jl8+TUbwVVyM0ITt4= X-Google-Smtp-Source: APXvYqw/3ExGffnWyPdPskd/g/SgNZTtc+pg4s2C+wSerFgJjT5AA8FF01BvNJNn47gnklKeY//iBg== X-Received: by 2002:a65:60d3:: with SMTP id r19mr30851427pgv.91.1563568772873; Fri, 19 Jul 2019 13:39:32 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id i198sm20317718pgd.44.2019.07.19.13.39.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 19 Jul 2019 13:39:32 -0700 (PDT) Date: Fri, 19 Jul 2019 13:39:25 -0700 From: Stephen Hemminger To: Bruce Richardson Cc: thomas@monjalon.net, dev@dpdk.org, stable@dpdk.org Message-ID: <20190719133925.5ac29c19@hermes.lan> In-Reply-To: <20190716084423.GB561@bricha3-MOBL.ger.corp.intel.com> References: <20190715234136.3526-1-stephen@networkplumber.org> <20190715171912.7c179f43@hermes.lan> <20190716084423.GB561@bricha3-MOBL.ger.corp.intel.com> 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 Tue, 16 Jul 2019 09:46:04 +0100 Bruce Richardson wrote: > On Mon, Jul 15, 2019 at 05:19:12PM -0700, Stephen Hemminger wrote: > > On Mon, 15 Jul 2019 16:41:36 -0700 > > Stephen Hemminger wrote: > > > > > If DPDK is built as a shared library, then any application linked > > > with rte.app.mk will not find any PCI devices. When the application > > > is started no ethernet devices are found. > > > > > > This is because the link order of libraries on the command line matters. > > > And PCI is before EAL. That causes there to be no dependency on PCI > > > so linker ignores linking the library. > > > Swapping the order fixes this. > > > > > > Fixes: c752998b5e2e ("pci: introduce library and driver") > > > Cc: stable@dpdk.org > > > Signed-off-by: Stephen Hemminger > > > --- > > > mk/rte.app.mk | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/mk/rte.app.mk b/mk/rte.app.mk > > > index a277c808ed8e..470b92e4d73e 100644 > > > --- a/mk/rte.app.mk > > > +++ b/mk/rte.app.mk > > > @@ -90,8 +90,8 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_STACK) += -lrte_stack > > > _LDLIBS-$(CONFIG_RTE_DRIVER_MEMPOOL_RING) += -lrte_mempool_ring > > > _LDLIBS-$(CONFIG_RTE_LIBRTE_OCTEONTX2_MEMPOOL) += -lrte_mempool_octeontx2 > > > _LDLIBS-$(CONFIG_RTE_LIBRTE_RING) += -lrte_ring > > > -_LDLIBS-$(CONFIG_RTE_LIBRTE_PCI) += -lrte_pci > > > _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal > > > +_LDLIBS-$(CONFIG_RTE_LIBRTE_PCI) += -lrte_pci > > > _LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline > > > _LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder > > > _LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched > > > > It still happens with 19.08. Testpmd works but only because it is > > linked with so many things. But l3fwd fails... > > > > # ./examples/l3fwd/build/l3fwd -n4 -l0-3 -w 02:00.0 > > EAL: Detected 8 lcore(s) > > EAL: Detected 1 NUMA nodes > > EAL: failed to parse device "02:00.0" > > EAL: Unable to parse device '02:00.0' > > EAL: Error - exiting with code: 1 > > Cause: Invalid EAL parameters > > I don't think the position of these is going to be the cause here, the more > likely cause is that the pci bus driver - and all other drivers - are not > linked into apps for shared library builds. You always need to pass "-d" > parameter to load drivers at init time (or have them installed in the > correct driver path). For example, for me with a shared library build the > following gives a no ports error: > > sudo ./build/l2fwd -c F00000 -- -p 3 > > while this succeeds and runs fine > > sudo ./build/l2fwd -c F00000 -d $RTE_SDK/$RTE_TARGET/lib/librte_pmd_i40e.so -- -p 3 There is something else going on. This patch isn't fixing the problem consistently. The suggestion of using -d is still wrong. We need to figure out how to get applications to run the same whether using shared library or statically linked.