From patchwork Tue Apr 13 18:48:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 50081 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 27A51B7CF8 for ; Wed, 14 Apr 2010 05:03:21 +1000 (EST) Received: from localhost ([127.0.0.1]:43266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1lB8-0007qo-1w for incoming@patchwork.ozlabs.org; Tue, 13 Apr 2010 14:49:42 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O1l9q-0007pV-8P for qemu-devel@nongnu.org; Tue, 13 Apr 2010 14:48:22 -0400 Received: from [140.186.70.92] (port=58746 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1l9o-0007pC-Qx for qemu-devel@nongnu.org; Tue, 13 Apr 2010 14:48:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1l9l-0000bZ-MA for qemu-devel@nongnu.org; Tue, 13 Apr 2010 14:48:20 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:52226) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1l9l-0000ax-H0 for qemu-devel@nongnu.org; Tue, 13 Apr 2010 14:48:17 -0400 Received: by pvd12 with SMTP id 12so2965229pvd.4 for ; Tue, 13 Apr 2010 11:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=Fw/m6XHzPlp4MTxKCK09CQIwPkiFM9Kzaon2JXKwOxc=; b=PLj5YBFVLFiIhqEF7pPjnxF0F07d/nMgmOfvMVEUUTFzVTkDzFapUGJkF9R1I6PoV5 Sv49IX1hZNcTUlwi4oAPo1t1Wj+SmJyDM+eFwbOdydTpFI3M9Pt47WNhoa+yL+UXpfZ6 uEfRpZYVXg7SAx9b8n8M+W9atFmD/UGR3Vj6M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=AMyRLp1RSs4TpZDBScZvns8mSz/CgBwdR+RG3FDmMjc4ogBsrE3iskp17j11Z7E7r7 +JjUGQHuTGRFdISz+8Sx9TE8IjqkASRpU+E6/kOyXPIs0fUtHaoQO+UzbDXCgIWD/FTy W1yTbl2QNxuejeZZECG1CptD35nq1aacZFZ0c= MIME-Version: 1.0 Received: by 10.140.178.12 with HTTP; Tue, 13 Apr 2010 11:48:14 -0700 (PDT) In-Reply-To: <201004122107.19425.paul@codesourcery.com> References: <4BC34D95.7050804@siemens.com> <201004122107.19425.paul@codesourcery.com> Date: Tue, 13 Apr 2010 21:48:14 +0300 Received: by 10.140.57.7 with SMTP id f7mr6038150rva.201.1271184495357; Tue, 13 Apr 2010 11:48:15 -0700 (PDT) Message-ID: Subject: Re: [Qemu-devel] How to lock-up your tap-based VM network From: Blue Swirl To: Paul Brook X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Jan Kiszka , qemu-devel@nongnu.org X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list 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 On 4/12/10, Paul Brook wrote: > > A major reason for this deadlock could likely be removed by shutting > > down the tap (if peered) or dropping packets in user space (in case of > > vlan) when a NIC is stopped or otherwise shut down. Currently most (if > > not all) NIC models seem to signal both "queue full" and "RX disabled" > > via !can_receive(). > > > No. A disabled device should return true from can_recieve, then discard the > packets in its receive callback. Failure to do so is a bug in the device. It > looks like the virtio-net device may be buggy. Awesome, it looks like a longstanding bug with pcnet/lance has is fixed by this change! OpenBSD installer would hang when receiving packages, now it works! diff --git a/hw/pcnet.c b/hw/pcnet.c index 5e63eb5..a04ad09 100644 --- a/hw/pcnet.c +++ b/hw/pcnet.c @@ -1031,8 +1031,6 @@ static int pcnet_tdte_poll(PCNetState *s) int pcnet_can_receive(VLANClientState *nc) { PCNetState *s = DO_UPCAST(NICState, nc, nc)->opaque; - if (CSR_STOP(s) || CSR_SPND(s)) - return 0; return sizeof(s->buffer)-16; }