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

2013-01-21 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Jan 17, 2013 at 12:40:29PM +1030, Rusty Russell wrote: >> I resist sprinkling __user everywhere because it's *not* always user >> addresses, and it's deeply misleading to anyone reading it. I'd rather >> have it in one place with a big comment. >> I can try

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

2013-01-21 Thread Rusty Russell
Michael S. Tsirkin m...@redhat.com writes: On Thu, Jan 17, 2013 at 12:40:29PM +1030, Rusty Russell wrote: I resist sprinkling __user everywhere because it's *not* always user addresses, and it's deeply misleading to anyone reading it. I'd rather have it in one place with a big comment. I can

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

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

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" writes: > > On Wed, Jan 16, 2013 at 01:43:32PM +1030, Rusty Russell wrote: > >> "Michael S. Tsirkin" writes: > >> >> +static int resize_iovec(struct vringh_iov *iov, gfp_t gfp) > >> >> +{ > >> >> + struct

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 Rusty Russell
"Michael S. Tsirkin" writes: > On Wed, Jan 16, 2013 at 01:43:32PM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" 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-16 Thread Michael S. Tsirkin
On Wed, Jan 16, 2013 at 01:43:32PM +1030, Rusty Russell wrote: > "Michael S. Tsirkin" 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 > >

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" 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-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 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

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 Rusty Russell
Sjur Brændeland 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 Sjur Brændeland
On Fri, Jan 11, 2013 at 7:37 AM, Rusty Russell 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 the in-kernel API

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 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 pronounce it like

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-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 Rusty Russell
Sjur Brændeland writes: > Hi Rusty, > > On Thu, Jan 10, 2013 at 11:30 AM, Rusty Russell 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 you send out a proper patch.

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

2013-01-10 Thread Sjur Brændeland
Hi Rusty, On Thu, Jan 10, 2013 at 11:30 AM, Rusty Russell 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 you send out a proper patch. ... > diff --git

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 -- To unsubscribe from this list:

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

2013-01-10 Thread Rusty Russell
Rusty Russell 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 by end of today,

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

2013-01-10 Thread Sjur Brændeland
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 you send out a proper patch. ... diff --git

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 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 -- To unsubscribe from this list: send