Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-27 Thread Rusty Russell
On Thu, 27 Aug 2009 02:26:55 am Michael S. Tsirkin wrote: On Tue, Aug 25, 2009 at 04:16:34PM +0300, Michael S. Tsirkin wrote: + /* If they don't want an interrupt, don't send one, unless empty. */ + if ((flags VRING_AVAIL_F_NO_INTERRUPT) vq-inflight) +

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-27 Thread Michael S. Tsirkin
On Wed, Aug 26, 2009 at 03:40:59PM +0200, Arnd Bergmann wrote: On Tuesday 25 August 2009, Michael S. Tsirkin wrote: I'd like to avoid that here, though it's kind of ugly. We'd need VHOST_GET_FEATURES (and ACK) to take a struct like: u32 feature_size; u32

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-27 Thread Michael S. Tsirkin
On Tue, Aug 25, 2009 at 09:40:40PM +0930, Rusty Russell wrote: Also, see other fixes to the lguest launcher since then which might be relevant to this code: lguest: get more serious about wmb() in example Launcher code Heh, this just gets one step closer to a real wmb. I just used the

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-27 Thread Rusty Russell
On Thu, 27 Aug 2009 07:40:26 pm Michael S. Tsirkin wrote: On Wed, Aug 26, 2009 at 03:40:59PM +0200, Arnd Bergmann wrote: On Tuesday 25 August 2009, Michael S. Tsirkin wrote: I'd like to avoid that here, though it's kind of ugly. We'd need VHOST_GET_FEATURES (and ACK) to take a

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-27 Thread Rusty Russell
On Thu, 27 Aug 2009 08:15:18 pm Michael S. Tsirkin wrote: On Tue, Aug 25, 2009 at 09:40:40PM +0930, Rusty Russell wrote: Also, see other fixes to the lguest launcher since then which might be relevant to this code: lguest: get more serious about wmb() in example Launcher code Heh,

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-27 Thread Michael S. Tsirkin
On Thu, Aug 27, 2009 at 08:40:02PM +0930, Rusty Russell wrote: On Thu, 27 Aug 2009 08:15:18 pm Michael S. Tsirkin wrote: On Tue, Aug 25, 2009 at 09:40:40PM +0930, Rusty Russell wrote: Also, see other fixes to the lguest launcher since then which might be relevant to this code:

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-26 Thread Arnd Bergmann
On Tuesday 25 August 2009, Michael S. Tsirkin wrote: I'd like to avoid that here, though it's kind of ugly. We'd need VHOST_GET_FEATURES (and ACK) to take a struct like: u32 feature_size; u32 features[]; Hmm, variable length ioctl arguments, I'd rather not go there. The

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-26 Thread Michael S. Tsirkin
On Wed, Aug 26, 2009 at 03:40:59PM +0200, Arnd Bergmann wrote: On Tuesday 25 August 2009, Michael S. Tsirkin wrote: I'd like to avoid that here, though it's kind of ugly. We'd need VHOST_GET_FEATURES (and ACK) to take a struct like: u32 feature_size; u32

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-26 Thread Michael S. Tsirkin
On Tue, Aug 25, 2009 at 04:16:34PM +0300, Michael S. Tsirkin wrote: + /* If they don't want an interrupt, don't send one, unless empty. */ + if ((flags VRING_AVAIL_F_NO_INTERRUPT) vq-inflight) + return; And I wouldn't support notify on empty at all, TBH. If I don't,

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-25 Thread Michael S. Tsirkin
Thanks for the comments, I'll work on them ASAP. Answers to questions and more comments below. On Tue, Aug 25, 2009 at 09:40:40PM +0930, Rusty Russell wrote: On Thu, 20 Aug 2009 12:33:09 am Michael S. Tsirkin wrote: What it is: vhost net is a character device that can be used to reduce the

Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server

2009-08-25 Thread Michael S. Tsirkin
On Tue, Aug 25, 2009 at 09:40:40PM +0930, Rusty Russell wrote: + u32 __user *featurep = argp; + int __user *fdp = argp; + u32 features; + int fd, r; + switch (ioctl) { + case VHOST_NET_SET_SOCKET: + r = get_user(fd, fdp); + if (r 0) +