DPDK usage discussions
 help / color / mirror / Atom feed
* Compiling testpmd with DPDK netvsc PMD
@ 2024-06-06 21:31 Nandini Rangaswamy
  2024-06-07 10:56 ` David Marchand
  0 siblings, 1 reply; 10+ messages in thread
From: Nandini Rangaswamy @ 2024-06-06 21:31 UTC (permalink / raw)
  To: users

[-- Attachment #1: Type: text/plain, Size: 2269 bytes --]

Hello,
I tried compiling the testpmd with DPDK netvsc for openwrt by setting
CONFIG_RTE_LIBRTE_NETVSC_PMD=y .

However, when I check ldd testpmd, it does not show any of the dpdk shared
libraries including net_netvsc linked to testpmd binary.
ldd dpdk-testpmd
        linux-vdso.so.1 (0x00007ffca1467000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ffb08134000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ffb0812f000)
        libelf.so.1 => /usr/lib/x86_64-linux-gnu/libelf.so.1
(0x00007ffb08111000)
        libpcap.so.1 => not found
        libmlx5.so.1 => /usr/lib/x86_64-linux-gnu/libmlx5.so.1
(0x00007ffb08093000)
        libibverbs.so.1 => /usr/lib/x86_64-linux-gnu/libibverbs.so.1
(0x00007ffb0806d000)
        libIPSec_MB.so.1 => not found
        libcrypto.so.3 => /usr/lib/x86_64-linux-gnu/libcrypto.so.3
(0x00007ffb07c29000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007ffb07c09000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007ffb07c04000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffb079db000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ffb097c1000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ffb079bd000)
        libnl-route-3.so.200 =>
/usr/lib/x86_64-linux-gnu/libnl-route-3.so.200 (0x00007ffb0793a000)
        libnl-3.so.200 => /lib/x86_64-linux-gnu/libnl-3.so.200
(0x00007ffb07917000)

Any ideas on what I am missing here.
Regards,
Nandini

-- 
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of it.

[-- Attachment #2: Type: text/html, Size: 3578 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compiling testpmd with DPDK netvsc PMD
  2024-06-06 21:31 Compiling testpmd with DPDK netvsc PMD Nandini Rangaswamy
@ 2024-06-07 10:56 ` David Marchand
  2024-06-07 23:31   ` Nandini Rangaswamy
  0 siblings, 1 reply; 10+ messages in thread
From: David Marchand @ 2024-06-07 10:56 UTC (permalink / raw)
  To: Nandini Rangaswamy; +Cc: users

Hello,

On Thu, Jun 6, 2024 at 11:32 PM Nandini Rangaswamy
<nandini.rangaswamy@broadcom.com> wrote:
> I tried compiling the testpmd with DPDK netvsc for openwrt by setting CONFIG_RTE_LIBRTE_NETVSC_PMD=y .
>
> However, when I check ldd testpmd, it does not show any of the dpdk shared libraries including net_netvsc linked to testpmd binary.
> ldd dpdk-testpmd
>         linux-vdso.so.1 (0x00007ffca1467000)
>         libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ffb08134000)
>         libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ffb0812f000)
>         libelf.so.1 => /usr/lib/x86_64-linux-gnu/libelf.so.1 (0x00007ffb08111000)
>         libpcap.so.1 => not found
>         libmlx5.so.1 => /usr/lib/x86_64-linux-gnu/libmlx5.so.1 (0x00007ffb08093000)
>         libibverbs.so.1 => /usr/lib/x86_64-linux-gnu/libibverbs.so.1 (0x00007ffb0806d000)
>         libIPSec_MB.so.1 => not found
>         libcrypto.so.3 => /usr/lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007ffb07c29000)
>         libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ffb07c09000)
>         libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ffb07c04000)
>         libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffb079db000)
>         /lib64/ld-linux-x86-64.so.2 (0x00007ffb097c1000)
>         libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ffb079bd000)
>         libnl-route-3.so.200 => /usr/lib/x86_64-linux-gnu/libnl-route-3.so.200 (0x00007ffb0793a000)
>         libnl-3.so.200 => /lib/x86_64-linux-gnu/libnl-3.so.200 (0x00007ffb07917000)

I am not sure what openwrt does wrt DPDK compilation, yet I can give some hints.

DPDK drivers are, by default, statically linked into dpdk binaries
like testpmd, so netvsc would not show up in this listing you tried.
On the other hand, if using dynamically linked drivers, testpmd is not
linked to them. Instead, those shared libraries are found
automatically (for a DPDK global install) or via the -d EAL option.
Then EAL loads those drivers via dlopen().

If you want to ensure that a specific driver is linked in, you may
inspect meson output (which lists enabled drivers), or have a try with
dpdk-pmd-info.py /path/to/dpdk-testpmd.

HTH,

-- 
David Marchand


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compiling testpmd with DPDK netvsc PMD
  2024-06-07 10:56 ` David Marchand
