Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-08 Thread Paul E. McKenney
On Sun, Nov 08, 2009 at 02:39:59PM +1030, Rusty Russell wrote: > On Sat, 7 Nov 2009 03:00:07 am Paul E. McKenney wrote: > > On Fri, Nov 06, 2009 at 03:31:20PM +1030, Rusty Russell wrote: > > > But it's still nasty to use half an API. If it were a few places I would > > > have open-coded it with a

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-07 Thread Rusty Russell
On Sat, 7 Nov 2009 03:00:07 am Paul E. McKenney wrote: > On Fri, Nov 06, 2009 at 03:31:20PM +1030, Rusty Russell wrote: > > But it's still nasty to use half an API. If it were a few places I would > > have open-coded it with a comment, or wrapped it. As it is, I don't think > > that would be a wi

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-05 Thread Rusty Russell
On Thu, 5 Nov 2009 03:55:42 am Paul E. McKenney wrote: > On Wed, Nov 04, 2009 at 01:57:29PM +0200, Michael S. Tsirkin wrote: > > Can you ack this usage please? > > I thought I had done so in my paragraph above, but if you would like > something a bit more formal... That's great guys. And yes,

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Gregory Haskins
Michael S. Tsirkin wrote: > On Wed, Nov 04, 2009 at 09:25:42AM -0800, Paul E. McKenney wrote: >> (Sorry, but, as always, I could not resist!) >> >> Thanx, Paul > > Thanks Paul! > Jonathan: are you reading this? > Another one for your quotes of t

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Wed, Nov 04, 2009 at 09:25:42AM -0800, Paul E. McKenney wrote: > (Sorry, but, as always, I could not resist!) > > Thanx, Paul Thanks Paul! Jonathan: are you reading this? Another one for your quotes of the week collection :) -- MST __

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Eric Dumazet
Paul E. McKenney a écrit : > > (Sorry, but, as always, I could not resist!) Yes :) Thanks Paul for this masterpiece of diplomatic "Acked-by" ;) ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linux-foundat

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Paul E. McKenney
On Wed, Nov 04, 2009 at 01:57:29PM +0200, Michael S. Tsirkin wrote: > On Tue, Nov 03, 2009 at 03:57:44PM -0800, Paul E. McKenney wrote: > > On Tue, Nov 03, 2009 at 01:14:06PM -0500, Gregory Haskins wrote: > > > Gregory Haskins wrote: > > > > Eric Dumazet wrote: > > > >> Michael S. Tsirkin a écrit :

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Wed, Nov 04, 2009 at 03:41:47PM +0200, Michael S. Tsirkin wrote: > On Wed, Nov 04, 2009 at 02:37:28PM +0100, Andi Kleen wrote: > > On Wed, Nov 04, 2009 at 03:17:36PM +0200, Michael S. Tsirkin wrote: > > > On Wed, Nov 04, 2009 at 02:15:33PM +0100, Andi Kleen wrote: > > > > On Wed, Nov 04, 2009 at

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Wed, Nov 04, 2009 at 02:37:28PM +0100, Andi Kleen wrote: > On Wed, Nov 04, 2009 at 03:17:36PM +0200, Michael S. Tsirkin wrote: > > On Wed, Nov 04, 2009 at 02:15:33PM +0100, Andi Kleen wrote: > > > On Wed, Nov 04, 2009 at 03:08:28PM +0200, Michael S. Tsirkin wrote: > > > > On Wed, Nov 04, 2009 at

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Andi Kleen
On Wed, Nov 04, 2009 at 03:17:36PM +0200, Michael S. Tsirkin wrote: > On Wed, Nov 04, 2009 at 02:15:33PM +0100, Andi Kleen wrote: > > On Wed, Nov 04, 2009 at 03:08:28PM +0200, Michael S. Tsirkin wrote: > > > On Wed, Nov 04, 2009 at 01:59:57PM +0100, Andi Kleen wrote: > > > > > Fine? > > > > > > >

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Wed, Nov 04, 2009 at 02:15:33PM +0100, Andi Kleen wrote: > On Wed, Nov 04, 2009 at 03:08:28PM +0200, Michael S. Tsirkin wrote: > > On Wed, Nov 04, 2009 at 01:59:57PM +0100, Andi Kleen wrote: > > > > Fine? > > > > > > I cannot say -- are there paths that could drop the device beforehand? > > >

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Andi Kleen
On Wed, Nov 04, 2009 at 03:08:28PM +0200, Michael S. Tsirkin wrote: > On Wed, Nov 04, 2009 at 01:59:57PM +0100, Andi Kleen wrote: > > > Fine? > > > > I cannot say -- are there paths that could drop the device beforehand? > > Do you mean drop the mm reference? No the reference to the device, whic

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Wed, Nov 04, 2009 at 01:59:57PM +0100, Andi Kleen wrote: > > Fine? > > I cannot say -- are there paths that could drop the device beforehand? Do you mean drop the mm reference? > (as in do you hold a reference to it?) By design I think I always have a reference to mm before I use it. This w

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Andi Kleen
> Fine? I cannot say -- are there paths that could drop the device beforehand? (as in do you hold a reference to it?) -Andi -- a...@linux.intel.com -- Speaking for myself only. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org h

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Wed, Nov 04, 2009 at 12:08:47PM +0100, Andi Kleen wrote: > "Michael S. Tsirkin" writes: > > Haven't really read the whole thing, just noticed something at a glance. > > > +/* Expects to be always run from workqueue - which acts as > > + * read-size critical section for our kind of RCU. */ > >

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Tue, Nov 03, 2009 at 10:11:12PM +0100, Eric Dumazet wrote: > Michael S. Tsirkin a écrit : > > > > Paul, you acked this previously. Should I add you acked-by line so > > people calm down? If you would rather I replace > > rcu_dereference/rcu_assign_pointer with rmb/wmb, I can do this. > > Or ma

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Michael S. Tsirkin
On Tue, Nov 03, 2009 at 03:57:44PM -0800, Paul E. McKenney wrote: > On Tue, Nov 03, 2009 at 01:14:06PM -0500, Gregory Haskins wrote: > > Gregory Haskins wrote: > > > Eric Dumazet wrote: > > >> Michael S. Tsirkin a écrit : > > >>> +static void handle_tx(struct vhost_net *net) > > >>> +{ > > >>> +

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-04 Thread Andi Kleen
"Michael S. Tsirkin" writes: Haven't really read the whole thing, just noticed something at a glance. > +/* Expects to be always run from workqueue - which acts as > + * read-size critical section for our kind of RCU. */ > +static void handle_tx(struct vhost_net *net) > +{ > + struct vhost_v

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Paul E. McKenney
On Tue, Nov 03, 2009 at 01:14:06PM -0500, Gregory Haskins wrote: > Gregory Haskins wrote: > > Eric Dumazet wrote: > >> Michael S. Tsirkin a écrit : > >>> +static void handle_tx(struct vhost_net *net) > >>> +{ > >>> + struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_TX]; > >>> + unsigned head

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Eric Dumazet
Michael S. Tsirkin a écrit : > > Paul, you acked this previously. Should I add you acked-by line so > people calm down? If you would rather I replace > rcu_dereference/rcu_assign_pointer with rmb/wmb, I can do this. > Or maybe patch Documentation to explain this RCU usage? > So you believe I am

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Michael S. Tsirkin
On Tue, Nov 03, 2009 at 07:51:35PM +0100, Eric Dumazet wrote: > Gregory Haskins a écrit : > > Gregory Haskins wrote: > >> Eric Dumazet wrote: > >>> Michael S. Tsirkin a écrit : > +static void handle_tx(struct vhost_net *net) > +{ > +struct vhost_virtqueue *vq = &net->dev.vqs[

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Michael S. Tsirkin
On Tue, Nov 03, 2009 at 07:03:55PM +0100, Eric Dumazet wrote: > Michael S. Tsirkin a écrit : > > +static void handle_tx(struct vhost_net *net) > > +{ > > + struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_TX]; > > + unsigned head, out, in, s; > > + struct msghdr msg = { > > +

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Gregory Haskins
Eric Dumazet wrote: > Gregory Haskins a écrit : >> Gregory Haskins wrote: >>> Eric Dumazet wrote: Michael S. Tsirkin a écrit : using rcu_dereference() and mutex_lock() at the same time seems wrong, I suspect that your use of RCU is not correct. 1) rcu_dereference() s

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Eric Dumazet
Michael S. Tsirkin a écrit : > +static void handle_tx(struct vhost_net *net) > +{ > + struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_TX]; > + unsigned head, out, in, s; > + struct msghdr msg = { > + .msg_name = NULL, > + .msg_namelen = 0, > +

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Eric Dumazet
Gregory Haskins a écrit : > Gregory Haskins wrote: >> Eric Dumazet wrote: >>> Michael S. Tsirkin a écrit : +static void handle_tx(struct vhost_net *net) +{ + struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_TX]; + unsigned head, out, in, s; + struct msghdr msg = {

[PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Michael S. Tsirkin
What it is: vhost net is a character device that can be used to reduce the number of system calls involved in virtio networking. Existing virtio net code is used in the guest without modification. There's similarity with vringfd, with some differences and reduced scope - uses eventfd for signallin

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Gregory Haskins
Eric Dumazet wrote: > Michael S. Tsirkin a écrit : >> +static void handle_tx(struct vhost_net *net) >> +{ >> +struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_TX]; >> +unsigned head, out, in, s; >> +struct msghdr msg = { >> +.msg_name = NULL, >> +.msg_name

Re: [PATCHv7 3/3] vhost_net: a kernel-level virtio server

2009-11-03 Thread Gregory Haskins
Gregory Haskins wrote: > Eric Dumazet wrote: >> Michael S. Tsirkin a écrit : >>> +static void handle_tx(struct vhost_net *net) >>> +{ >>> + struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_TX]; >>> + unsigned head, out, in, s; >>> + struct msghdr msg = { >>> + .msg_name = NUL