DPDK usage discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Nandini Rangaswamy <nandini.rangaswamy@broadcom.com>
Cc: users@dpdk.org, Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: Compiling testpmd with DPDK netvsc PMD
Date: Wed, 12 Jun 2024 08:20:50 +0200	[thread overview]
Message-ID: <CAJFAV8xJrzmHhVCPKdEqf6TZi371Zy=MeyO+rD6Yf-LajePMxw@mail.gmail.com> (raw)
In-Reply-To: <CAAkQrK-3wgJYwVw4xnGVC9h_FBDHY_pHrsiLz_N-2JgT7P1Zwg@mail.gmail.com>

On Tue, Jun 11, 2024 at 7:10 PM Nandini Rangaswamy
<nandini.rangaswamy@broadcom.com> wrote:
>
> Hi David,
> It was a misunderstanding on my part. I had assumed that since the libraries were not dynamically linked and not showing up in ldd output, testpmd was probably not using netvsc.
> After looking at the comments in config/meson.build " NOTE: DPDK always builds both shared and static libraries.  Please set "default_library" to either "static" or "shared" to select default linkage
>  for apps and any examples.''')", I inferred that the libraries were being linked statically.
>
> Following this, i changed the default options in meson.build default_library=shared from static and added deps in testpmd/meson.build file as below:
>
> +if dpdk_conf.has('RTE_NET_NETVSC')
> +    deps += 'net_netvsc'
> +endif
> Now ldd dpdk-testpmd  shows netvsc pmd being linked dynamically and also functional at run time.

This change is unneeded.

DPDK installs libraries in RTE_EAL_PMD_PATH, iow
${prefix}/${libdir}/dpdk/pmds-${VERSION} (where prefix and libdir are
meson options).
All drivers in this directory are then automatically picked by EAL
during rte_eal_init.

So the next questions are: did you install DPDK? or are you running
testpmd from a build directory only?

If you installed DPDK system-wide, adding --log-level=lib.eal:debug
should display all loaded drivers.

But I suspect you are in the "latter" case. If so, you'll need to pass
-d /path/to/drivers/dir/ (some tweaking of LD_LIBRARY_PATH may be
necessary, depending on drivers).
Note that this latter case is for *dev* or quick tests.

In general, installing DPDK should be preferred (ninja -C <build> install).

A last note, if you don't want to load all drivers, you can pick which
driver you are interested in at compilation time with
enable/disable_drivers meson options. Or you can prune drivers in the
installed drivers directory.


Example with net_null:

# DPDK compiled in $HOME/builds/main/build-gcc-shared/, no -d option
$ $HOME/builds/main/build-gcc-shared/app/dpdk-testpmd -c 3 --no-huge
-m 40 --log-level=lib.eal:debug -a 0:0.0 --vdev net_null1 --vdev
net_null2 -- --no-mlockall --total-num-mbufs=2048 -ia
EAL: lib.eal log level changed from info to debug
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 1 on socket 0
EAL: Detected lcore 2 as core 2 on socket 0
EAL: Detected lcore 3 as core 3 on socket 0
EAL: Detected lcore 4 as core 4 on socket 0
EAL: Detected lcore 5 as core 5 on socket 0
EAL: Detected lcore 6 as core 6 on socket 0
EAL: Detected lcore 7 as core 7 on socket 0
EAL: Detected lcore 8 as core 0 on socket 0
EAL: Detected lcore 9 as core 1 on socket 0
EAL: Detected lcore 10 as core 2 on socket 0
EAL: Detected lcore 11 as core 3 on socket 0
EAL: Detected lcore 12 as core 4 on socket 0
EAL: Detected lcore 13 as core 5 on socket 0
EAL: Detected lcore 14 as core 6 on socket 0
EAL: Detected lcore 15 as core 7 on socket 0
EAL: Maximum logical cores by configuration: 128
EAL: Detected CPU lcores: 16
EAL: Detected NUMA nodes: 1
EAL: Checking presence of .so 'librte_eal.so.24.2'
EAL: Detected shared linkage of DPDK
EAL: failed to parse device "net_null1"
EAL: Unable to parse device 'net_null1'
EAL: Error - exiting with code: 1
  Cause: Cannot init EAL: No such device

# DPDK compiled in $HOME/builds/main/build-gcc-shared/, and setting -d option
$ $HOME/builds/main/build-gcc-shared/app/dpdk-testpmd -c 3 --no-huge
-m 40 --log-level=lib.eal:debug -d
$HOME/builds/main/build-gcc-shared/drivers -a 0:0.0 --vdev net_null1
--vdev net_null2 -- --no-mlockall --total-num-mbufs=2048 -ia
EAL: lib.eal log level changed from info to debug
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 1 on socket 0
EAL: Detected lcore 2 as core 2 on socket 0
EAL: Detected lcore 3 as core 3 on socket 0
EAL: Detected lcore 4 as core 4 on socket 0
EAL: Detected lcore 5 as core 5 on socket 0
EAL: Detected lcore 6 as core 6 on socket 0
EAL: Detected lcore 7 as core 7 on socket 0
EAL: Detected lcore 8 as core 0 on socket 0
EAL: Detected lcore 9 as core 1 on socket 0
EAL: Detected lcore 10 as core 2 on socket 0
EAL: Detected lcore 11 as core 3 on socket 0
EAL: Detected lcore 12 as core 4 on socket 0
EAL: Detected lcore 13 as core 5 on socket 0
EAL: Detected lcore 14 as core 6 on socket 0
EAL: Detected lcore 15 as core 7 on socket 0
EAL: Maximum logical cores by configuration: 128
EAL: Detected CPU lcores: 16
EAL: Detected NUMA nodes: 1
EAL: Checking presence of .so 'librte_eal.so.24.2'
EAL: Detected shared linkage of DPDK
EAL: open shared lib
/home/dmarchan/builds/main/build-gcc-shared/drivers/librte_common_dpaax.so.24.2
EAL: open shared lib
/home/dmarchan/builds/main/build-gcc-shared/drivers/librte_common_iavf.so.24.2
EAL: open shared lib
/home/dmarchan/builds/main/build-gcc-shared/drivers/librte_common_ionic.so.24.2
EAL: open shared lib
/home/dmarchan/builds/main/build-gcc-shared/drivers/librte_common_octeontx.so.24.2
[ snip ]
EAL: open shared lib
/home/dmarchan/builds/main/build-gcc-shared/drivers/librte_net_netvsc.so.24.2
EAL: pmd.net.netvsc.init log level changed from disabled to notice
EAL: pmd.net.netvsc.driver log level changed from disabled to notice
EAL: open shared lib
/home/dmarchan/builds/main/build-gcc-shared/drivers/librte_net_null.so.24.2
EAL: pmd.net.null log level changed from disabled to notice
[ snip ]


-- 
David Marchand


  reply	other threads:[~2024-06-12  6:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 21:31 Nandini Rangaswamy
2024-06-07 10:56 ` David Marchand
2024-06-07 23:31   ` Nandini Rangaswamy
2024-06-10  7:50     ` David Marchand
2024-06-11 14:35       ` Stephen Hemminger
2024-06-11 17:00         ` Nandini Rangaswamy
2024-06-11 17:10       ` Nandini Rangaswamy
2024-06-12  6:20         ` David Marchand [this message]
2024-06-12 14:48     ` Stephen Hemminger
2024-06-12 18:53       ` Nandini Rangaswamy

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='CAJFAV8xJrzmHhVCPKdEqf6TZi371Zy=MeyO+rD6Yf-LajePMxw@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=nandini.rangaswamy@broadcom.com \
    --cc=stephen@networkplumber.org \
    --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).