Re: [PATCH] kvm tools: Support virtio indirect buffers

2011-11-30 Thread Rusty Russell
On Mon, 28 Nov 2011 23:05:21 +0200, Sasha Levin levinsasha...@gmail.com wrote: On Mon, 2011-11-28 at 22:17 +0200, Sasha Levin wrote: btw, on an unrelated subject, I think that with this patch we've fully covered the virtio spec, and as far as I know it's the first userspace implementation

Re: [PATCH] kvm tools: Support virtio indirect buffers

2011-11-29 Thread Pekka Enberg
On Tue, 29 Nov 2011, Sasha Levin wrote: +/* + * Each buffer in the virtqueues is actually a chain of descriptors. This + * function returns the next descriptor in the chain, or vq-vring.num if we're + * at the end. + */ +static unsigned next_desc(struct vring_desc *desc, +

Re: [PATCH] kvm tools: Support virtio indirect buffers

2011-11-29 Thread Cyrill Gorcunov
On Tue, Nov 29, 2011 at 03:01:59PM +0200, Pekka Enberg wrote: Hi Sasha, where the rmb() then? Or maybe you wanted plain barrier() here? On the kernel side. Theres a mb there which happens there during the kick. I guess we need to improve the comment in next_desc()? Kernel's code has

[PATCH] kvm tools: Support virtio indirect buffers

2011-11-28 Thread Sasha Levin
Indirect buffers are ring descriptors which point to more (even more) descriptors. This can be used to increase the effective ring capacity, which helps the guest to batch large requests - very useful for blk devices. This patch also enables indirect buffers for virtio-net and virtio-blk. The

Re: [PATCH] kvm tools: Support virtio indirect buffers

2011-11-28 Thread Pekka Enberg
On Mon, Nov 28, 2011 at 7:54 PM, Sasha Levin levinsasha...@gmail.com wrote: Indirect buffers are ring descriptors which point to more (even more) descriptors. This can be used to increase the effective ring capacity, which helps the guest to batch large requests - very useful for blk devices.

Re: [PATCH] kvm tools: Support virtio indirect buffers

2011-11-28 Thread Sasha Levin
On Mon, 2011-11-28 at 20:49 +0200, Pekka Enberg wrote: On Mon, Nov 28, 2011 at 7:54 PM, Sasha Levin levinsasha...@gmail.com wrote: Indirect buffers are ring descriptors which point to more (even more) descriptors. This can be used to increase the effective ring capacity, which helps the

Re: [PATCH] kvm tools: Support virtio indirect buffers

2011-11-28 Thread Sasha Levin
On Mon, 2011-11-28 at 22:17 +0200, Sasha Levin wrote: On Mon, 2011-11-28 at 20:49 +0200, Pekka Enberg wrote: On Mon, Nov 28, 2011 at 7:54 PM, Sasha Levin levinsasha...@gmail.com wrote: Indirect buffers are ring descriptors which point to more (even more) descriptors. This can be

Re: [PATCH] kvm tools: Support virtio indirect buffers

2011-11-28 Thread Cyrill Gorcunov
On Mon, Nov 28, 2011 at 07:54:27PM +0200, Sasha Levin wrote: +/* + * Each buffer in the virtqueues is actually a chain of descriptors. This + * function returns the next descriptor in the chain, or vq-vring.num if we're + * at the end. + */ +static unsigned next_desc(struct vring_desc

Re: [PATCH] kvm tools: Support virtio indirect buffers

2011-11-28 Thread Sasha Levin
On Tue, 2011-11-29 at 10:31 +0400, Cyrill Gorcunov wrote: On Mon, Nov 28, 2011 at 07:54:27PM +0200, Sasha Levin wrote: +/* + * Each buffer in the virtqueues is actually a chain of descriptors. This + * function returns the next descriptor in the chain, or vq-vring.num if we're + *