Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about vhost-user #1430

Open
ztz1989 opened this issue Jul 8, 2019 · 0 comments
Open

Question about vhost-user #1430

ztz1989 opened this issue Jul 8, 2019 · 0 comments

Comments

@ztz1989
Copy link

ztz1989 commented Jul 8, 2019

Dear experts of snabb, I have a question about snabb vhost-user server/client mode implementation. I am trying to use snabb to create a loopback forwarding scenario with Docker container. The configuration is illustrated in the following figure:
image

Basically, I transmit 14.88Mpps packets at 10Gbps rate to NIC1, snabb forwards the traffic to a VNF running DPDK l2fwd in a docker container. When the VNF forwards the traffic back, snabb proceeds to forward them out of NIC0. The communication between snabb and Docker is realized using the vhost-user protocol. I use a customized lua script in another thread to interconnect the physical/virtual interfaces:

` ...
config.app(c, "nic1", Intel82599, {pciaddr = pciaddr1})
config.app(c, "nic2", Intel82599, {pciaddr = pciaddr2})

config.app(c, "vi1", vhostuser.VhostUser, {socket_path="/tmp/snabb/vhost-user-1",is_server=true})
config.app(c, "vi2",vhostuser.VhostUser, {socket_path="/tmp/snabb/vhost-user-2",is_server=true})

config.link(c, "nic1.tx -> vi1.rx")
config.link(c, "vi2.tx -> nic2.rx")
...
`

Note that snabb is the server end of vhost-user. I start this snabb script, and then the Docker by mapping hugepage and the socket path:
sudo docker run -it --name=l2fwd-docker-snabb -v /dev/hugepages:/dev/hugepages -v /tmp/snabb:/tmp/snabb --privileged l2fwd

I start the dpdk l2fwd app inside the docker using --vdev option to specify virtio interface and the same unix socket path:
./build/l2fwd -c 0x500 -n 1 --socket-mem=16,0 --vdev 'net_virtio_user2,mac=00:00:00:00:00:02,path=/tmp/snabb/vhost-user-1' --vdev 'net_virtio_user3,mac=00:00:00:00:00:03,path=/tmp/snabb/vhost-user-2' -- -p 0x3 -T 1

However, the dpdk l2fwd app got stuck indefinitely upon initialization inside the Docker. while on the snabb side, there is no message exchange at all with the docker side to specify vhost parameters such as vrings, etc. Could you give me some hints about this problem? Any advice or help is highly appreciated.

Best regards,
Tianzhu

ps:
Some additional information:
1, I reran the same tests for other software switches including BESS, OVS-DPDK, FastClick, and VPP, I didn't encounter the same problem.
2, Some tweaks to the current setting: if I only specify a single vhost-user interface with a single physical port (only the first half of the current workflow) or just two vhost-user ports (each connect to a different Docker) in the lua script, I can see vhost message exchanges between snabb and Docker, and the forwarding works without any issue.
3, I previously made the same tests for QEMU/KVM virtual machine instead of Docker, and it worked without any issue. The only difference is snabb ran as vhost-user client with the "is_server=false" and QEMU acts as the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant