From patchwork Thu Oct 29 15:34:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dustin Kirkland X-Patchwork-Id: 37200 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 055EBB7C06 for ; Fri, 30 Oct 2009 02:35:05 +1100 (EST) Received: from localhost ([127.0.0.1]:56054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N3X1i-0004u8-3K for incoming@patchwork.ozlabs.org; Thu, 29 Oct 2009 11:35:02 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N3X17-0004sI-9j for qemu-devel@nongnu.org; Thu, 29 Oct 2009 11:34:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N3X16-0004qh-Jg for qemu-devel@nongnu.org; Thu, 29 Oct 2009 11:34:24 -0400 Received: from [199.232.76.173] (port=35762 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N3X16-0004q7-2k for qemu-devel@nongnu.org; Thu, 29 Oct 2009 11:34:24 -0400 Received: from adelie.canonical.com ([91.189.90.139]:37659) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N3X15-0000ZI-1a for qemu-devel@nongnu.org; Thu, 29 Oct 2009 11:34:23 -0400 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1N3X12-0000zj-RO; Thu, 29 Oct 2009 15:34:20 +0000 Received: from cpe-66-69-232-158.austin.res.rr.com ([66.69.232.158] helo=[192.168.1.146]) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1N3X12-0007R5-Gl; Thu, 29 Oct 2009 15:34:20 +0000 From: Dustin Kirkland To: Mark McLoughlin 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> Date: Thu, 29 Oct 2009 10:34:15 -0500 Message-ID: <1256830455.25064.155.camel@x200> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Rusty Russell , Scott Tsai , qemu-devel , kvm Subject: [Qemu-devel] [PATCH] whitelist host virtio networking features [was Re: qemu-kvm-0.11 regression, crashes on older ...] X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: kirkland@canonical.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 |= (1 << VIRTIO_NET_F_MAC); - features |= (1 << VIRTIO_NET_F_GUEST_CSUM); - features |= (1 << VIRTIO_NET_F_GUEST_TSO4); - features |= (1 << VIRTIO_NET_F_GUEST_TSO6); - features |= (1 << VIRTIO_NET_F_GUEST_ECN); + features |= (1 << VIRTIO_NET_F_CSUM); + features |= (1 << VIRTIO_NET_F_HOST_TSO4); + features |= (1 << VIRTIO_NET_F_HOST_TSO6); + features |= (1 << VIRTIO_NET_F_HOST_ECN); return features & virtio_net_get_features(vdev); }