@ 2024-06-07 23:31   ` Nandini Rangaswamy
  2024-06-10  7:50     ` David Marchand
  2024-06-12 14:48     ` Stephen Hemminger
  0 siblings, 2 replies; 10+ messages in thread
From: Nandini Rangaswamy @ 2024-06-07 23:31 UTC (permalink / raw)
  To: David Marchand; +Cc: users

[-- Attachment #1: Type: text/plain, Size: 3860 bytes --]

Hi David,
Thanks for your email. I inspected meson build output and do see that
netvsc is in the list of enabled drivers.
===============
Drivers Enabled
===============

common:
        iavf, mlx5, qat,
bus:
        auxiliary, pci, vdev, vmbus,
mempool:
        bucket, ring, stack,
dma:

net:
        af_packet, bond, e1000, ena, failsafe, gve, i40e, iavf,
        ice, igc, ixgbe, kni, mlx5, *netvsc*, ring, tap,
        vdev_netvsc, vhost, virtio, vmxnet3,

Also, i changed the meson.build default_library=shared from static and it
worked.
Regards,
Nandini

On Fri, Jun 7, 2024 at 3:56 AM David Marchand <david.marchand@redhat.com>
wrote:

> Hello,
>
> On Thu, Jun 6, 2024 at 11:32 PM Nandini Rangaswamy
> <nandini.rangaswamy@broadcom.com> wrote:
> > I tried compiling the testpmd with DPDK netvsc for openwrt by setting
> CONFIG_RTE_LIBRTE_NETVSC_PMD=y .
> >
> > However, when I check ldd testpmd, it does not show any of the dpdk
> shared libraries including net_netvsc linked to testpmd binary.
> > ldd dpdk-testpmd
> >         linux-vdso.so.1 (0x00007ffca1467000)
> >         libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ffb08134000)
> >         libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2
> (0x00007ffb0812f000)
> >         libelf.so.1 => /usr/lib/x86_64-linux-gnu/libelf.so.1
> (0x00007ffb08111000)
> >         libpcap.so.1 => not found
> >         libmlx5.so.1 => /usr/lib/x86_64-linux-gnu/libmlx5.so.1
> (0x00007ffb08093000)
> >         libibverbs.so.1 => /usr/lib/x86_64-linux-gnu/libibverbs.so.1
> (0x00007ffb0806d000)
> >         libIPSec_MB.so.1 => not found
> >         libcrypto.so.3 => /usr/lib/x86_64-linux-gnu/libcrypto.so.3
> (0x00007ffb07c29000)
> >         libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
> (0x00007ffb07c09000)
> >         libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
> (0x00007ffb07c04000)
> >         libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffb079db000)
> >         /lib64/ld-linux-x86-64.so.2 (0x00007ffb097c1000)
> >         libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ffb079bd000)
> >         libnl-route-3.so.200 =>
> /usr/lib/x86_64-linux-gnu/libnl-route-3.so.200 (0x00007ffb0793a000)
> >         libnl-3.so.200 => /lib/x86_64-linux-gnu/libnl-3.so.200
> (0x00007ffb07917000)
>
> I am not sure what openwrt does wrt DPDK compilation, yet I can give some
> hints.
>
> DPDK drivers are, by default, statically linked into dpdk binaries
> like testpmd, so netvsc would not show up in this listing you tried.
> On the other hand, if using dynamically linked drivers, testpmd is not
> linked to them. Instead, those shared libraries are found
> automatically (for a DPDK global install) or via the -d EAL option.
> Then EAL loads those drivers via dlopen().
>
> If you want to ensure that a specific driver is linked in, you may
> inspect meson output (which lists enabled drivers), or have a try with
> dpdk-pmd-info.py /path/to/dpdk-testpmd.
>
> HTH,
>
> --
> David Marchand
>
>

-- 
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of it.

[-- Attachment #2: Type: text/html, Size: 4656 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compiling testpmd with DPDK netvsc PMD
  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:10       ` Nandini Rangaswamy
  2024-06-12 14:48     ` Stephen Hemminger
  1 sibling, 2 replies; 10+ messages in thread
From: David Marchand @ 2024-06-10  7:50 UTC (permalink / raw)
  To: Nandini Rangaswamy; +Cc: users

Hello,

On Sat, Jun 8, 2024 at 1:32 AM Nandini Rangaswamy
<nandini.rangaswamy@broadcom.com> wrote:
> Thanks for your email. I inspected meson build output and do see that netvsc is in the list of enabled drivers.
> ===============
> Drivers Enabled
> ===============
>
> common:
>         iavf, mlx5, qat,
> bus:
>         auxiliary, pci, vdev, vmbus,
> mempool:
>         bucket, ring, stack,
> dma:
>
> net:
>         af_packet, bond, e1000, ena, failsafe, gve, i40e, iavf,
>         ice, igc, ixgbe, kni, mlx5, netvsc, ring, tap,
>         vdev_netvsc, vhost, virtio, vmxnet3,

Ok, so the driver seems indeed part of this build, yet it was not
functional at runtime?
Could you confirm this driver was indeed embeeded in (*statically*
linked) testpmd?
$ ./usertools/dpdk-pmdinfo.py build/app/dpdk-testpmd | grep -i vsc
    "name": "net_netvsc",
    "name": "net_vdev_netvsc",


>
> Also, i changed the meson.build default_library=shared from static and it worked.

Mm, the fact that changing link mode fixes the issue points at a link issue.

There is a bug with old pkg-config tool (<= 0.27 iirc) that does not
process correctly dpdk .pc (for static link).
It is worth checking which version of pkgconf is used in openwrt.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compiling testpmd with DPDK netvsc PMD
  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
  1 sibling, 1 reply; 10+ messages in thread
From: Stephen Hemminger @ 2024-06-11 14:35 UTC (permalink / raw)
  To: David Marchand; +Cc: Nandini Rangaswamy, users

On Mon, 10 Jun 2024 09:50:42 +0200
David Marchand <david.marchand@redhat.com> wrote:

> Hello,
> 
> On Sat, Jun 8, 2024 at 1:32 AM Nandini Rangaswamy
> <nandini.rangaswamy@broadcom.com> wrote:
> > Thanks for your email. I inspected meson build output and do see that netvsc is in the list of enabled drivers.
> > ===============
> > Drivers Enabled
> > ===============
> >
> > common:
> >         iavf, mlx5, qat,
> > bus:
> >         auxiliary, pci, vdev, vmbus,
> > mempool:
> >         bucket, ring, stack,
> > dma:
> >
> > net:
> >         af_packet, bond, e1000, ena, failsafe, gve, i40e, iavf,
> >         ice, igc, ixgbe, kni, mlx5, netvsc, ring, tap,
> >         vdev_netvsc, vhost, virtio, vmxnet3,  
> 
> Ok, so the driver seems indeed part of this build, yet it was not
> functional at runtime?
> Could you confirm this driver was indeed embeeded in (*statically*
> linked) testpmd?
> $ ./usertools/dpdk-pmdinfo.py build/app/dpdk-testpmd | grep -i vsc
>     "name": "net_netvsc",
>     "name": "net_vdev_netvsc",
> 
> 
> >
> > Also, i changed the meson.build default_library=shared from static and it worked.  
> 
> Mm, the fact that changing link mode fixes the issue points at a link issue.
> 
> There is a bug with old pkg-config tool (<= 0.27 iirc) that does not
> process correctly dpdk .pc (for static link).
> It is worth checking which version of pkgconf is used in openwrt.
> 
> 

Does the openwrt kernel include the uio_hv_generic driver?
Did you bind the network device to uio_hv_generic as described in the
documentation: https://doc.dpdk.org/guides/nics/netvsc.html


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compiling testpmd with DPDK netvsc PMD
  2024-06-11 14:35       ` Stephen Hemminger
