[PATCH 09/12] kvm: qemu: Actually enable GSO support

Mark McLoughlin
2008-08-11T20:12:43Z

Now that GSO support doesn't break e.g. e1000, we can
enable it.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
---
qemu/vl.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/qemu/vl.c b/qemu/vl.c
index 9bfe480..14a66e0 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -4737,6 +4737,19 @@ static int tap_open(char *ifname, int ifname_size, int *vnet_hdr)
}
memset(&ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
+
+#if defined(TUNGETFEATURES) && defined(IFF_VNET_HDR)
+ {
+ unsigned int features;
+
+ if (ioctl(fd, TUNGETFEATURES, &features) == 0 &&
+ features & IFF_VNET_HDR) {
+ *vnet_hdr = 1;
+ ifr.ifr_flags |= IFF_VNET_HDR;
+ }
+ }
+#endif
+
if (ifname[0] != '\0')
pstrcpy(ifr.ifr_name, IFNAMSIZ, ifname);
else
--
1.5.4.1