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>
This commit is contained in:
Sridhar Samudrala 2009-10-22 17:43:49 +01:00 committed by Anthony Liguori
parent 1d41b0c1ec
commit 6c9f58ba3b
4 changed files with 44 additions and 7 deletions

View file

@ -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);
}
}