@ 2024-06-11 17:00         ` Nandini Rangaswamy
  0 siblings, 0 replies; 10+ messages in thread
From: Nandini Rangaswamy @ 2024-06-11 17:00 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David Marchand, users

[-- Attachment #1: Type: text/plain, Size: 2748 bytes --]

Hi Stephen,
It does include the driver and has been bounded as described in the
documentation.
Regards,
Nandini

On Tue, Jun 11, 2024 at 7:35 AM Stephen Hemminger <
stephen@networkplumber.org> wrote:

> On Mon, 10 Jun 2024 09:50:42 +0200
> David Marchand <david.marchand@redhat.com> wrote:
>
> > Hello,
> >
> > On Sat, Jun 8, 2024 at 1:32 AM Nandini Rangaswamy
> > <nandini.rangaswamy@broadcom.com> wrote:
> > > Thanks for your email. I inspected meson build output and do see that
> netvsc is in the list of enabled drivers.
> > > ===============
> > > Drivers Enabled
> > > ===============
> > >
> > > common:
> > >         iavf, mlx5, qat,
> > > bus:
> > >         auxiliary, pci, vdev, vmbus,
> > > mempool:
> > >         bucket, ring, stack,
> > > dma:
> > >
> > > net:
> > >         af_packet, bond, e1000, ena, failsafe, gve, i40e, iavf,
> > >         ice, igc, ixgbe, kni, mlx5, netvsc, ring, tap,
> > >         vdev_netvsc, vhost, virtio, vmxnet3,
> >
> > Ok, so the driver seems indeed part of this build, yet it was not
> > functional at runtime?
> > Could you confirm this driver was indeed embeeded in (*statically*
> > linked) testpmd?
> > $ ./usertools/dpdk-pmdinfo.py build/app/dpdk-testpmd | grep -i vsc
> >     "name": "net_netvsc",
> >     "name": "net_vdev_netvsc",
> >
> >
> > >
> > > Also, i changed the meson.build default_library=shared from static and
> it worked.
> >
> > Mm, the fact that changing link mode fixes the issue points at a link
> issue.
> >
> > There is a bug with old pkg-config tool (<= 0.27 iirc) that does not
> > process correctly dpdk .pc (for static link).
> > It is worth checking which version of pkgconf is used in openwrt.
> >
> >
>
> Does the openwrt kernel include the uio_hv_generic driver?
> Did you bind the network device to uio_hv_generic as described in the
> documentation: https://doc.dpdk.org/guides/nics/netvsc.html
>
>

-- 
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of it.

[-- Attachment #2: Type: text/html, Size: 3709 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compiling testpmd with DPDK netvsc PMD
  2024-06-10  7:50     ` David Marchand
  2024-06-11 14:35       ` Stephen Hemminger
@ 2024-06-11 17:10       ` Nandini Rangaswamy
  2024-06-12  6:20         ` David Marchand
  1 sibling, 1 reply; 10+ messages in thread
From: Nandini Rangaswamy @ 2024-06-11 17:10 UTC (permalink / raw)
  To: David Marchand; +Cc: users, Stephen Hemminger

[-- Attachment #1: Type: text/plain, Size: 3111 bytes --]

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.
Regards,
Nandini

On Mon, Jun 10, 2024 at 12:51 AM David Marchand <david.marchand@redhat.com>
wrote:

> Hello,
>
> On Sat, Jun 8, 2024 at 1:32 AM Nandini Rangaswamy
> <nandini.rangaswamy@broadcom.com> wrote:
> > Thanks for your email. I inspected meson build output and do see that
> netvsc is in the list of enabled drivers.
> > ===============
> > Drivers Enabled
> > ===============
> >
> > common:
> >         iavf, mlx5, qat,
> > bus:
> >         auxiliary, pci, vdev, vmbus,
> > mempool:
> >         bucket, ring, stack,
> > dma:
> >
> > net:
> >         af_packet, bond, e1000, ena, failsafe, gve, i40e, iavf,
> >         ice, igc, ixgbe, kni, mlx5, netvsc, ring, tap,
> >         vdev_netvsc, vhost, virtio, vmxnet3,
>
> Ok, so the driver seems indeed part of this build, yet it was not
> functional at runtime?
> Could you confirm this driver was indeed embeeded in (*statically*
> linked) testpmd?
> $ ./usertools/dpdk-pmdinfo.py build/app/dpdk-testpmd | grep -i vsc
>     "name": "net_netvsc",
>     "name": "net_vdev_netvsc",
>
>
> >
> > Also, i changed the meson.build default_library=shared from static and
> it worked.
>
> Mm, the fact that changing link mode fixes the issue points at a link
> issue.
>
> There is a bug with old pkg-config tool (<= 0.27 iirc) that does not
> process correctly dpdk .pc (for static link).
> It is worth checking which version of pkgconf is used in openwrt.
>
>
> --
> David Marchand
>
>

-- 
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of it.

[-- Attachment #2: Type: text/html, Size: 3907 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compiling testpmd with DPDK netvsc PMD
  2024-06-11 17:10       ` Nandini Rangaswamy
