Implementing a simple TAP PMD to dpdk-vhost structure

Nicolson Ken (ニコルソン ケン) ken.nicolson at jp.panasonic.com
Wed Sep 6 09:52:50 CEST 2023


Hi David,

> Alternatively, did you consider using testpmd with the vhost pmd instead ?

I've tried that before, but as far as I can see from net/vhost/rte_eth_host.c it uses rte_vost_enqueue/dequeue_burst() to basically act as a loopback for the Guest OS. I use:

$ sudo dpdk-testpmd -l 0-3 -n 4 --vdev 'net_tap0' --vdev 'net_vhost1,iface=/tmp/sock0,client=1' -- -i

But if I feed data in using "tcpreplay -I dtap0 ...", "show port stats all" shows everything going into the TAP but nothing is forward to vhost.

Thanks,
Ken

-----Original Message-----
From: David Marchand <david.marchand at redhat.com> 
Sent: Wednesday, September 6, 2023 3:07 PM
To: Nicolson Ken (ニコルソン ケン) <ken.nicolson at jp.panasonic.com>
Cc: users at dpdk.org; Maxime Coquelin <maxime.coquelin at redhat.com>; Xia, Chenbo <chenbo.xia at intel.com>
Subject: Re: Implementing a simple TAP PMD to dpdk-vhost structure

Hello Ken,

On Wed, Sep 6, 2023 at 3:56 AM Nicolson Ken (ニコルソン ケン)
<ken.nicolson at jp.panasonic.com> wrote:
>
> Hi all,
>
> Using dpdk 22.11.2 on Ubuntu 22.04
>
> I have a really simple use case, but I cannot find how to implement it. I've set up QEMU with all the required virtio support, so I just need to configure my Host OS-side. I want to send data from a PCAP file via tcpreplay from the Host to the Guest, so I use this command line:
>
> $ sudo /home/integ/dpdk-stable-22.11.2/build/examples/dpdk-vhost -l 0-3 -n 4 --socket-mem 1024 --vdev 'net_tap0' -- --socket-file /tmp/sock0 --client -p 1
>
> However, this fails with:
>
> EAL: Detected CPU lcores: 20
> EAL: Detected NUMA nodes: 1
> EAL: Detected static linkage of DPDK
> EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
> EAL: Selected IOVA mode 'PA'
> VHOST_PORT: Failed to get VMDq info.
> EAL: Error - exiting with code: 1
>   Cause: Cannot initialize network ports
>
> The offending code is from examples/vhost/main.c:
>
>         if (dev_info.max_vmdq_pools == 0) {
>                 RTE_LOG(ERR, VHOST_PORT, "Failed to get VMDq info.\n");
>                 return -1;
>         }
>
> This is because the TAP PMD doesn't support VMDq pools.
>
> Is there an easy way to get this to work?

This sounds strange to require VMDq support...
Copying Maxime and Chenbo who probably know better about this example code.

Alternatively, did you consider using testpmd with the vhost pmd instead ?


-- 
David Marchand



More information about the users mailing list