This patch converts virtio-net to use the new fragmented send interface.
We should have always supported this.

Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]>

diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c
index 85cc9d2..93bca1d 100644
--- a/qemu/hw/virtio-net.c
+++ b/qemu/hw/virtio-net.c
@@ -239,23 +239,15 @@ again:
 static void virtio_net_flush_tx(VirtIONet *n, VirtQueue *vq)
 {
     VirtQueueElement elem;
-    int count = 0;
 
     if (!(n->vdev.status & VIRTIO_CONFIG_S_DRIVER_OK))
         return;
 
     while (virtqueue_pop(vq, &elem)) {
-       int i;
-       size_t len = 0;
+       ssize_t len = 0;
 
        /* ignore the header for now */
-       for (i = 1; i < elem.out_num; i++) {
-           qemu_send_packet(n->vc, elem.out_sg[i].iov_base,
-                            elem.out_sg[i].iov_len);
-           len += elem.out_sg[i].iov_len;
-       }
-
-       count++;
+       len = qemu_sendv_packet(n->vc, &elem.out_sg[1], elem.out_num - 1);
 
        virtqueue_push(vq, &elem, sizeof(struct virtio_net_hdr) + len);
        virtio_notify(&n->vdev, vq);

-------------------------------------------------------------------------
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
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to