@ 2024-06-12  6:20         ` David Marchand
  0 siblings, 0 replies; 10+ messages in thread
From: David Marchand @ 2024-06-12  6:20 UTC (permalink / raw)
  To: Nandini Rangaswamy; +Cc: users, Stephen Hemminger

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compiling testpmd with DPDK netvsc PMD
  2024-06-07 23:31   ` Nandini Rangaswamy
  2024-06-10  7:50     ` David Marchand
@ 2024-06-12 14:48     ` Stephen Hemminger
  2024-06-12 18:53       ` Nandini Rangaswamy
  1 sibling, 1 reply; 10+ messages in thread
From: Stephen Hemminger @ 2024-06-12 14:48 UTC (permalink / raw)
  To: Nandini Rangaswamy; +Cc: David Marchand, users

On Fri, 7 Jun 2024 16:31:51 -0700
Nandini Rangaswamy <nandini.rangaswamy@broadcom.com> wrote:

> Hi David,
> Thanks for your email. I inspected meson build output and do see that
> netvsc is in the list of enabled drivers.
> ===============
> Drivers Enabled
> ===============
> 
> common:
>         iavf, mlx5, qat,
> bus:
>         auxiliary, pci, vdev, vmbus,
> mempool:
>         bucket, ring, stack,
> dma:
> 
> net:
>         af_packet, bond, e1000, ena, failsafe, gve, i40e, iavf,
>         ice, igc, ixgbe, kni, mlx5, *netvsc*, ring, tap,
>         vdev_netvsc, vhost, virtio, vmxnet3,
> 
> Also, i changed the meson.build default_library=shared from static and it
> worked.
> Regards,
> Nandini
> 
> On Fri, Jun 7, 2024 at 3:56 AM David Marchand <david.marchand@redhat.com>
> wrote:
> 
> > Hello,
> >
> > On Thu, Jun 6, 2024 at 11:32 PM Nandini Rangaswamy
> > <nandini.rangaswamy@broadcom.com> wrote:  
> > > I tried compiling the testpmd with DPDK netvsc for openwrt by setting  
> > CONFIG_RTE_LIBRTE_NETVSC_PMD=y .  
> > >
> > > However, when I check ldd testpmd, it does not show any of the dpdk  
> > shared libraries including net_netvsc linked to testpmd binary.  

Testpmd is a special case. It always is statically linked because it has to
have several drivers private API's.  So using ldd to check is not going to give
the right answer.

What is the startup of testpmd look like? You may need to enable debugging of
vmbus and netvsc to see all the reasons the driver decided not to be probed.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Compiling testpmd with DPDK netvsc PMD
  2024-06-12 14:48     ` Stephen Hemminger
