Re: [PATCHv2] virtio: use smp_XX barriers on SMP

2010-01-29 Thread Michael S. Tsirkin
On Fri, Jan 29, 2010 at 07:44:59AM +1030, Rusty Russell wrote: On Fri, 29 Jan 2010 12:07:08 am Michael S. Tsirkin wrote: On Thu, Jan 28, 2010 at 10:01:09AM +1030, Rusty Russell wrote: On Thu, 28 Jan 2010 09:12:23 am Michael S. Tsirkin wrote: Where possible, we should use SMP barriers

[PATCH 0/2] virtio net improvements

2010-01-29 Thread Rusty Russell
Hi Dave, Nice driver optimization from Shirley, but requires a new virtio hook. Do you want to take both? I have nothing else overlapping it. Cheers, Rusty. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

[PATCH 1/2] virtio: Add ability to detach unused buffers from vrings

2010-01-29 Thread Rusty Russell
From: Shirley Ma mashi...@us.ibm.com There's currently no way for a virtio driver to ask for unused buffers, so it has to keep a list itself to reclaim them at shutdown. This is redundant, since virtio_ring stores that information. So add a new hook to do this. Signed-off-by: Shirley Ma

[PATCH 2/2] virtio_net: Defer skb allocation in receive path Date: Wed, 13 Jan 2010 12:53:38 -0800

2010-01-29 Thread Rusty Russell
From: Shirley Ma mashi...@us.ibm.com virtio_net receives packets from its pre-allocated vring buffers, then it delivers these packets to upper layer protocols as skb buffs. So it's not necessary to pre-allocate skb for each mergable buffer, then frees extra skbs when buffers are merged into a

virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes

2010-01-29 Thread Amit Shah
Hey Rusty, These updated patches in the series return -EFAULT on copy_xx_user errors and also move the copy_from_user into fops_write() instead of it being in send_buf. This enables send_buf to just read from kernel buffers, making it simpler. This also allows write()s to write more to the host

[PATCH 20/31] virtio: console: Add a new MULTIPORT feature, support for generic ports

2010-01-29 Thread Amit Shah
This commit adds a new feature, MULTIPORT. If the host supports this feature as well, the config space has the number of ports defined for that device. New ports are spawned according to this information. The config space also has the maximum number of ports that can be spawned for a particular

[PATCH 21/31] virtio: console: Prepare for writing to userspace buffers

2010-01-29 Thread Amit Shah
When ports get advertised as char devices, the buffers will come from userspace. Equip the fill_readbuf function with the ability to write to userspace buffers. Signed-off-by: Amit Shah amit.s...@redhat.com --- drivers/char/virtio_console.c | 20 ++-- 1 files changed, 14

[PATCH 22/31] virtio: console: Associate each port with a char device

2010-01-29 Thread Amit Shah
The char device will be used as an interface by applications on the guest to communicate with apps on the host. The devices created are placed in /dev/vportNpn where N is the virtio-console device number and n is the port number for that device. One dynamic major device number is allocated for

[PATCH 23/31] virtio: console: Add file operations to ports for open/read/write/poll

2010-01-29 Thread Amit Shah
Allow guest userspace applications to open, read from, write to, poll the ports via the char dev interface. When a port gets opened, a notification is sent to the host via a control message indicating a connection has been established. Similarly, on closing of the port, a notification is sent

[PATCH 29/31] virtio: console: Add ability to hot-unplug ports

2010-01-29 Thread Amit Shah
Remove port data; deregister from the hvc core if it's a console port. Signed-off-by: Amit Shah amit.s...@redhat.com --- drivers/char/virtio_console.c | 65 ++- include/linux/virtio_console.h |1 + 2 files changed, 64 insertions(+), 2 deletions(-) diff

Re: [PATCHv2] virtio: use smp_XX barriers on SMP

2010-01-29 Thread Michael S. Tsirkin
On Fri, Jan 29, 2010 at 07:44:59AM +1030, Rusty Russell wrote: On Fri, 29 Jan 2010 12:07:08 am Michael S. Tsirkin wrote: On Thu, Jan 28, 2010 at 10:01:09AM +1030, Rusty Russell wrote: On Thu, 28 Jan 2010 09:12:23 am Michael S. Tsirkin wrote: Where possible, we should use SMP barriers

Re: [PATCHv2] virtio: use smp_XX barriers on SMP

2010-01-29 Thread Rusty Russell
On Fri, 29 Jan 2010 09:57:18 pm Michael S. Tsirkin wrote: On Fri, Jan 29, 2010 at 07:44:59AM +1030, Rusty Russell wrote: These barriers are actually trying to make sure in_use is set in a timely manner (this is debug code). They're bogus AFAICT: So .. let's just drop these barriers, and

Re: virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes

2010-01-29 Thread Rusty Russell
On Sat, 30 Jan 2010 12:12:37 am Amit Shah wrote: These updated patches in the series return -EFAULT on copy_xx_user errors and also move the copy_from_user into fops_write() instead of it being in send_buf. This enables send_buf to just read from kernel buffers, making it simpler. This also