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

2009-11-09 Thread Michael S. Tsirkin
On Mon, Nov 09, 2009 at 04:47:29PM +1030, Rusty Russell wrote: Actually, this looks wrong to me: + case VHOST_SET_VRING_BASE: ... + vq-avail_idx = vq-last_avail_idx = s.num; The last_avail_idx is part of the state of the driver. It needs to be saved and restored over

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

2009-11-09 Thread Rusty Russell
On Mon, 9 Nov 2009 05:40:32 pm Michael S. Tsirkin wrote: On Mon, Nov 9, 2009 at 8:17 AM, Rusty Russell ru...@rustcorp.com.au wrote: There's something about the 'acked' which rubs me the wrong way. enabled_features is perhaps a better term than acked_features; acked seems more a user

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

2009-11-08 Thread Michael S. Tsirkin
On Fri, Nov 06, 2009 at 03:29:17PM +1030, Rusty Russell wrote: On Thu, 5 Nov 2009 02:27:24 am Michael S. Tsirkin wrote: What it is: vhost net is a character device that can be used to reduce the number of system calls involved in virtio networking. Hi Michael, Now everyone else has

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

2009-11-08 Thread Rusty Russell
On Sun, 8 Nov 2009 10:05:16 pm Michael S. Tsirkin wrote: On Fri, Nov 06, 2009 at 03:29:17PM +1030, Rusty Russell wrote: +/* Caller must have TX VQ lock */ +static void tx_poll_stop(struct vhost_net *net) +{ + if (likely(net-tx_poll_state != VHOST_NET_POLL_STARTED)) +

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

2009-11-08 Thread Michael S. Tsirkin
On Mon, Nov 9, 2009 at 8:17 AM, Rusty Russell ru...@rustcorp.com.au wrote: +static void vhost_net_set_features(struct vhost_net *n, u64 features) +{ + size_t hdr_size = features (1 VHOST_NET_F_VIRTIO_NET_HDR) ? +         sizeof(struct virtio_net_hdr) : 0; + int i; +

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

2009-11-08 Thread Michael S. Tsirkin
On Mon, Nov 09, 2009 at 04:47:29PM +1030, Rusty Russell wrote: On Sun, 8 Nov 2009 10:05:16 pm Michael S. Tsirkin wrote: On Fri, Nov 06, 2009 at 03:29:17PM +1030, Rusty Russell wrote: +/* Caller must have TX VQ lock */ +static void tx_poll_stop(struct vhost_net *net) +{ +

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

2009-11-05 Thread Rusty Russell
On Thu, 5 Nov 2009 02:27:24 am Michael S. Tsirkin wrote: What it is: vhost net is a character device that can be used to reduce the number of system calls involved in virtio networking. Hi Michael, Now everyone else has finally kicked all the tires and it seems to pass, I've done a fairly

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

2009-11-04 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