From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id 943FDDE3 for ; Fri, 25 May 2018 01:20:50 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id i14-v6so6011416wre.2 for ; Thu, 24 May 2018 16:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6DRoUnj8erLsBr+vfW5aPA2jqfvLCeEhDHTYe3suymw=; b=ANtd5GptVbyxIQIL0co+0QTwKa7dAPP1Rx8VFAqNPNq/dHaWy5vlJ7OlQff7eszMpb 1suhpqLnD1Z96U/aFER4ZbpZUYG5I3iQnOEAPvlsiBCl00CV86R+YA6pkOVfvz0GHyww gme0x00umS4wzt45pYyVLrzq0GNYLoLNakUQ1chtC0O96nyXlMmDDW4V4WdIfieGGVd8 PiAyPCTHkoSQnF9sBJt2t/fDaUOBFYZkgOxOgyhwvAe89uSp+jv+dFUvu7cV43R6WMnN MyuMArg+s2Fe8mJUTqNyjL86AaGU27HNM43Ywy5p8DfBsQQvrl0QbaOGL+NRrwFEwGP+ Q9eQ== 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=6DRoUnj8erLsBr+vfW5aPA2jqfvLCeEhDHTYe3suymw=; b=ir+oU78rUg6rU9ELShsNhgQDDeQTp1Gvj9wzYrfQAFhARgTCvEO6ftH1dl/z17G9rk QZooQZF4XnoVclonyZCs1+s9MSlFJH9jf8t9m+mT0zzSI7m2BAEsM4y3R2rTaoeOg2AS LFSE9zcgjlooh8VYbCkhTzN/MxC55ZhhQSmknXu6553Y+1E3lEepWh3gYO5rUzjLX+w3 DLdc4OcedCtzbyny95H21UWjkgT03fapwotF6bm0gxi12ahWGCWPH/+reESslLxglSGT GI2A95O6MWD4mE11fjfzPi4ZcdSkELQet5HbJRLzwfJDDo/hQbjaIQqeJBil1lErpmF/ iLTQ== X-Gm-Message-State: ALKqPwfLxAhL0a/4691GJYZW9DVVMHVv2SADG9e/p08bMWixDn3uKTHF sT7iv8Jh4LCC9HvqUR0EVI/S2irrhdxaMFrndHjVnaHo X-Google-Smtp-Source: AB8JxZpWpnYHspFvaZ9kO2VT/Sj61uY7k9FRw1yXWdAyoJ1bB3pZ5Djmtpb/ifqCTC+vEswIwYA8zEERp+5XNNcEY/k= X-Received: by 2002:adf:8ecb:: with SMTP id q69-v6mr4046289wrb.261.1527204050369; Thu, 24 May 2018 16:20:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Paras Jha Date: Thu, 24 May 2018 16:20:39 -0700 Message-ID: To: contact@filipjaniszewski.com Cc: users@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-users] Difference between APP and LIB 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: , X-List-Received-Date: Thu, 24 May 2018 23:20:50 -0000 Hello, I actually had the exact same issue earlier! The PMDs for DPDK mark their functions as constructors to get them to initialize before main() - however, this causes the linker to (mistakenly) believe there is no reference to the function and remove it from the binary. The rte.app.mk already does this for you, but you can manually do it by adding these flags during link stage -Wl,--whole-archive -ldpdk -Wl,--no-whole-archive Please note that this will embed ALL of dpdk into your binary - if you want to fine-tune your binary to be smaller you might find it prudent to include only the libs that are relevant to your application Thanks On Thu, May 24, 2018 at 6:35 AM Filip Janiszewski < contact@filipjaniszewski.com> wrote: > Hi, > > I've a weird situation: If I build my code using rte.app.mk, then > calling rte_eal_init and rte_eth_dev_count returns the proper amount of > NICs. > > The very same code built with rte.lib.mk into a *.a library does not > recognize any NIC (If I include the lib in another test application that > only invoke one function that trigger rte_eal_init and rte_eth_dev_count). > > The output of running rte_eal_init with rte.app.mk on my machine is: > > . > EAL: Detected 8 lcore(s) > EAL: Multi-process socket /var/run/.rte_unix > EAL: Probing VFIO support... > EAL: PCI device 0000:06:00.0 on NUMA socket -1 > EAL: Invalid NUMA socket, default to 0 > EAL: probe driver: 15b3:1015 net_mlx5 > PMD: net_mlx5: PCI information matches, using device "mlx5_0" (SR-IOV: > false) > PMD: net_mlx5: 1 port(s) detected > PMD: net_mlx5: MPS is enabled > PMD: net_mlx5: Reserved UAR address space: 0x7f0680000000 > PMD: net_mlx5: port 1 MAC address is 7c:fe:90:5e:79:fa > EAL: PCI device 0000:06:00.1 on NUMA socket -1 > EAL: Invalid NUMA socket, default to 0 > EAL: probe driver: 15b3:1015 net_mlx5 > PMD: net_mlx5: PCI information matches, using device "mlx5_1" (SR-IOV: > false) > PMD: net_mlx5: 1 port(s) detected > PMD: net_mlx5: MPS is enabled > PMD: net_mlx5: port 1 MAC address is 7c:fe:90:5e:79:fb > . > > While the same invocation with the code built using rte.lib.mk generate > this output: > > . > EAL: Detected 8 lcore(s) > EAL: Multi-process socket /var/run/.rte_unix > EAL: Probing VFIO support... > . > > That's all -no more prints-, it seems that nothing else is done by the > eal init function. What could be the problem here? As a background note: > I'm trying to move my existing DPDK code into a lib, and this is already > failing at the first step (eal init). > > Thanks > > -- > BR, Filip > +48 666 369 823 >