Re: [PATCH 4/5] virtio net: Allow receiving SG packets

2008-07-15 Thread Rusty Russell
On Tuesday 15 July 2008 13:52:09 Herbert Xu wrote: On Mon, Jul 14, 2008 at 10:41:38PM -0500, Rusty Russell wrote: + /* If we can receive ANY GSO packets, we must allocate large ones. */ + if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) + || virtio_has_feature(vdev

Re: [PATCH] stopmachine: add stopmachine_timeout

2008-07-14 Thread Rusty Russell
On Monday 14 July 2008 21:51:25 Christian Borntraeger wrote: Am Montag, 14. Juli 2008 schrieb Hidetoshi Seto: + /* Wait all others come to life */ + while (cpus_weight(prepared_cpus) != num_online_cpus() - 1) { + if (time_is_before_jiffies(limit)) + goto

[PATCH 1/5] virtio_net: Set VIRTIO_NET_F_GUEST_CSUM feature

2008-07-14 Thread Rusty Russell
(I know you already have this, but included for completeness) From: Mark McLoughlin [EMAIL PROTECTED] We can handle receiving partial csums, so set the appropriate feature bit. Signed-off-by: Mark McLoughlin [EMAIL PROTECTED] Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/net

[PATCH 3/5] virtio net: Add ethtool ops for SG/GSO

2008-07-14 Thread Rusty Russell
From: Herbert Xu [EMAIL PROTECTED] This patch adds some basic ethtool operations to virtio_net so I could test SG without GSO (which was really useful because TSO turned out to be buggy :) Signed-off-by: Rusty Russell [EMAIL PROTECTED] (remove MTU setting) --- drivers/net/virtio_net.c | 18

[PATCH 4/5] virtio net: Allow receiving SG packets

2008-07-14 Thread Rusty Russell
instead of preallocating the maximum amount of pages per skb. Signed-off-by: Rusty Russell [EMAIL PROTECTED] (added feature bits) --- drivers/net/virtio_net.c | 41 - 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/drivers/net/virtio_net.c b

[PATCH 5/5] virtio_net: Recycle unused recv buffer pages for large skbs in net driver

2008-07-14 Thread Rusty Russell
a separate small buffer queue. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/net/virtio_net.c | 36 +++- 1 file changed, 35 insertions(+), 1 deletion(-) diff -r 4cef5ad6fd51 drivers/net/virtio_net.c --- a/drivers/net/virtio_net.c Tue May 27 16:07:56

[PATCH] virtio_net: Set VIRTIO_NET_F_GUEST_CSUM feature

2008-07-08 Thread Rusty Russell
From: Mark McLoughlin [EMAIL PROTECTED] We can handle receiving partial csums, so set the appropriate feature bit. Signed-off-by: Mark McLoughlin [EMAIL PROTECTED] Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/net/virtio_net.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion

Re: [PATCH RFC 0/4] Paravirtual spinlocks

2008-07-07 Thread Rusty Russell
On Tuesday 08 July 2008 05:07:49 Jeremy Fitzhardinge wrote: At the most recent Xen Summit, Thomas Friebel presented a paper (Preventing Guests from Spinning Around, http://xen.org/files/xensummitboston08/LHP.pdf) investigating the interactions between spinlocks and virtual machines.

Re: [PATCH RFC 0/4] Paravirtual spinlocks

2008-07-07 Thread Rusty Russell
On Tuesday 08 July 2008 10:37:54 Jeremy Fitzhardinge wrote: Rusty Russell wrote: On Tuesday 08 July 2008 05:07:49 Jeremy Fitzhardinge wrote: At the most recent Xen Summit, Thomas Friebel presented a paper (Preventing Guests from Spinning Around, http://xen.org/files/xensummitboston08

Re: [PATCH 3/4] tun: Allow GSO using virtio_net_hdr

2008-07-02 Thread Rusty Russell
On Wednesday 02 July 2008 15:13:59 Max Krasnyansky wrote: Rusty Russell wrote: Add a IFF_VNET_HDR flag. This uses the same ABI as virtio_net (ie. prepending struct virtio_net_hdr to packets) to indicate GSO and checksum information. Signed-off-by: Rusty Russell [EMAIL PROTECTED

Re: [PATCH 4/4] lguest: Use GSO/IFF_VNET_HDR extensions on tun/tap

2008-06-26 Thread Rusty Russell
On Friday 27 June 2008 04:16:25 Anthony Liguori wrote: Rusty Russell wrote: On Thursday 26 June 2008 05:07:18 Anthony Liguori wrote: Rusty Russell wrote: + add_feature(dev, VIRTIO_NET_F_GUEST_CSUM); You set this feature, but I never see the virtio-net driver acknowledge the feature

Re: [RFC 1/3 v2] hvc_console: rework setup to replace irq functions with callbacks

2008-06-26 Thread Rusty Russell
that I tried: drivers/char/hvc_console.h:59: error: field ‘kref’ has incomplete type So move the include of kref.h too. Signed-off-by: Rusty Russell [EMAIL PROTECTED] diff -r f382d8f562a8 drivers/char/hvc_console.c --- a/drivers/char/hvc_console.cFri Jun 27 15:17:49 2008 +1000 +++ b

[PATCH 1/4] tun: Interface to query tun/tap features.

2008-06-25 Thread Rusty Russell
= ~known_flags[i].flag; printf(%s , known_flags[i].name); } } if (features) printf((UNKNOWN %#x), features); printf(\n); return 0; } Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/net/tun.c |8

[PATCH 4/4] lguest: Use GSO/IFF_VNET_HDR extensions on tun/tap

2008-06-25 Thread Rusty Russell
: Seconds 11.0831 xmit 324742 recv 1910 timeout 323429 After: Seconds 10.6626 xmit 342489 recv 24 timeout 341173 Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- Documentation/lguest/lguest.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff -r

[PATCH 3/4] tun: Allow GSO using virtio_net_hdr

2008-06-25 Thread Rusty Russell
Add a IFF_VNET_HDR flag. This uses the same ABI as virtio_net (ie. prepending struct virtio_net_hdr to packets) to indicate GSO and checksum information. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/net/tun.c | 90 - include

Re: [PATCH 4/4] lguest: Use GSO/IFF_VNET_HDR extensions on tun/tap

2008-06-25 Thread Rusty Russell
On Thursday 26 June 2008 00:32:12 Rusty Russell wrote: (Might not apply cleanly to current Linus, there are other lguest things going on, but this gives you the idea at least). ... + if (ioctl(netfd, TUNSETFEATURES, + TUN_F_CSUM|TUN_F_TSO4|TUN_F_TSO6|TUN_F_TSO_ECN) != 0

Re: [PATCH 4/4] lguest: Use GSO/IFF_VNET_HDR extensions on tun/tap

2008-06-25 Thread Rusty Russell
On Thursday 26 June 2008 05:07:18 Anthony Liguori wrote: Rusty Russell wrote: @@ -1563,6 +1561,16 @@ static void setup_tun_net(char *arg) /* Tell Guest what MAC address to use. */ add_feature(dev, VIRTIO_NET_F_MAC); add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY); + /* Expect

Re: [RFC 3/3 v2] s390: use virtio_console for KVM on s390

2008-06-22 Thread Rusty Russell
On Friday 20 June 2008 23:24:18 Christian Borntraeger wrote: This patch enables virtio_console as the default console on kvm for s390. We currently use the same notify hack as lguest for early console output. I will try to address this for lguest and s390 later. Signed-off-by: Christian

[PATCH] virtio: don't always force a notification when ring is full

2008-06-18 Thread Rusty Russell
implementation: 1GB guest-host before: 30.0844 1GB guest-host after: 27.6167 Signed-off-by: Rusty Russell [EMAIL PROTECTED] diff -r 89bf4894cc36 drivers/virtio/virtio_ring.c --- a/drivers/virtio/virtio_ring.c Mon Jun 16 14:31:30 2008 +1000 +++ b/drivers/virtio/virtio_ring.c Wed

Re: [stable] [PATCH] virtio_net: Fix skb-csum_start computation (2.6.24, 2.6.25)

2008-06-16 Thread Rusty Russell
On Tuesday 17 June 2008 05:38:45 Greg KH wrote: On Mon, Jun 16, 2008 at 02:41:41PM +1000, Rusty Russell wrote: From: Mark McLoughlin [EMAIL PROTECTED] hdr-csum_start is the offset from the start of the ethernet header to the transport layer checksum field. skb-csum_start is the offset

[PATCH] virtio: Complete feature negotation before updating status

2008-06-15 Thread Rusty Russell
-by: Rusty Russell [EMAIL PROTECTED] --- drivers/virtio/virtio.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index ab0aca7..fc85cba 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -117,9 +117,9

[PATCH] virtio_net: Fix skb-csum_start computation (2.6.24, 2.6.25)

2008-06-15 Thread Rusty Russell
PROTECTED] Acked-by: Herbert Xu [EMAIL PROTECTED] Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/net/virtio_net.c |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 50e6e59..503486f 100644 --- a/drivers

Re: [PATCH 1/3] virtio: fix virtio_net xmit of freed skb bug

2008-06-14 Thread Rusty Russell
On Saturday 14 June 2008 00:14:00 Mark McLoughlin wrote: On Thu, 2008-05-29 at 16:34 +1000, Rusty Russell wrote: On Tuesday 27 May 2008 21:06:26 Mark McLoughlin wrote: On Mon, 2008-05-26 at 17:42 +1000, Rusty Russell wrote: If we fail to transmit a packet, we assume the queue is full

Re: [PATCH 1/2] virtio: Use bus_type probe and remove methods

2008-06-13 Thread Rusty Russell
On Friday 13 June 2008 22:46:40 Mark McLoughlin wrote: Hook up to the probe() and remove() methods in bus_type rather than device_driver. The latter has been preferred since 2.6.16. Signed-off-by: Mark McLoughlin [EMAIL PROTECTED] Thanks, applied. Cheers, Rusty.

Re: [PATCH 2/2] virtio: Complete feature negotation before updating status

2008-06-13 Thread Rusty Russell
On Friday 13 June 2008 22:46:41 Mark McLoughlin wrote: lguest (in rusty's use-tun-ringfd patch) assumes that the guest has updated its feature bits before setting its status to VIRTIO_CONFIG_S_DRIVER_OK. That's pretty reasonable, so let's make it so. Applied. That's a bug, I'll send to

[PATCH 2/4] virtio: Fix typo in virtio_net_hdr comments

2008-06-08 Thread Rusty Russell
From: Mark McLoughlin [EMAIL PROTECTED] Signed-off-by: Mark McLoughlin [EMAIL PROTECTED] Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- include/linux/virtio_net.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h

[PATCH 3/4] virtio: virtio_net free transmit skbs in a timer

2008-06-08 Thread Rusty Russell
] Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/net/virtio_net.c | 28 ++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -43,6

[PATCH 4/4] virtio: use callback on empty in virtio_net

2008-06-08 Thread Rusty Russell
virtio_net uses a timer to free old transmitted packets, rather than leaving callbacks enabled all the time. If the host promises to always notify us when the transmit ring is empty, we can free packets at that point and avoid the timer. Signed-off-by: Rusty Russell [EMAIL PROTECTED

Re: [RFC 1/3] hvc_console: rework setup to replace irq functions with callbacks

2008-06-03 Thread Rusty Russell
On Tuesday 03 June 2008 22:45:22 Christian Borntraeger wrote: This patch tries to change hvc_console to not use request_irq/free_irq if the backend does not use irqs. This allows virtio_console to use hvc_console without having a linker reference to request_irq/free_irq. Two questions. Is it

Re: [PATCH] mm: fix comment formatting in asm-generic/pgtable.h:__ptep_modify_prot_

2008-06-02 Thread Rusty Russell
On Monday 02 June 2008 23:02:34 Jeremy Fitzhardinge wrote: Signed-off-by: Jeremy Fitzhardinge [EMAIL PROTECTED] --- include/asm-generic/pgtable.h | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) === ---

Re: [PATCH 1/3] virtio: fix virtio_net xmit of freed skb bug

2008-05-29 Thread Rusty Russell
On Tuesday 27 May 2008 21:06:26 Mark McLoughlin wrote: On Mon, 2008-05-26 at 17:42 +1000, Rusty Russell wrote: If we fail to transmit a packet, we assume the queue is full and put the skb into last_xmit_skb. However, if more space frees up before we xmit it, we loop, and the result can

Re: [PATCH 3/3] virtio_net: Fix skb-csum_start computation

2008-05-29 Thread Rusty Russell
On Tuesday 27 May 2008 21:20:47 Mark McLoughlin wrote: hdr-csum_start is the offset from the start of the ethernet header to the transport layer checksum field. skb-csum_start is the offset from skb-head. skb_partial_csum_set() assumes that skb-data points to the ethernet header - i.e. it

Re: [PATCH/RFC] virtio_blk: check for hardsector size from host

2008-05-29 Thread Rusty Russell
On Tuesday 27 May 2008 19:04:59 Christian Borntraeger wrote: Rusty, Jens, I need your opinion on the following patch. It seems to work, but I would like to get some feedback if this patch is the right approach: Looks like the right approach to me. Don't know about the block side of it...

Re: [PATCH] virtio_config: fix len calculation of config elements

2008-05-29 Thread Rusty Russell
On Thursday 29 May 2008 19:08:01 Christian Borntraeger wrote: v is a pointer, to we have to use sizeof(*v) instead of sizeof(v). How embarassing. Applied, thanks. Rusty. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [PATCH] virtio_blk: fix endianess annotations

2008-05-29 Thread Rusty Russell
On Thursday 29 May 2008 19:10:01 Christian Borntraeger wrote: Since commit 72e61eb40b55dd57031ec5971e810649f82b0259 (virtio: change config to guest endian) config space is no longer fixed endian. Lets change the virtio_blk_config variables. Applied, thanks, Rusty.

Re: [PATCH v2] virtio_blk: check for hardsector size from host

2008-05-29 Thread Rusty Russell
On Thursday 29 May 2008 19:08:26 Christian Borntraeger wrote: Currently virtio_blk assumes a 512 byte hard sector size. This can cause trouble / performance issues if the backing has a different block size (like a file on an ext3 file system formatted with 4k block size or a dasd). Lets add

[PATCH 1/3] virtio: VIRTIO_F_NOTIFY_ON_EMPTY to force callback on empty

2008-05-29 Thread Rusty Russell
(again, it had no locking and hence was unreliable anyway). Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/virtio/virtio_ring.c |7 --- include/linux/virtio_config.h |4 2 files changed, 4 insertions(+), 7 deletions(-) diff -r 95a02f0e0e21 drivers/virtio

[PATCH 2/3] lguest: implement VIRTIO_F_NOTIFY_ON_EMPTY

2008-05-29 Thread Rusty Russell
This is the lguest implementation of the VIRTIO_F_NOTIFY_ON_EMPTY feature. It is currently only published for network devices, but it is turned on for everyone. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- Documentation/lguest/lguest.c | 12 ++-- 1 file changed, 10 insertions

[PATCH 3/3] virtio: use callback on empty in virtio_net

2008-05-29 Thread Rusty Russell
virtio_net uses a timer to free old transmitted packets, rather than leaving callbacks enabled all the time. If the host promises to always notify us when the transmit ring is empty, we can free packets at that point and avoid the timer. Signed-off-by: Rusty Russell [EMAIL PROTECTED

[PULL] virtio lguest fixes (and new virtio_rng driver)

2008-05-29 Thread Rusty Russell
Rusty Russell (8): lguest: use ioremap_cache, not ioremap virtio: bus_id for devices should contain 'virtio' virtio: virtio_pci should not set bus_id. virtio: set device index in common code. lguest: fix ugly NULL in /proc/interrupts virtio: An entropy device

Re: [PATCH 2/3] virtio: fix delayed xmit of packet and freeing of old packets.

2008-05-27 Thread Rusty Russell
On Tuesday 27 May 2008 21:01:08 Mark McLoughlin wrote: On Mon, 2008-05-26 at 17:48 +1000, Rusty Russell wrote: diff -r 1d1ff03de434 drivers/net/virtio_net.c ... + tasklet_init(vi-tasklet, xmit_tasklet, (unsigned long)vi); + err = register_netdev(dev); Missing a tasklet_kill

Re: kvm-lite, lguest64: status?

2008-05-25 Thread Rusty Russell
On Friday 23 May 2008 23:12:39 Gerd Hoffmann wrote: Hi, Just a quick question: What is the status of the two projects in $subject? Havn't heared anything for a while for both ... Hi Gerd, lguest64 I'll punt to Glauber. For kvm-lite, frankly there wasn't enough interest, and I

Re: [PATCH] virtio_net: free transmit skbs in a timer

2008-05-19 Thread Rusty Russell
On Monday 19 May 2008 00:27:05 Avi Kivity wrote: Rusty Russell wrote: OK. And since the current situation is that the host doesn't throttle, the feature bit should be don't throttle, host is doing it for you, and Mark's patch should go in... Yes. We should have thought of this before

Re: [PATCH 2/2] lguest: virtio-rng support

2008-05-19 Thread Rusty Russell
On Saturday 17 May 2008 17:47:01 Jeremy Fitzhardinge wrote: But the host-guest protocol should include the number of bits estimated entropy along with the bits themselves. If we go down that path, we have to come up with a way of feeding that information to guest userspace. Patches welcome.

Re: [PATCH 2/2] lguest: virtio-rng support

2008-05-19 Thread Rusty Russell
On Monday 19 May 2008 19:10:49 Jeremy Fitzhardinge wrote: Rusty Russell wrote: On Saturday 17 May 2008 17:47:01 Jeremy Fitzhardinge wrote: But the host-guest protocol should include the number of bits estimated entropy along with the bits themselves. If we go down that path, we have

Re: [PATCH] virtio_net: free transmit skbs in a timer

2008-05-19 Thread Rusty Russell
On Monday 19 May 2008 20:26:28 Avi Kivity wrote: Rusty Russell wrote: We should have thought of this before, though, especially as Xen does this or something very similar: /* Shared ring page */\ struct __name##_sring

Re: [PATCH] virtio_net: free transmit skbs in a timer

2008-05-19 Thread Rusty Russell
On Monday 19 May 2008 23:26:15 Avi Kivity wrote: Rusty Russell wrote: Well, we do have such a thing, in the ring suppression flags. Can you point me at this? Ah, sorry, I misunderstood. No, we don't have a threshold like this, we have an all-or-nothing flag in each direction

Re: [PATCH] virtio_net: free transmit skbs in a timer

2008-05-18 Thread Rusty Russell
On Sunday 18 May 2008 16:40:05 Avi Kivity wrote: Rusty Russell wrote: On Friday 16 May 2008 01:32:47 Avi Kivity wrote: Mark McLoughlin wrote: I think Rusty is speaking from the POV of the guest driver - i.e. that virtio_net should never disable notifications on the xmit queue using

Re: [PATCH] virtio_blk: allow read-only disks

2008-05-16 Thread Rusty Russell
On Friday 16 May 2008 19:17:03 Christian Borntraeger wrote: Hello Rusty, sometimes it is useful to share a disk (e.g. usr). To avoid file system corruption, the disk should be mounted read-only in that case. This patch adds a new feature flag, that allows the host to specify, if the disk

Re: [kvm-devel] [PATCH] virtio_blk: allow read-only disks

2008-05-16 Thread Rusty Russell
On Friday 16 May 2008 19:28:27 Tomasz Chmielewski wrote: Christian Borntraeger schrieb: Hello Rusty, sometimes it is useful to share a disk (e.g. usr). To avoid file system corruption, the disk should be mounted read-only in that case. Although it is done at a different level here, I

Re: [PATCH 2/2] lguest: virtio-rng support

2008-05-16 Thread Rusty Russell
On Friday 16 May 2008 20:49:41 Johannes Berg wrote: + +/* Our random number generator device reads from /dev/urandom into the Guest's + * input buffers. The usual case is that the Guest doesn't want random numbers + * and so has no buffers although /dev/urandom is still readable,

Re: [PATCH] virtio_net: free transmit skbs in a timer

2008-05-15 Thread Rusty Russell
On Friday 16 May 2008 01:32:47 Avi Kivity wrote: Mark McLoughlin wrote: I think Rusty is speaking from the POV of the guest driver - i.e. that virtio_net should never disable notifications on the xmit queue using disable_cb()? Sounds like you think agree, but that the host side should

Re: Virt RNG?

2008-05-15 Thread Rusty Russell
On Friday 16 May 2008 04:48:53 Jeff Garzik wrote: Has anyone yet written a hw RNG module for virt, that reads the host's random number pool? All this talk[1] about IRQF_SAMPLE_RANDOM in network drivers reminds me that virt guest instances should be grabbing random numbers from the host,

[PATCH 1/2] virtio: hardware random device

2008-05-15 Thread Rusty Russell
On Friday 16 May 2008 09:43:08 Rusty Russell wrote: Anyway, since there's interest, I'll drag virtio_rng from the bottom of the queue, apply Christian's fix (which I somehow missed before, sorry Christian), and re-post. Actually, I didn't miss it. But I've polished the driver a little more

[PATCH 2/2] lguest: virtio-rng support

2008-05-15 Thread Rusty Russell
This is a simple patch to add support for the virtio hardware random generator to lguest. It gets about 1.2 MB/sec reading from /dev/hwrng in the guest. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- Documentation/lguest/lguest.c | 90 ++ 1 file

Re: [PATCH] virtio_net: free transmit skbs in a timer

2008-05-14 Thread Rusty Russell
On Tuesday 13 May 2008 17:47:02 Avi Kivity wrote: Mark McLoughlin wrote: virtio_net currently only frees old transmit skbs just before queueing new ones. If the queue is full, it then enables interrupts and waits for notification that more work has been performed. However, a

Re: [PATCH/RFC] stop_machine: make stop_machine_run more virtualization friendly

2008-05-08 Thread Rusty Russell
On Thursday 08 May 2008 23:20:38 Christian Borntraeger wrote: Changing stop_machine to yield the cpu to the hypervisor when yielding inside the guest fixed the problem for me. While I am not completely happy with this patch, I think it causes no harm and it really improves the situation for

Re: [PATCH] virtio_net: free transmit skbs in a timer

2008-05-02 Thread Rusty Russell
On Thursday 01 May 2008 00:31:46 Mark McLoughlin wrote: virtio_net currently only frees old transmit skbs just before queueing new ones. If the queue is full, it then enables interrupts and waits for notification that more work has been performed. Hi Mark, This patch is fine, but it's

[PULL] virtio lguest changes for 2.6.26

2008-05-02 Thread Rusty Russell
-for-linus.git master Christian Borntraeger (1): virtio: export more headers to userspace Harvey Harrison (1): virtio: fix sparse return void-valued expression warnings Marcelo Tosatti (1): virtio-blk: fix remove oops Rusty Russell (11): virtio: ignore corrupted virtqueues

[PATCH 2/4] virtio: finer-grained features for virtio_net

2008-04-28 Thread Rusty Russell
for what the host can handle. Add equivalent ones for the guest to say what it can handle, because LRO is coming too (thanks Herbert!). Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/net/virtio_net.c |9 + include/linux/virtio_net.h | 13 +++-- 2 files changed

[PATCH 4/4] virtio: net: Allow receiving SG packets

2008-04-28 Thread Rusty Russell
skb's pages to construct an SG skb instead of preallocating the maximum amount of pages per skb. Signed-off-by: Rusty Russell [EMAIL PROTECTED] (added feature bits) --- drivers/net/virtio_net.c | 40 1 file changed, 36 insertions(+), 4 deletions(-) diff

[PATCH 3/4] virtio: net: Add ethtool ops for SG/GSO

2008-04-28 Thread Rusty Russell
Date: Fri, 18 Apr 2008 11:21:42 +0800 From: Herbert Xu [EMAIL PROTECTED] This patch adds some basic ethtool operations to virtio_net so I could test SG without GSO (which was really useful because TSO turned out to be buggy :) Signed-off-by: Rusty Russell [EMAIL PROTECTED] (remove MTU setting

[PATCH 1/4] virtio: wean net driver off NETDEV_TX_BUSY

2008-04-28 Thread Rusty Russell
Herbert tells me that returning NETDEV_TX_BUSY from hard_start_xmit is seen as a poor thing to do; we should cache the packet and stop the queue. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/net/virtio_net.c | 58 --- 1 file changed, 40

Re: [PATCH] virtio-blk: fix remove oops

2008-04-24 Thread Rusty Russell
On Friday 25 April 2008 04:49:53 Marcelo Tosatti wrote: Do not unregister the major at device remove, since there might be another device instances around. (qemu) pci_del 0 11 (qemu) ACPI: PCI interrupt for device :00:0b.0 disabled (qemu) pci_del 0 10 (qemu) [ cut here

Re: [kvm-devel] [RFC PATCH] virtio: change config to guest endian.

2008-04-23 Thread Rusty Russell
On Wednesday 23 April 2008 20:55:50 Christian Borntraeger wrote: Am Dienstag, 22. April 2008 schrieb Rusty Russell: [...] diff -r a098f19a6da5 include/linux/virtio_config.h --- a/include/linux/virtio_config.h Sun Apr 20 14:41:02 2008 +1000 +++ b/include/linux/virtio_config.h Sun Apr 20 15

Re: [PATCH/RFC] virtio: export more headers to userspace

2008-04-23 Thread Rusty Russell
On Wednesday 23 April 2008 20:57:00 Christian Borntraeger wrote: Rusty, is there a reason why we dont export the virtio headers for 9p, balloon, console, pci, and virtio_ring? kvm uses make sync, but I think it is still useful to heave these headers exported as they might be useful for other

[PATCH 2/6] virtio: fix tx_ stats in virtio_net

2008-04-23 Thread Rusty Russell
get_buf() gives the length written by the other side, which will be zero. We want to add the skb length. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/net/virtio_net.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -r 51bdbdc4f199 drivers/net/virtio_net.c

[PATCH 3/6] virtio: fix sparse return void-valued expression warnings

2008-04-23 Thread Rusty Russell
From: Harvey Harrison [EMAIL PROTECTED] drivers/virtio/virtio_pci.c:148:2: warning: returning void-valued expression drivers/virtio/virtio_pci.c:155:2: warning: returning void-valued expression Signed-off-by: Harvey Harrison [EMAIL PROTECTED] Signed-off-by: Rusty Russell [EMAIL PROTECTED

[PATCH 1/6] virtio: ignore corrupted virtqueues rather than spinning.

2008-04-23 Thread Rusty Russell
A corrupt virtqueue (caused by the other end screwing up) can have strange results such as a driver spinning: just bail when we try to get a buffer from a known-broken queue. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/virtio/virtio_ring.c |5 + 1 file changed, 5

[PATCH 5/6] virtio: de-structify virtio_block status byte

2008-04-23 Thread Rusty Russell
Ron Minnich points out that a struct containing a char is not always sizeof(char); simplest to remove the structure to avoid confusion. Cc: ron minnich [EMAIL PROTECTED] Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- Documentation/lguest/lguest.c | 12 ++-- drivers/block

[PATCH 4/6] virtio: export more headers to userspace

2008-04-23 Thread Rusty Russell
-by: Rusty Russell [EMAIL PROTECTED] --- include/linux/Kbuild |5 + 1 file changed, 5 insertions(+) Index: kvm/include/linux/Kbuild === --- kvm.orig/include/linux/Kbuild +++ kvm/include/linux/Kbuild @@ -346,6 +346,11 @@ unifdef-y

[PATCH 6/6] virtio: fix scatterlist sizing in net driver.

2008-04-23 Thread Rusty Russell
Herbert Xu points out (within another patch) that my scatterlists are too short: one entry for the gso header, one for the skb-data, and MAX_SKB_FRAGS for all the fragments. Fix both xmit and recv sides (recv currently unused, coming in later patch). Signed-off-by: Rusty Russell [EMAIL

Re: [kvm-devel] [RFC PATCH] virtio: change config to guest endian.

2008-04-22 Thread Rusty Russell
On Tuesday 22 April 2008 21:22:48 Avi Kivity wrote: The virtio config space was originally chosen to be little-endian, because we thought the config might be part of the PCI config space for virtio_pci. It's actually a separate mmio region, so that argument holds little water; as only x86

Re: [kvm-devel] [RFC PATCH] virtio: change config to guest endian.

2008-04-22 Thread Rusty Russell
On Wednesday 23 April 2008 06:29:14 Hollis Blanchard wrote: On Tuesday 22 April 2008 09:31:35 Rusty Russell wrote: We may still regret not doing *everything* little-endian, but this doesn't make it worse. Hmm, why *don't* we just do everything LE, including the ring? Mainly because when

Re: [5/6] [VIRTIO] net: Add ethtool ops for SG/GSO

2008-04-21 Thread Rusty Russell
On Friday 18 April 2008 13:21:42 Herbert Xu wrote: +static int virtnet_change_mtu(struct net_device *dev, int mtu) +{ + int max = 65535 - ETH_HLEN; + + if (mtu max) + return -EINVAL; + dev-mtu = mtu; + return 0; +} Hi Herbert! I removed this part; useful

Re: [6/6] [VIRTIO] net: Allow receiving SG packets

2008-04-21 Thread Rusty Russell
On Friday 18 April 2008 13:24:27 Herbert Xu wrote: Finally this patch lets virtio_net receive GSO packets in addition to sending them. ... static void try_fill_recv(struct virtnet_info *vi) { struct sk_buff *skb; - struct scatterlist sg[1+MAX_SKB_FRAGS]; + struct scatterlist

Re: [5/6] [VIRTIO] net: Add ethtool ops for SG/GSO

2008-04-21 Thread Rusty Russell
On Tuesday 22 April 2008 11:15:02 Herbert Xu wrote: On Tue, Apr 22, 2008 at 05:01:46AM +1000, Rusty Russell wrote: On Friday 18 April 2008 13:21:42 Herbert Xu wrote: +static int virtnet_change_mtu(struct net_device *dev, int mtu) +{ + int max = 65535 - ETH_HLEN; + + if (mtu max

Re: [6/6] [VIRTIO] net: Allow receiving SG packets

2008-04-21 Thread Rusty Russell
On Tuesday 22 April 2008 06:04:18 David Miller wrote: From: Rusty Russell [EMAIL PROTECTED] Date: Tue, 22 Apr 2008 05:06:16 +1000 I'm not sure what the right number is here. Say worst case is header which goes over a page boundary then MAX_SKB_FRAGS in the skb, but for some reason

[RFC PATCH] virtio: change config to guest endian.

2008-04-21 Thread Rusty Russell
changes: - __virtio_config_val() just becomes a striaght vdev-config_get() call. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/block/virtio_blk.c |4 +-- drivers/virtio/virtio_balloon.c |6 ++--- include/linux/virtio_config.h | 47

Re: [PATCH 5/5] tun: vringfd xmit support.

2008-04-19 Thread Rusty Russell
On Saturday 19 April 2008 05:06:34 Andrew Morton wrote: On Sat, 19 Apr 2008 01:15:15 +1000 Rusty Russell [EMAIL PROTECTED] wrote: What is the maximum numbet of pages which an unpriviliged user can concurrently pin with this code? Since only root can open the tun device, it's currently

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 long

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 lock

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 year or

Re: [6/6] [VIRTIO] net: Allow receiving SG packets

2008-04-18 Thread Rusty Russell
On Friday 18 April 2008 13:24:27 Herbert Xu wrote: Finally this patch lets virtio_net receive GSO packets in addition to sending them. This can definitely be optimised for the non-GSO case. For comparison the Xen approach stores one page in each skb and uses subsequent skb's pages to

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 5/5] tun: vringfd xmit support.

2008-04-18 Thread Rusty Russell
On Friday 18 April 2008 21:31:20 Andrew Morton wrote: On Fri, 18 Apr 2008 14:43:24 +1000 Rusty Russell [EMAIL PROTECTED] wrote: + /* How many pages will this take? */ + npages = 1 + (base + len - 1)/PAGE_SIZE - base/PAGE_SIZE; Brain hurts. I hope you got that right. I

virtio: wean net driver off NETDEV_TX_BUSY

2008-04-17 Thread Rusty Russell
Herbert tells me that returning NETDEV_TX_BUSY from hard_start_xmit is seen as a poor thing to do; we should cache the packet and stop the queue. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/net/virtio_net.c | 57 +++ 1 file changed, 38

[PATCH 0/5] High-speed tun receive and xmit

2008-04-17 Thread Rusty Russell
kvm (and lguest!) want to get more speed out of the tun device. We already have an ABI for guest-host comms, called virtio_ring; extending tun to understand this (with its async nature and batching) make for an efficient network. But moreover: the same things that make virtio a good

[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

[PATCH 3/5] /dev/vring limit and base ioctls

2008-04-17 Thread Rusty Russell
It turns out the lguest (and possibly kvm) want the addresses in the ring buffer to only cover a certain part of memory, and be offset. It makes sense that this be an ioctl. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- Documentation/ioctl-number.txt |3 +-- drivers/char/vring.c

[PATCH 5/5] tun: vringfd xmit support.

2008-04-17 Thread Rusty Russell
into skb fragments. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/net/tun.c | 410 + include/linux/if_tun.h |1 2 files changed, 351 insertions(+), 60 deletions(-) diff -r f797ec115d1b drivers/net/tun.c --- a/drivers/net/tun.c Fri

[PATCH 4/5] tun: vringfd receive support.

2008-04-17 Thread Rusty Russell
in future (at the moment, the tun driver doesn't tell the stack it can handle them, so these cases are never taken). This will need to be something that userspace tells us it can handle. Signed-off-by: Rusty Russell [EMAIL PROTECTED] --- drivers/net/Kconfig|2 drivers/net/tun.c

Re: [PATCH] add virtio disk geometry feature

2008-04-16 Thread Rusty Russell
option. Keep the old geo code around for compatibility. Signed-off-by: Ryan Harper [EMAIL PROTECTED] Reviewed-by: Anthony Liguori [EMAIL PROTECTED] Signed-off-by: Rusty Russell [EMAIL PROTECTED] (modified to single struct) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c

Re: [PATCH RFC 3/5] tun: vringfd receive support.

2008-04-09 Thread Rusty Russell
On Wednesday 09 April 2008 05:49:15 Max Krasnyansky wrote: Rusty Russell wrote: This patch modifies tun to allow a vringfd to specify the receive buffer. Because we can't copy to userspace in bh context, we queue like normal then use the pull hook to actually do the copy. More thought

Re: [PATCH RFC 4/5] tun: vringfd xmit support.

2008-04-07 Thread Rusty Russell
On Monday 07 April 2008 15:13:44 Herbert Xu wrote: Rusty Russell [EMAIL PROTECTED] wrote: +/* We are done with this skb: put it in the used pile. */ +static void skb_finished(struct skb_shared_info *sinfo) +{ + struct skb_shinfo_tun *sht = (void *)(sinfo + 1); + + /* FIXME

Re: [PATCH] virtio: remove overzealous BUG_ON.

2008-04-07 Thread Rusty Russell
On Monday 07 April 2008 23:50:24 Anthony Liguori wrote: Rusty Russell wrote: The 'disable_cb' callback is designed as an optimization to tell the host we don't need callbacks now. As it is not reliable, the debug check is overzealous: it can happen on two CPUs at the same time. Document

Re: [PATCH RFC 1/5] vringfd syscall

2008-04-07 Thread Rusty Russell
On Tuesday 08 April 2008 03:54:34 Jonathan Corbet wrote: Hey, Rusty, For virtualization, we've developed virtio_ring for efficient communication. This would also work well for userspace-kernel communication, particularly for things like the tun device. By using the same ABI, we can join

Re: Call for Presentations: KVM Forum 2008

2008-04-07 Thread Rusty Russell
On Tuesday 08 April 2008 10:17:26 Avi Kivity wrote: [Note: KVM Forum registration is now open at http://kforum.qumranet.com/KVMForum/about_kvmforum.php] This is the Call for Presentations for the second annual KVM Developer's Forum, to be held on June 10-13, 2008, in Napa, California, USA

Re: kernel BUG at drivers/virtio/virtio_ring.c:218!

2008-04-06 Thread Rusty Russell
On Sunday 06 April 2008 00:53:39 Balaji Rao wrote: On Friday 04 April 2008 01:46:21 pm Balaji Rao wrote: Hi Rusty, I hit a bug in virtio_ring.c:218 when I was stressing virtio_net using kvm with -smp 4. static void vring_disable_cb(struct virtqueue *_vq) { struct

[PATCH] virtio: remove overzealous BUG_ON.

2008-04-06 Thread Rusty Russell
on transmit so the START_USE/END_USE debugging reentrance protection can be easily tripped even on UP. Thanks to Balaji Rao for the bug report and testing. Signed-off-by: Rusty Russell [EMAIL PROTECTED] CC: Balaji Rao [EMAIL PROTECTED] diff -r 0b3e64be7696 drivers/virtio/virtio_ring.c --- a/drivers

<    7   8   9   10   11   12   13   14   15   >