public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Update virtio to latest ABI
@ 2008-01-24 20:00 Anthony Liguori
       [not found] ` <12012048063315-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Anthony Liguori @ 2008-01-24 20:00 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: Anthony Liguori, Avi Kivity

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 <aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

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/

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-01-28 18:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-24 20:00 [PATCH] Update virtio to latest ABI Anthony Liguori
     [not found] ` <12012048063315-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-01-27  7:18   ` Avi Kivity
     [not found]     ` <479C3049.1010509-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-27 23:06       ` Anthony Liguori
     [not found]         ` <479D0E7B.2060400-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-01-28 10:49           ` Avi Kivity
     [not found]             ` <479DB34F.8080001-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-28 16:01               ` Anthony Liguori
     [not found]                 ` <479DFC3E.8020709-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-01-28 17:26                   ` Avi Kivity
     [not found]                     ` <479E104A.2040405-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-28 18:28                       ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox