Subject: Re: [PATCH RFC] tun: export underlying socket

From: "Michael S. Tsirkin" <[email-masked]>
Date: Tue, 15 Sep 2009 16:18:39 +0300

On Tue, Sep 15, 2009 at 04:11:22PM +0300, Or Gerlitz wrote:
> On 9/14/09, Michael S. Tsirkin <[email-masked]> wrote:
> >> 3. for tun fd
> >> VM.TX is translated by vhost to sendmsg which is translated by tun to
> >> netif_rx which is then handled by the bridge
> >> NIC RX  goes to the bridge which xmits the packet a tun interface, now
> >> what makes tun provide this packet to vhost and how it is done?
> 
> > Same as above. vhost polls tun and calls recvmsg on the socket
> 
> no, correct if I'm wrong, but recvmsg calls tun_do_read and the later
> calls tun_put_user to the packet goes to user space and not into the virtq
> 
> Or.

It ends up in the virtq because that maps userspace addresses.
This is the same as with packet sockets, really.

-- 
MST