Compiling testpmd with DPDK netvsc PMD
David Marchand
david.marchand at redhat.com
Wed Jun 12 08:20:50 CEST 2024
On Tue, Jun 11, 2024 at 7:10 PM Nandini Rangaswamy
<nandini.rangaswamy at 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
More information about the users
mailing list