On 9/6/23 10:28, Nicolson Ken (ニコルソン ケン) wrote:
Hi Maxime,

Maybe you could use testpmd application instead, with net_tap PMD and a 
net_pcap PMD?

I have an existing solution that uses the TAP PMD which I then add to a 
standard kernel bridge that allows me to have two-way communication with the 
Guest VM, but I suspect the performance would be better if we were to use a 
DPDK virtio-based solution; otherwise I could just drop DPDK all together and 
use tcpreplay, etc to directly access the bridge.

Ha yes, I misread the initial thread.
You should indeed use testpmd with Vhost PMD and net_pcap, I'm pretty
sure I've done that in the past.


[Also net_pcap only outputs to kernel interface (or to a file or null) as it 
uses libpcap APIs for Tx]

An alternative to net_tap could be to use Virtio-user PMD with Vhost- kernel 
backend.

That uses KNI, which the documentation says is deprecated, and I'm not sure I 
want to start mucking about with kernel drivers.

Virtio-user PMD with kernel backend is an alternative solution to KNI,
no out-of-tree driver needed. But that should not be the way to go for
your usecase.

Maxime
Thanks,
Ken

-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Wednesday, September 6, 2023 4:16 PM
To: David Marchand <[email protected]>; Nicolson Ken (ニコルソン ケン) 
<[email protected]>
Cc: [email protected]; Xia, Chenbo <[email protected]>
Subject: Re: Implementing a simple TAP PMD to dpdk-vhost structure



On 9/6/23 08:07, David Marchand wrote:
Hello Ken,

On Wed, Sep 6, 2023 at 3:56 AM Nicolson Ken (ニコルソン ケン)
<[email protected]> 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 ?



Maybe you could use testpmd application instead, with net_tap PMD and a 
net_pcap PMD?

An alternative to net_tap could be to use Virtio-user PMD with Vhost- kernel 
backend.

Maxime


Reply via email to