@ 2024-06-12 18:53       ` Nandini Rangaswamy
  0 siblings, 0 replies; 10+ messages in thread
From: Nandini Rangaswamy @ 2024-06-12 18:53 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David Marchand, users

[-- Attachment #1: Type: text/plain, Size: 3424 bytes --]

Hello David and Stephen,
Thanks for your inputs.
As suggested , I compiled testpmd after removing the change below.
+if dpdk_conf.has('RTE_NET_NETVSC')
> +    deps += 'net_netvsc'
> +endif
I ran testpmd with -d option and EAL logging enabled and confirmed that
netvsc driver's .so file is being picked by EAL.

@Stephen Hemminger <stephen@networkplumber.org> I also enabled VMBUS logs
as per your suggestion and saw that vmbus drivers were being probed.
vmbus_probe_one_driver(): VMBUS device 000d3a42-f83c-000d-3a42-f83c000d3a42
on NUMA socket -1
vmbus_probe_one_driver():   probe driver: net_netvsc
hn_vf_attach(): found matching VF port 0
vmbus_probe_one_driver(): VMBUS device 000d3a42-fbcd-000d-3a42-fbcd000d3a42
on NUMA socket -1
vmbus_probe_one_driver():   probe driver: net_netvsc
hn_vf_attach(): found matching VF port 1

Regards,
Nandini


On Wed, Jun 12, 2024 at 7:48 AM Stephen Hemminger <
stephen@networkplumber.org> wrote:

> On Fri, 7 Jun 2024 16:31:51 -0700
> Nandini Rangaswamy <nandini.rangaswamy@broadcom.com> wrote:
>
> > Hi David,
> > Thanks for your email. I inspected meson build output and do see that
> > netvsc is in the list of enabled drivers.
> > ===============
> > Drivers Enabled
> > ===============
> >
> > common:
> >         iavf, mlx5, qat,
> > bus:
> >         auxiliary, pci, vdev, vmbus,
> > mempool:
> >         bucket, ring, stack,
> > dma:
> >
> > net:
> >         af_packet, bond, e1000, ena, failsafe, gve, i40e, iavf,
> >         ice, igc, ixgbe, kni, mlx5, *netvsc*, ring, tap,
> >         vdev_netvsc, vhost, virtio, vmxnet3,
> >
> > Also, i changed the meson.build default_library=shared from static and it
> > worked.
> > Regards,
> > Nandini
> >
> > On Fri, Jun 7, 2024 at 3:56 AM David Marchand <david.marchand@redhat.com
> >
> > wrote:
> >
> > > Hello,
> > >
> > > On Thu, Jun 6, 2024 at 11:32 PM Nandini Rangaswamy
> > > <nandini.rangaswamy@broadcom.com> wrote:
> > > > I tried compiling the testpmd with DPDK netvsc for openwrt by
> setting
> > > CONFIG_RTE_LIBRTE_NETVSC_PMD=y .
> > > >
> > > > However, when I check ldd testpmd, it does not show any of the dpdk
> > > shared libraries including net_netvsc linked to testpmd binary.
>
> Testpmd is a special case. It always is statically linked because it has to
> have several drivers private API's.  So using ldd to check is not going to
> give
> the right answer.
>
> What is the startup of testpmd look like? You may need to enable debugging
> of
> vmbus and netvsc to see all the reasons the driver decided not to be
> probed.
>

-- 
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of it.

[-- Attachment #2: Type: text/html, Size: 4700 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-06-12 18:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-06 21:31 Compiling testpmd with DPDK netvsc PMD 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
2024-06-12 14:48     ` Stephen Hemminger
2024-06-12 18:53       ` Nandini Rangaswamy

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