Re: [Qemu-devel] difference between receive_raw() and receive() NetClientInfo methods ?

2013-06-07 Thread Stefan Hajnoczi
On Thu, Jun 06, 2013 at 11:40:37AM +0200, Luigi Rizzo wrote:
 Can someone clarify what is the difference between the two methods
 r
 eceive_raw() and receive() in NetClientInfo ?

receive_raw() builds an empty vnet header, if necessary.  It is used to
send a gratuitous ARP reply from inside QEMU.

In the case where the NIC and its peer use vnet headers, packets
generated by QEMU internally cannot use -receive() since they don't
know how to use the vnet header.  -receive_raw() takes care of that.

Stefan



[Qemu-devel] difference between receive_raw() and receive() NetClientInfo methods ?

2013-06-06 Thread Luigi Rizzo
Can someone clarify what is the difference between the two methods
r
eceive_raw() and receive() in NetClientInfo ?

tap seems to be the only backend actually implementing receive_raw(),
but apart from prepending a vnet_hdr i cannot tell what is this for,
and whether receive_raw() is a custom addon for tap, or it can be used
by other backends to implement different features.

The reason I am asking is that we are working on a fewer copies
path between guests, and one of the things we need is an
asynchronous receive so that a backend can notify the frontend
when a buffer has been actually consumed.
Right now nc-info-receive() and friends are all synchronous,
and there is no mechanism to support asynchronous completion,
which forces the backend to make a copy if it cannot
complete the request inline.
Hence i probably need to add another method to NetClientInfo
so that the frontend can register the callback, or pass it to
the backend together with the buffer/iov

thanks
luigi