This patch updates KVM's virtio implementation to the latest virtio ABI. This
includes a change in the network header and support for reset.
With this patch, the block and network driver from Rusty's latest queue are
functioning. Module unload and reload work and I no longer see an error when
repeatedly bringing a network interface up and down.
Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]>
diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c
index 296edf6..86f9e5a 100644
--- a/qemu/hw/virtio-net.c
+++ b/qemu/hw/virtio-net.c
@@ -23,11 +23,8 @@
/* The feature bitmap for virtio net */
#define VIRTIO_NET_F_NO_CSUM 0
-#define VIRTIO_NET_F_TSO4 1
-#define VIRTIO_NET_F_UFO 2
-#define VIRTIO_NET_F_TSO4_ECN 3
-#define VIRTIO_NET_F_TSO6 4
#define VIRTIO_NET_F_MAC 5
+#define VIRTIO_NET_F_GS0 6
#define TX_TIMER_INTERVAL (1000 / 500)
@@ -49,7 +46,9 @@ struct virtio_net_hdr
#define VIRTIO_NET_HDR_GSO_TCPV4_ECN 2 // GSO frame, IPv4 TCP w/ ECN
#define VIRTIO_NET_HDR_GSO_UDP 3 // GSO frame, IPv4 UDP (UFO)
#define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP
+#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set
uint8_t gso_type;
+ uint16_t hdr_len;
uint16_t gso_size;
uint16_t csum_start;
uint16_t csum_offset;
diff --git a/qemu/hw/virtio.c b/qemu/hw/virtio.c
index b78c2c5..bbcb44c 100644
--- a/qemu/hw/virtio.c
+++ b/qemu/hw/virtio.c
@@ -210,6 +210,8 @@ static void virtio_ioport_write(void *opaque, uint32_t
addr, uint32_t val)
break;
case VIRTIO_PCI_STATUS:
vdev->status = val & 0xFF;
+ if (vdev->status == 0)
+ virtio_reset(vdev);
break;
}
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel