DPDK usage discussions
 help / color / mirror / Atom feed
From: Robert Hable <Robert.Hable@spusu.at>
To: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Cc: "users@dpdk.org" <users@dpdk.org>
Subject: AW: rte_eth_dev_count_avail returns different value in library
Date: Thu, 17 Nov 2022 09:17:08 +0000	[thread overview]
Message-ID: <PAXP190MB1741D15E70C1C450F6372263E1069@PAXP190MB1741.EURP190.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20221111174857.71cdc2f7@sovereign>

Hello Dimitry,

thank you! I got it working now using /WHOLEARCHIVE.
I just needed to link mlx5devx.lib from the DevX SDK as well to my application.

Kind regards,
Robert

-----Ursprüngliche Nachricht-----
Von: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> 
Gesendet: Freitag, 11. November 2022 15:49
An: Robert Hable <Robert.Hable@spusu.at>
Cc: users@dpdk.org
Betreff: Re: rte_eth_dev_count_avail returns different value in library

2022-11-11 13:51 (UTC+0000), Robert Hable:
> Hello Dimitry,
> 
> Yes, I am building DPDK as static library. As far as I have seen it should also be the default option on windows builds?

DPDK builds both static and dynamic libraries by default ("default_library=static" means that DPDK apps will use static libraries).
However, DLLs don't work on Windows currently.

> I tried linking the following libraries to my application, which is using my own dpdk-library, but I had no success in using any dpdk functionality (rte_eth_dev_count_avail() returns 0).
> In the linker output I found out that the libraries are currently unused:
> 
> 1>Unused libraries:
> 1>  C:\Dev\Extern\dpdk\build\lib\librte_eal.a
> 1>  C:\Dev\Extern\dpdk\build\lib\librte_mbuf.a
> 1>  C:\Dev\Extern\dpdk\build\lib\librte_mempool.a
> 1>  C:\Dev\Extern\dpdk\build\lib\librte_ethdev.a

I'm puzzled why these four are unused.
If the DLL using rte_eth_dev_count_avail() links successfully, the linked must use "librte_ethdev.a".

> 1>  C:\Dev\Extern\dpdk\build\drivers\librte_common_mlx5.a
> 1>  C:\Dev\Extern\dpdk\build\drivers\librte_net_mlx5.a
> 
> Do you have any other ideas what I am missing there and why they are not linked to it? Is it may be possible to include all the PMD libraries already in my own library, so I only need to link against one library?
> Yes, rte_eth_dev_count_avail() is called directly after rte_eal_init().
> 
> By the way I am using the visual studio 2022 compiler to build my own application and clang for compiling dpdk if that matters.

Please try /WHOLEARCHIVE for these libraries as documented here:

https://learn.microsoft.com/en-us/cpp/build/reference/wholearchive-include-all-library-object-files?view=msvc-160

On Unices, PMDs are also linked using a similar --whole-archive option.
This is needed because there are no direct references from DPDK libraries to PMDs, because PMDs register themselves at startup.

      reply	other threads:[~2022-11-17  9:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28  9:45 Robert Hable
2022-10-28 10:48 ` Dmitry Kozlyuk
2022-11-11 13:51   ` AW: " Robert Hable
2022-11-11 14:48     ` Dmitry Kozlyuk
2022-11-17  9:17       ` Robert Hable [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PAXP190MB1741D15E70C1C450F6372263E1069@PAXP190MB1741.EURP190.PROD.OUTLOOK.COM \
    --to=robert.hable@spusu.at \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).