Re: [PATCH 2/5] /dev/vring: simple userspace-kernel ringbuffer interface.

2008-04-21 Thread Evgeniy Polyakov
On Sun, Apr 20, 2008 at 02:05:31AM +1000, Rusty Russell ([EMAIL PROTECTED]) wrote: > > Should this whole function and vring_used_buffer() be protected with > > vr->lock mutex? > > No; it's up to the caller to make sure that they are serialized. In the case > of tun that happens naturally. > >

Re: [PATCH 2/5] /dev/vring: simple userspace-kernel ringbuffer interface.

2008-04-21 Thread Evgeniy Polyakov
Hi. On Fri, Apr 18, 2008 at 02:39:48PM +1000, Rusty Russell ([EMAIL PROTECTED]) wrote: > +int vring_get_buffer(struct vring_info *vr, > + struct iovec *in_iov, > + unsigned int *num_in, unsigned long *in_len, > + struct iovec *out_iov, > +

Re: [PATCH 2/5] /dev/vring: simple userspace-kernel ringbuffer interface.

2008-04-19 Thread David Miller
From: Rusty Russell <[EMAIL PROTECTED]> Date: Sun, 20 Apr 2008 02:41:14 +1000 > If only there were some kind of, I don't know... summit... for kernel > people... I'm starting to disbelieve the myth that because we can discuss technical issues on mailing lists, we should talk primarily about pro

Re: [PATCH 2/5] /dev/vring: simple userspace-kernel ringbuffer interface.

2008-04-19 Thread Rusty Russell
On Saturday 19 April 2008 05:38:50 Michael Kerrisk wrote: > On 4/18/08, Andrew Morton <[EMAIL PROTECTED]> wrote: > > This is may be our third high-bandwidth user/kernel interface to > > transport bulk data ("hbukittbd") which was implemented because its > > predecessors weren't quite right. In a y

Re: [PATCH 2/5] /dev/vring: simple userspace-kernel ringbuffer interface.

2008-04-19 Thread Rusty Russell
On Sunday 20 April 2008 02:33:22 Evgeniy Polyakov wrote: > On Sun, Apr 20, 2008 at 02:05:31AM +1000, Rusty Russell ([EMAIL PROTECTED]) wrote: > > There are two reasons not to grab the lock. It turns out that if we > > tried to lock here, we'd deadlock, since the callbacks are called under > > the

Re: [PATCH 2/5] /dev/vring: simple userspace-kernel ringbuffer interface.

2008-04-19 Thread Rusty Russell
On Saturday 19 April 2008 20:22:15 Evgeniy Polyakov wrote: > Hi. > > On Fri, Apr 18, 2008 at 02:39:48PM +1000, Rusty Russell ([EMAIL PROTECTED]) wrote: > > +int vring_get_buffer(struct vring_info *vr, > > +struct iovec *in_iov, > > +unsigned int *num_in, unsigned lo

Re: [PATCH 2/5] /dev/vring: simple userspace-kernel ringbuffer interface.

2008-04-19 Thread Jonathan Corbet
> So I think it would be good to plonk the proposed interface on the table > and have a poke at it. Is it compat-safe? Is it extensible in a > backward-compatible fashion? Are there future-safe changes we should make > to it? Can Michael Kerrisk understand, review and document it? etc. > > Yo

Re: [PATCH 2/5] /dev/vring: simple userspace-kernel ringbuffer interface.

2008-04-18 Thread Michael Kerrisk
On 4/18/08, Andrew Morton <[EMAIL PROTECTED]> wrote: > On Sat, 19 Apr 2008 00:32:39 +1000 Rusty Russell <[EMAIL PROTECTED]> wrote: > > > > Isn't this kinda-sorta like what a relayfs file does? The oprofile > > > buffers? etc? Nothing in common at all, no hope? > > > > An excellent question,

Re: [PATCH 2/5] /dev/vring: simple userspace-kernel ringbuffer interface.

2008-04-18 Thread Andrew Morton
On Sat, 19 Apr 2008 00:32:39 +1000 Rusty Russell <[EMAIL PROTECTED]> wrote: > > Isn't this kinda-sorta like what a relayfs file does? The oprofile > > buffers? etc? Nothing in common at all, no hope? > > An excellent question, but I thought the modern kernel etiquette was to only > comment on

Re: [PATCH 2/5] /dev/vring: simple userspace-kernel ringbuffer interface.

2008-04-18 Thread Rusty Russell
On Friday 18 April 2008 21:18:46 Andrew Morton wrote: > > + /* Must be a power of two, and limit indices to a u16. */ > > + if (!num_descs || (num_descs & (num_descs-1)) || num_descs > 65536) > > We have an is_power_of_2(). Thanks, fixed. > > + * vring_get - check out a vring file descriptor

Re: [PATCH 2/5] /dev/vring: simple userspace-kernel ringbuffer interface.

2008-04-18 Thread Andrew Morton
On Fri, 18 Apr 2008 14:39:48 +1000 Rusty Russell <[EMAIL PROTECTED]> wrote: > virtio introduced a ring structure ABI for guest-host communications > (currently used by lguest and kvm). Using this same ABI, we can > create a nice fd version. > > This is useful for efficiently passing packets to a

[PATCH 2/5] /dev/vring: simple userspace-kernel ringbuffer interface.

2008-04-17 Thread Rusty Russell
virtio introduced a ring structure ABI for guest-host communications (currently used by lguest and kvm). Using this same ABI, we can create a nice fd version. This is useful for efficiently passing packets to and from the tun, for example. Signed-off-by: Rusty Russell <[EMAIL PROTECTED]> --- dr