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 07070A04B5 for ; Sat, 19 Dec 2020 20:27:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3C2F6CB33; Sat, 19 Dec 2020 20:27:39 +0100 (CET) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by dpdk.org (Postfix) with ESMTP id 895CBCB2F for ; Sat, 19 Dec 2020 20:27:36 +0100 (CET) Received: by mail-pj1-f46.google.com with SMTP id b5so3354669pjl.0 for ; Sat, 19 Dec 2020 11:27:36 -0800 (PST) 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=V17f0/zn3zRgM06yOEk8FoZsAWH9rXZwW+ShYuo/aQI=; b=jrirCKyVzePQMu50IUOZlt0KCW/ebBU0gpYmhnky5U4q5tfx6/PTUAGDvy/2e2FCP2 /Ipx005WlrA8TqZaPNadJBfeCjPSLfK5CeeVmKpLg6xucXkbufL6I1I68ILWiqZysR9R v6xP2jAe24rWExdYga5RUDLNIKQeRA1lvICROZslSjsM2oC+/EJ8ZAtTDO/zuCdwriia 5+C7kVYMqs10zvqRuw63s2lUqFmtmvh0DMVFIGP9jrNy/O26amJE2Jt2Hp+Mr2VZhFoT 0jflqU5KZwP+Zf735TeugLdjhN7QCOK0Y1fxI53OLvOo3FFHdCIX5DZd/oRxgfzY1HyF PBIQ== 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=V17f0/zn3zRgM06yOEk8FoZsAWH9rXZwW+ShYuo/aQI=; b=EOX4LFf3LYLMcX2spjOnNWJpNCmFnLgY4Z/0Zu8p+hPOM6/CrFEXZOuFgGNM24JzFy 4wrajO8kXixa5wB7kZNzdrMIXhaCsoq2uJiw5XBpFtHixpHq9/TpdGun6vLM1QUnXCj1 OwZvvdr0HToupWNmPc9+HbJ4u80eFFYEFAEICOqdwG1t5YHiai/a/JztV+2qix9B5rwa D5WmyoEHrGE1mg/TiPrehUvEPUF1cAzOQrL/wpd3HleOrG8bmuAZh6/qpY632V3/Oxup 022UTK/Jv1dvD0jpTKHBZQKrOXCGDnS0Wy68K8xWbWHOmYd2rLAayvAX7ffAkIAMaYgg 6ZUg== X-Gm-Message-State: AOAM532tUuF6Arql6RUBW4Qw4E0B0EwM/XpSg6/08BeF4FKOUZbjdB6Q icoMil4XtBhqw+8ld0juPUG/lt7by7ZfJcy2 X-Google-Smtp-Source: ABdhPJyq7EmCadheJnpvOgPPva0sy5PTnoK7LFxs14MVpYFET80Eoin4e/3a5xmQavMunRXoRDPqug== X-Received: by 2002:a17:902:b116:b029:dc:c93:1d6b with SMTP id q22-20020a170902b116b02900dc0c931d6bmr9974899plr.22.1608406054578; Sat, 19 Dec 2020 11:27:34 -0800 (PST) Received: from hermes.local (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id c14sm11806920pfd.37.2020.12.19.11.27.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 11:27:34 -0800 (PST) Date: Sat, 19 Dec 2020 11:27:15 -0800 From: Stephen Hemminger To: Justin Tallon Cc: users@dpdk.org Message-ID: <20201219112715.75924abe@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-users] using dpdk as a shared library X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" On Fri, 18 Dec 2020 23:38:28 +0100 Justin Tallon wrote: > Hey guys, > > We are trying to use dpdk (dpdk-stable-18.08.1) as a shared library. > > We have recompiled as a shared library by setting > *CONFIG_RTE_BUILD_SHARED_LIB=y* > > My program compiles file and I can see the relevant libraries when I use > ldd on the binary. > > I direct my binary look in the correct place by using export > LD_LIBRARY_PATH and the binary appears to find the libraries. > However, when the function rte_eth_dev_count_avail returns it returns a 0 > and exits, when I run the same program with static libraries, it works > correctly. > > Any help on this would be great! > > Regards, > Justin > > > ____ > Justin Tallon Ph.D. > > Software Radio Systems (SRS) > http://www.softwareradiosystems.com > > +353-86-067-0753 | justin.tallon@softwareradiosystems.com When used as a shared library DPDK does not automatically load any required poll mode driver libraries. You have to pass -d flag to make it load what you want. I consider this a bug (others do not), and think the DPDK should have a table mapping PCI device id to the PMD shared library and automatically load the PMD shared library (like the Linux kernel module autoloading works).