From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC852A0548 for ; Tue, 27 Apr 2021 08:41:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 64E8740143; Tue, 27 Apr 2021 08:41:59 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id CF2FA4003E for ; Tue, 27 Apr 2021 08:41:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619505716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cpAFWnWjlBSqnvYDwU1LQTVcN8MUv75e+UPvLknlcBI=; b=hwlGJ8uBmGGaQ1B18/DTlznNUCAHtPCKWJnUOiig4BTEhCQzjafaNllxEYXwUXg7vnU9Tm L1ePy++IQTz1zPC0t6T9eBBXfvyRwUFEKjBUs9KNWepHxwkyOGrjPw5XTcGjFig2oRrGJr hlZjv0BW183XK1MuydLh3nT5fm4wgfQ= Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-379-2E_5iT2ePQeZIZOGbYNMZA-1; Tue, 27 Apr 2021 02:41:54 -0400 X-MC-Unique: 2E_5iT2ePQeZIZOGbYNMZA-1 Received: by mail-vs1-f72.google.com with SMTP id z7-20020a67ca070000b0290220c083d3acso9807689vsk.21 for ; Mon, 26 Apr 2021 23:41:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cpAFWnWjlBSqnvYDwU1LQTVcN8MUv75e+UPvLknlcBI=; b=Az7LfvFtzLBy7snFY+EhOamG0FcBtPFLugCcqXGpXwoBpIouMuym5ej/E7NyKRnADB PQe1Lpl0ueSe0c6qJa1hIk7c3RVr6+Qdi2mAW6j+ajTkLxQa9bpoqHFB+WiP0IsbY8xG rEDlTc75RrszP3d3AAJCHqPCzsT5oy6mgqwP+rnDNr5/ViNtZkc+fQQHgpVCE7hsHIJi P+XXEaV4g/aeOWyS/MhyM/uP8wEqC4T0yUwq+t45aojHKMgGLzeSLPy5z3ra+0G2s2VS zUs38OO2Q4WrP771D0PM/IHo/GI3gqG07Ba2ANegZF/PFVfQi2Isy+Z5ESbL/hKfLirG tGjQ== X-Gm-Message-State: AOAM531iztxh0LdqxbWVYOlcdWxXsffPPOCGbRxGaeHSIuU0gKtfpjRX GMGMRMvPdfxjUSuuTosjT75HjoUcFLu91XmFG+pq5FBDKt0P9sb+++tH5/7beVxPr42QExZfUG+ UT3FeK6tctOqp2TxjJUHOQg== X-Received: by 2002:a05:6102:127b:: with SMTP id q27mr14186355vsg.27.1619505714083; Mon, 26 Apr 2021 23:41:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJye6IlJ5loqulPiIZ1bNXqRzAntRfqbqEEzzZyaYx45u8JfyjmHpZU6q1CgeYPSzs8HiTaHMFtSAVwFX3Q8hCQ= X-Received: by 2002:a05:6102:127b:: with SMTP id q27mr14186348vsg.27.1619505713857; Mon, 26 Apr 2021 23:41:53 -0700 (PDT) MIME-Version: 1.0 References: <3e2a222c70864e73965adbe64b5c72a2@boeing.com> In-Reply-To: <3e2a222c70864e73965adbe64b5c72a2@boeing.com> From: David Marchand Date: Tue, 27 Apr 2021 08:41:42 +0200 Message-ID: To: "Templin (US), Fred L" Cc: "users@dpdk.org" , Stephen Hemminger Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-users] dpdk-20.11 and shared libraries X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 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 Tue, Apr 20, 2021 at 6:25 PM Templin (US), Fred L wrote: > > Hi, I have put a lot of time into learning about dpdk-20.11 but I have not yet found > documentation on how to use it with shared libraries. In dpdk-20.11, the examples > are all built as "static" by default meaning that the entire kitchen sink of all DPDK > libraries are linked in during the "ld" phase and the resulting binary is huge. When > built as "static", the examples all appear to work fine as everything is loaded by > default at runtime. > > When I build the examples as "shared", however, the story is completely different. > Examples that run fine as "static" do not work at all when built as "shared". It is > clear that somehow the build procedure is not giving adequate instructions to the > loader so that all necessary libraries will be ready to go at runtime. > > I believe what needs to happen is that initialization code needs to be added to the > example "main.c" modules to initialize functions that will be needed by lower levels > but that are not being picked up on by the loader. But, I can find no documentation > for how to do this. In my next message, I will send a code example of what I have > tried so far. I suppose you are testing with a local build (i.e. a dpdk not installed system wide). Example with my build env: $ $HOME/builds/build-gcc-shared/examples/dpdk-helloworld --no-huge -m 512 --vdev net_null0 EAL: Detected 28 lcore(s) EAL: Detected 1 NUMA nodes EAL: Detected shared linkage of DPDK EAL: failed to parse device "net_null0" EAL: Unable to parse device 'net_null0' PANIC in main(): Cannot init EAL 5: [/home/dmarchan/builds/build-gcc-shared/examples/dpdk-helloworld() [0x40116e]] 4: [/usr/lib64/libc.so.6(__libc_start_main+0xf2) [0x7f7ece854082]] 3: [/home/dmarchan/builds/build-gcc-shared/examples/dpdk-helloworld() [0x4010b6]] 2: [/home/dmarchan/builds/build-gcc-shared/examples/../lib/librte_eal.so.21(__rte_panic+0xbe) [0x7f7eceb828cc]] 1: [/home/dmarchan/builds/build-gcc-shared/examples/../lib/librte_eal.so.21(rte_dump_stack+0x1b) [0x7f7eceba26cb]] Aborted (core dumped) You have several solutions. You can simply install dpdk system wide. Or, try to pass -d in EAL cmdline options. $ LD_LIBRARY_PATH=$HOME/builds/build-gcc-shared/install/usr/local/lib64 $HOME/builds/build-gcc-shared/examples/dpdk-helloworld --no-huge -m 512 -d $HOME/builds/build-gcc-shared/install/usr/local/lib64/dpdk/pmds-21.2/librte_net_null.so --vdev net_null0 EAL: Detected 28 lcore(s) EAL: Detected 1 NUMA nodes EAL: Detected shared linkage of DPDK EAL: Multi-process socket /run/user/1001/dpdk/rte/mp_socket EAL: Selected IOVA mode 'VA' EAL: VFIO support initialized TELEMETRY: No legacy callbacks, legacy socket not created hello from core 1 hello from core 2 hello from core 3 hello from core 4 hello from core 5 hello from core 6 hello from core 7 hello from core 8 hello from core 9 hello from core 10 hello from core 11 hello from core 12 hello from core 13 hello from core 14 hello from core 15 hello from core 16 hello from core 17 hello from core 18 hello from core 19 hello from core 20 hello from core 21 hello from core 22 hello from core 23 hello from core 24 hello from core 25 hello from core 26 hello from core 27 hello from core 0 Or you can also pass a directory to this option and EAL will try to load any driver in this directory. -- David Marchand