Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-18 Thread Rusty Russell
Rusty Russell ru...@rustcorp.com.au writes: Michael S. Tsirkin m...@redhat.com writes: On Wed, Jan 16, 2013 at 01:43:32PM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: +static int resize_iovec(struct vringh_iov *iov, gfp_t gfp) +{ +struct iovec *new; +

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-17 Thread Michael S. Tsirkin
On Thu, Jan 17, 2013 at 12:40:29PM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Wed, Jan 16, 2013 at 01:43:32PM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: +static int resize_iovec(struct vringh_iov *iov, gfp_t gfp) +{ +

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-16 Thread Michael S. Tsirkin
On Wed, Jan 16, 2013 at 01:43:32PM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: +static int resize_iovec(struct vringh_iov *iov, gfp_t gfp) +{ + struct iovec *new; + unsigned int new_num = iov-max * 2; We must limit this I think, this is coming from

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-16 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Wed, Jan 16, 2013 at 01:43:32PM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: +static int resize_iovec(struct vringh_iov *iov, gfp_t gfp) +{ + struct iovec *new; + unsigned int new_num = iov-max * 2; We must limit

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-15 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: +static int resize_iovec(struct vringh_iov *iov, gfp_t gfp) +{ +struct iovec *new; +unsigned int new_num = iov-max * 2; We must limit this I think, this is coming from userspace. How about UIO_MAXIOV? We limit it to the ring size already;

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-14 Thread Michael S. Tsirkin
On Sat, Jan 12, 2013 at 10:50:30AM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Fri, Jan 11, 2013 at 09:18:33AM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Thu, Jan 10, 2013 at 09:00:55PM +1030, Rusty Russell wrote: Not sure why

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-14 Thread Michael S. Tsirkin
On Fri, Jan 11, 2013 at 05:07:44PM +1030, Rusty Russell wrote: Untested, but I wanted to post before the weekend. I think the implementation is a bit nicer, and though we have a callback to get the guest-to-userspace offset, it might be faster since I think most cases will re-use the same

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-11 Thread Sjur Brændeland
On Fri, Jan 11, 2013 at 12:35 AM, Rusty Russell ru...@rustcorp.com.au wrote: Hi Sjur! OK, the Internet was no help here, how do you pronounce Sjur? I'm guessing shoor rhyming with tour until I know better. Thank you for asking! This is pretty close yes. I usually tell people to

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-11 Thread Sjur Brændeland
On Fri, Jan 11, 2013 at 7:37 AM, Rusty Russell ru...@rustcorp.com.au wrote: virtio_host: host-side implementation of virtio rings (untested!) Getting use of virtio rings correct is tricky, and a recent patch saw an implementation of in-kernel rings (as separate from userspace). How do you see

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-11 Thread Rusty Russell
Sjur Brændeland sjurb...@gmail.com writes: How do you see the in-kernel API for this? I would like to see something similar to my previous patches, where we extend the virtqueue API. E.g. something like this: struct virtqueue *vring_new_virtqueueh(unsigned int index,

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-11 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Fri, Jan 11, 2013 at 09:18:33AM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Thu, Jan 10, 2013 at 09:00:55PM +1030, Rusty Russell wrote: Not sure why vhost/net doesn't built a packet and feed it in netif_rx_ni().

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-10 Thread Rusty Russell
Rusty Russell ru...@rustcorp.com.au writes: It basically involves moving much of vring.c into a virtio_host.c: the parts which actually touch the ring. Then it provides accessors for vring.c to use which are __user-safe (all casts are inside virtio_host.c). I should have something to post

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-10 Thread Michael S. Tsirkin
On Thu, Jan 10, 2013 at 09:00:55PM +1030, Rusty Russell wrote: Not sure why vring/net doesn't built a packet and feed it in netif_rx_ni(). This is what tun seems to do, and with this code it should be fairly optimal. Because we want to use NAPI. -- MST

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-10 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Thu, Jan 10, 2013 at 09:00:55PM +1030, Rusty Russell wrote: Not sure why vhost/net doesn't built a packet and feed it in netif_rx_ni(). This is what tun seems to do, and with this code it should be fairly optimal. Because we want to use NAPI.

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-10 Thread Rusty Russell
Sjur Brændeland sjurb...@gmail.com writes: Hi Rusty, On Thu, Jan 10, 2013 at 11:30 AM, Rusty Russell ru...@rustcorp.com.au wrote: ... I now have some lightly-tested code (via a userspace harness). Great - thank you for looking into this. I will start integrating this with my patches when

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-10 Thread Rusty Russell
Untested, but I wanted to post before the weekend. I think the implementation is a bit nicer, and though we have a callback to get the guest-to-userspace offset, it might be faster since I think most cases will re-use the same mapping. Feedback on API welcome! Rusty. virtio_host: host-side

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-10 Thread Michael S. Tsirkin
On Fri, Jan 11, 2013 at 09:18:33AM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Thu, Jan 10, 2013 at 09:00:55PM +1030, Rusty Russell wrote: Not sure why vhost/net doesn't built a packet and feed it in netif_rx_ni(). This is what tun seems to do, and with this

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-08 Thread Sjur Brændeland
On Fri, Dec 21, 2012 at 7:11 AM, Rusty Russell ru...@rustcorp.com.au wrote: Michael S. Tsirkin m...@redhat.com writes: On Wed, Dec 05, 2012 at 03:36:58PM +0100, Sjur Brændeland wrote: Feedback on this patch-set is appreciated, particularly on structure and code-reuse between vhost.c and the

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-08 Thread Rusty Russell
Sjur Brændeland sjurb...@gmail.com writes: On Fri, Dec 21, 2012 at 7:11 AM, Rusty Russell ru...@rustcorp.com.au wrote: Michael S. Tsirkin m...@redhat.com writes: On Wed, Dec 05, 2012 at 03:36:58PM +0100, Sjur Brændeland wrote: Feedback on this patch-set is appreciated, particularly on

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2012-12-20 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Wed, Dec 05, 2012 at 03:36:58PM +0100, Sjur Brændeland wrote: Feedback on this patch-set is appreciated, particularly on structure and code-reuse between vhost.c and the host-side virtio-queue. I'd also like some suggestions on how to handle the

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2012-12-06 Thread Michael S. Tsirkin
On Wed, Dec 05, 2012 at 03:36:58PM +0100, Sjur Brændeland wrote: Feedback on this patch-set is appreciated, particularly on structure and code-reuse between vhost.c and the host-side virtio-queue. I'd also like some suggestions on how to handle the build configuration better - currently there

[RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2012-12-05 Thread Sjur Brændeland
From: Sjur Brændeland sjur.brandel...@stericsson.com This patch-set introduces a host-side virtqueue implementation and the CAIF Virtio Link layer. See http://lwn.net/Articles/522296/ for background info on CAIF over Virtio. After feedback from Rusty, I have re-factored vhost.c and pulled out