summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorSridhar Samudrala <sri@us.ibm.com>2009-10-22 17:43:49 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-27 12:29:04 -0500
commit6c9f58ba3b79202655e6156eb1dab3a2d2e0b51e (patch)
tree02fb37853acae12f80ea22239d9d12e94d1c04f8 /hw
parent1d41b0c1ec66d38355a1e76c29dd2200433335f6 (diff)
downloadqemu-6c9f58ba3b79202655e6156eb1dab3a2d2e0b51e.tar.gz
Enable UFO on virtio-net and tap devices
Enable UFO on the host tap device if supported and allow setting UFO on virtio-net in the guest. Signed-off-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/virtio-net.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 064ec2e609..bfe1366c5e 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -157,6 +157,11 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev)
features |= (1 << VIRTIO_NET_F_GUEST_TSO4);
features |= (1 << VIRTIO_NET_F_GUEST_TSO6);
features |= (1 << VIRTIO_NET_F_GUEST_ECN);
+
+ if (tap_has_ufo(n->vc->peer)) {
+ features |= (1 << VIRTIO_NET_F_GUEST_UFO);
+ features |= (1 << VIRTIO_NET_F_HOST_UFO);
+ }
}
return features;
@@ -188,7 +193,8 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint32_t features)
(features >> VIRTIO_NET_F_GUEST_CSUM) & 1,
(features >> VIRTIO_NET_F_GUEST_TSO4) & 1,
(features >> VIRTIO_NET_F_GUEST_TSO6) & 1,
- (features >> VIRTIO_NET_F_GUEST_ECN) & 1);
+ (features >> VIRTIO_NET_F_GUEST_ECN) & 1,
+ (features >> VIRTIO_NET_F_GUEST_UFO) & 1);
}
}
@@ -748,7 +754,8 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
(n->vdev.features >> VIRTIO_NET_F_GUEST_CSUM) & 1,
(n->vdev.features >> VIRTIO_NET_F_GUEST_TSO4) & 1,
(n->vdev.features >> VIRTIO_NET_F_GUEST_TSO6) & 1,
- (n->vdev.features >> VIRTIO_NET_F_GUEST_ECN) & 1);
+ (n->vdev.features >> VIRTIO_NET_F_GUEST_ECN) & 1,
+ (n->vdev.features >> VIRTIO_NET_F_GUEST_UFO) & 1);
}
}