qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Question about libvhost-user and vhost-user-bridge.c
@ 2019-08-14 17:54 William Tu
  2019-08-15 14:07 ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: William Tu @ 2019-08-14 17:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: mst

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


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

end of thread, other threads:[~2019-08-15 16:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-14 17:54 [Qemu-devel] Question about libvhost-user and vhost-user-bridge.c William Tu
2019-08-15 14:07 ` Stefan Hajnoczi
2019-08-15 16:25   ` William Tu

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