DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Meson configuration for pkg-config for drivers' shared objects
@ 2021-05-18 14:33 Jakub Palider
  0 siblings, 0 replies; only message in thread
From: Jakub Palider @ 2021-05-18 14:33 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, thomas, david.marchand

Hi,

I experience a problem while building out-of-tree application against drivers' shared libraries from dpdk that are _not_ accessed by means of lib/ interface. This looks a bit like a lack of a link between the framework and what certain drivers deliver (rte_pmd API). Employing pkg-config in current shape does not satisfy the dependencies.

Please, have a look at the example below which materializes this problem of an app.c:

#include <rte_pmd_i40e.h>
#include <rte_ether.h>

int main()
{
        rte_ether_format_addr(NULL, 0, NULL);
        rte_pmd_i40e_set_vf_mac_addr(0, 0, NULL);
}

I want to use two symbols, one from librte_net and one from i40e net rte pmd.

1. PLAIN compilation: complains about both of them, as expected:

$ ${CROSS}-g++ -march=armv8.1-a -o bin-app app.c
/tmp/ccUac7fS.o: In function `main':
app.c:(.text+0x114): undefined reference to `rte_ether_format_addr'
app.c:(.text+0x124): undefined reference to `rte_pmd_i40e_set_vf_mac_addr'
collect2: error: ld returned 1 exit status

2. PKGCONFIG asked to fill dependencies adds them for dpdk lib/ but i40e rte pmd is still missing:

${CROSS}-g++ -march=armv8.1-a -o bin-app app.c $(pkg-config --libs libdpdk)
/tmp/ccYhiA3K.o: In function `main':
app.c:(.text+0x124): undefined reference to `rte_pmd_i40e_set_vf_mac_addr'
collect2: error: ld returned 1 exit status

3. WORKADOUND: which adds explicitly dependency for linker:

${CROSS}-g++ -march=armv8.1-a -o bin-app app.c $(pkg-config --libs libdpdk) -lrte_net_i40e

The borderline is that I don't want to add them explicitly, but rather pkg-config do this for me. This would be realized if driver's lib (which actually gets built as .so) was added to meson's dpdk_libraries variable:
my_lib_name = '_'.join(['rte', class, name])
shared_lib = shared_library(my_lib_name)
dpdk_libraries = [shared_lib] + dpdk_libraries
In such case $(pkg-config --libs libdpdk) would satisfy all dependencies.

My questions are:
1. Is there a better approach to this problem than one mentioned by me? Am I missing something?
2. Shall RTE PMD APIs of certain drivers be a part of dpdk default pkg-config configuration?

I have learned there used to be libdpdk.so but this is no longer applicable, also this is not a plugin-alike issue. So I hope I am not duplicating topics - I could not find anything resembling this one.

Regards,
Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-18 14:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 14:33 [dpdk-dev] Meson configuration for pkg-config for drivers' shared objects Jakub Palider

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).