From kirkland@canonical.com Thu Oct 29 10:34:19 2009 Subject: [PATCH] whitelist host virtio networking features [was Re: qemu-kvm-0.11 regression, crashes on older ...] From: Dustin Kirkland Reply-To: kirkland@canonical.com To: Mark McLoughlin Cc: Anthony Liguori , Scott Tsai , qemu-devel , kvm , Rusty Russell In-Reply-To: <1256827719.10825.75.camel@blaa> References: <1256807803.10825.39.camel@blaa> <1256815818-sup-7805@xpc65.scottt> <1256818566.10825.58.camel@blaa> <4AE9A299.5060003@codemonkey.ws> <1256826351.10825.69.camel@blaa> <4AE9A90F.1060108@codemonkey.ws> <1256827719.10825.75.camel@blaa> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-1dKl4mYZ5AT3f6qAcT/o" Message-ID: <1256830455.25064.155.camel@x200> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Date: Thu, 29 Oct 2009 10:34:19 -0500 X-Evolution-Format: text/plain X-Evolution-Account: 1239743196.25083.0@x61 X-Evolution-Transport: smtp://canonical;auth=CRAM-MD5@smtp.canonical.com:587/;use_ssl=when-possible X-Evolution-Fcc: mbox:/home/kirkland/.evolution/mail/local#Sent --=-1dKl4mYZ5AT3f6qAcT/o Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable whitelist host virtio networking features This patch is a followup to 8eca6b1bc770982595db2f7207c65051572436cb, fixing crashes when guests with 2.6.25 virtio drivers have saturated virtio network connections. https://bugs.edge.launchpad.net/ubuntu/+source/qemu-kvm/+bug/458521 That patch should have been whitelisting *_HOST_* rather than the the *_GUEST_* features. I tested this by running an Ubuntu 8.04 Hardy guest (2.6.24 kernel + 2.6.25-virtio driver). I saturated both the incoming, and outgoing network connection with nc, seeing sustained 6MB/s up and 6MB/s down bitrates for ~20 minutes. Previously, this crashed immediately. Now, the guest does not crash and maintains network connectivity throughout the test. Signed-off-by: Dustin Kirkland Signed-off-by: Mark McLoughlin Tested-by: Dustin Kirkland diff --git a/hw/virtio-net.c b/hw/virtio-net.c index ce8e6cb..27834fa 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -164,10 +164,10 @@ static uint32_t virtio_net_bad_features(VirtIODevice = *vdev) /* Linux kernel 2.6.25. It understood MAC (as everyone must), * but also these: */ features |=3D (1 << VIRTIO_NET_F_MAC); - features |=3D (1 << VIRTIO_NET_F_GUEST_CSUM); - features |=3D (1 << VIRTIO_NET_F_GUEST_TSO4); - features |=3D (1 << VIRTIO_NET_F_GUEST_TSO6); - features |=3D (1 << VIRTIO_NET_F_GUEST_ECN); + features |=3D (1 << VIRTIO_NET_F_CSUM); + features |=3D (1 << VIRTIO_NET_F_HOST_TSO4); + features |=3D (1 << VIRTIO_NET_F_HOST_TSO6); + features |=3D (1 << VIRTIO_NET_F_HOST_ECN); =20 return features & virtio_net_get_features(vdev); } --=-1dKl4mYZ5AT3f6qAcT/o Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkrptfcACgkQs7pNXIOmEZSZDACeK3pT+F3k7nvcssWPhE+XZDpt jbAAn054+oeKlAdKOkY4YOQOp6epPRJM =gpdf -----END PGP SIGNATURE----- --=-1dKl4mYZ5AT3f6qAcT/o--