qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Question about libvhost-user and vhost-user-bridge.c


From: William Tu
Subject: [Qemu-devel] Question about libvhost-user and vhost-user-bridge.c
Date: Wed, 14 Aug 2019 10:54:34 -0700

Hi,

I'm using libvhost-user.a to write a vhost backend, in order to receive and
send packets from/to VMs from OVS. I started by reading the vhost-user-bridge.c.
I can now pass the initialization stage, seeing .queue_set_started get invoked.

However, I am stuck at receiving the packet from VM.
So is it correct to do:
1) check vu_queue_empty, started, and aval_bytes, if OK, then
2) elem = vu_queue_pop(&dev->vudev, vq, sizeof(VuVirtqElement));
3) the packet payload should be at elem->in_sg->iov_base + hdrlen? or
at elem->out_sg?

I tried to hex dump the iov_base, but the content doesn't look like
having a ethernet header. I saw in vubr_backend_recv_cb at vhost-user-bridge.c,
we're creating another iovec and recvmsg(vubr->backend_udp_sock, &msg, 0);
I don't think I have to create backend UDP sock, am I correct?

Thanks
William



reply via email to

[Prev in Thread] Current Thread [Next in Thread]