NetBSD Problem Report #41679

From petter@lpcit-7212.hig.se  Tue Jul  7 11:47:42 2009
Return-Path: <petter@lpcit-7212.hig.se>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 4768D63BC07
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  7 Jul 2009 11:47:42 +0000 (UTC)
Message-Id: <20090707114736.0D37627339@lpcit-7212.hig.se>
Date: Tue,  7 Jul 2009 13:47:35 +0200 (CEST)
From: netbsd@gavlehandel.se
Reply-To: netbsd@gavlehandel.se
To: gnats-bugs@gnats.NetBSD.org
Subject: re0: watchdog timeout on qemu/kvm
X-Send-Pr-Version: 3.95

>Number:         41679
>Category:       kern
>Synopsis:       Lots of re0: watchdog timeout using qemu/kvm
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 07 11:50:00 +0000 2009
>Closed-Date:    
>Last-Modified:  Mon Jun 02 01:15:00 +0000 2014
>Originator:     netbsd@gavlehandel.se
>Release:        NetBSD 5.0_STABLE NetBSD-daily/netbsd-5/200907040000Z/iso/i386cd.iso
>Organization:

>Environment:


System: NetBSD 5.0_STABLE NetBSD 5.0_STABLE (GENERIC) #0: Sat Jul 4 10:51:45 UTC 2009 builds@b6.netbsd.org:/home/builds/ab/netbsd-5/i386/200907040000Z-obj/home/builds/ab/netbsd-5/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
re0 at pci0 dev 3 function 0: RealTek 8139C+ 10/100BaseTX (rev. 0x20)
re0: interrupting at irq 11
re0: Ethernet address 54:52:00:02:9f:3e
re0: using 64 tx descriptors
rlphy0 at re0 phy 0: Realtek internal PHY
rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto

>Description:
Using this kernel on kvm 1:84+dfsg-0ubuntu12 / qemu 0.10.0-1ubuntu1
gives lots of re0: watchdog timeout in the logs, and ssh access to the 
virtual machine is nearly unusable if I download a file at the same time.
>How-To-Repeat:
Install this netbsd snapshot on a up-to-date ubuntu (9.04) and try to use
network, with default settings.
>Fix:
I have an idea about this, the emulated ethernet may be too slow some times,
triggering this watchdog.

>Release-Note:

>Audit-Trail:
From: Wolfgang Solfrank <Wolfgang@Solfrank.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/41679
Date: Wed, 13 Jan 2010 14:45:03 +0100

 This is a multi-part message in MIME format.
 --------------080900090201020500030809
 Content-Type: text/plain; charset=UTF-8; format=flowed
 Content-Transfer-Encoding: 7bit

 Hi,

 the problem isn't really that the emulated ethernet is too slow, but
 that the re driver tries to use a mode of the device that the qemu
 emulation doesn't support. (Actually, there is a compile time flag
 in qemu which would implement this, but this isn't defined by default
 and thus not by most installations of qemu, including the one used
 by xen.)

 The attached patch fixes the problem for me. Can you try it? (Sorry,
 the patch is against current, but it should apply cleanly against
 netbsd-5-0, too.)

 Probably, the define of RTK_QEMU at the start of rtl8169.c is far from
 optimal, and indeed, I intend to change that for the final commit, but
 it should do for the test.

 Ciao,
 Wolfgang
 -- 
 Wolfgang@Solfrank.net				Wolfgang Solfrank


 --------------080900090201020500030809
 Content-Type: text/plain;
  name="diffs"
 Content-Transfer-Encoding: base64
 Content-Disposition: attachment;
  filename="diffs"

 SW5kZXg6IHN5cy9kZXYvaWMvcnRsODE2OS5jCj09PT09PT09PT09PT09PT09PT09PT09PT09
 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC9j
 dnNyb290L3NyYy9zeXMvZGV2L2ljL3J0bDgxNjkuYyx2CnJldHJpZXZpbmcgcmV2aXNpb24g
 MS4xMjgKZGlmZiAtdSAtcjEuMTI4IHJ0bDgxNjkuYwotLS0gc3lzL2Rldi9pYy9ydGw4MTY5
 LmMJMTUgU2VwIDIwMDkgMTk6Mjk6MTcgLTAwMDAJMS4xMjgKKysrIHN5cy9kZXYvaWMv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XAorCShSVEtfSVNSX1JYX09LfFJUS19JU1Jf
 UlhfRVJSfFJUS19JU1JfVFhfRVJSfFJUS19JU1JfVFhfT0t8CVwKKwlSVEtfSVNSX1JYX09W
 RVJSVU58UlRLX0lTUl9QS1RfVU5ERVJSVU58UlRLX0lTUl9GSUZPX09GTE9XfAlcCisJUlRL
 X0lTUl9QQ1NfVElNRU9VVHxSVEtfSVNSX1NZU1RFTV9FUlJ8UlRLX0lTUl9USU1FT1VUX0VY
 UElSRUQpCisjZWxzZQogI2RlZmluZSBSVEtfSU5UUlNfQ1BMVVMJXAogCShSVEtfSVNSX1JY
 X09LfFJUS19JU1JfUlhfRVJSfFJUS19JU1JfVFhfRVJSfAkJCVwKIAlSVEtfSVNSX1JYX09W
 RVJSVU58UlRLX0lTUl9QS1RfVU5ERVJSVU58UlRLX0lTUl9GSUZPX09GTE9XfAlcCiAJUlRL
 X0lTUl9QQ1NfVElNRU9VVHxSVEtfSVNSX1NZU1RFTV9FUlJ8UlRLX0lTUl9USU1FT1VUX0VY
 UElSRUQpCisjZW5kaWYKIAogCiAvKgo=
 --------------080900090201020500030809--

State-Changed-From-To: open->feedback
State-Changed-By: ws@NetBSD.org
State-Changed-When: Wed, 13 Jan 2010 14:25:21 +0000
State-Changed-Why:
A question has been asked, and a patch provided.


From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/41679: re0: watchdog timeout on qemu/kvm
Date: Thu, 26 Apr 2012 08:13:50 +0000

 On Tue, Jul 07, 2009 at 11:50:00AM +0000, netbsd@gavlehandel.se wrote:
  > Using this kernel on kvm 1:84+dfsg-0ubuntu12 / qemu 0.10.0-1ubuntu1
  > gives lots of re0: watchdog timeout in the logs, and ssh access to the 
  > virtual machine is nearly unusable if I download a file at the same time.

 As of April 2012 this is not fixed and affects both netbsd-5 and
 netbsd-6. See duplicate PRs 46378 and 46381.

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 30 Dec 2012 07:50:47 +0000
State-Changed-Why:
Two-year feedback timeout. Can someone else take this up?


From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: Re: kern/41679 (Lots of re0: watchdog timeout using qemu/kvm)
Date: Sun, 30 Dec 2012 17:35:02 +0900

 > Synopsis: Lots of re0: watchdog timeout using qemu/kvm

 It's QEMU's problem ("interrupt moderation timer is disabled by default")
 http://www.valinux.co.jp/technologylibrary/document/virtualization/kvm_netbsd0001/#n04
 and I'm not sure if it's worth to put workaround for qemu quirk
 in re(4) driver. (because wm(4) on qemu works)

 ---
 Izumi Tsutsui

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/41679 (Lots of re0: watchdog timeout using qemu/kvm)
Date: Mon, 7 Oct 2013 04:41:28 +0000

 On Sun, Dec 30, 2012 at 08:40:04AM +0000, Izumi Tsutsui wrote:
  >  > Synopsis: Lots of re0: watchdog timeout using qemu/kvm
  >  
  >  It's QEMU's problem ("interrupt moderation timer is disabled by default")
  >  http://www.valinux.co.jp/technologylibrary/document/virtualization/kvm_netbsd0001/#n04
  >  and I'm not sure if it's worth to put workaround for qemu quirk
  >  in re(4) driver. (because wm(4) on qemu works)

 If people keep tripping on it, if nothing else it makes us look bad.
 Is there a way to get qemu installs to default to wm(4)?

 -- 
 David A. Holland
 dholland@netbsd.org

From: Stephen Borrill <netbsd@precedence.co.uk>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/41679 (Lots of re0: watchdog timeout using qemu/kvm)
Date: Fri, 2 May 2014 13:46:44 +0100 (BST)

 > On Sun, Dec 30, 2012 at 08:40:04AM +0000, Izumi Tsutsui wrote:
 > > > Synopsis: Lots of re0: watchdog timeout using qemu/kvm
 > >
 > > It's QEMU's problem ("interrupt moderation timer is disabled by default")
 > > http://www.valinux.co.jp/technologylibrary/document/virtualization/kvm_netbsd0001/#n04
 > > and I'm not sure if it's worth to put workaround for qemu quirk
 > > in re(4) driver. (because wm(4) on qemu works)
 >
 > If people keep tripping on it, if nothing else it makes us look bad.
 > Is there a way to get qemu installs to default to wm(4)?

 Problem also affects when running as HVM domU under XenServer where it is 
 not possible to change from re(4).

 -- 
 Stephen

From: Stephen Borrill <netbsd@precedence.co.uk>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/41679 (Lots of re0: watchdog timeout using qemu/kvm)
Date: Fri, 2 May 2014 14:09:39 +0100 (BST)

 On Fri, 2 May 2014, Stephen Borrill wrote:

 >> On Sun, Dec 30, 2012 at 08:40:04AM +0000, Izumi Tsutsui wrote:
 >> > > Synopsis: Lots of re0: watchdog timeout using qemu/kvm
 >> >
 >> > It's QEMU's problem ("interrupt moderation timer is disabled by default")
 >> > 
 >> http://www.valinux.co.jp/technologylibrary/document/virtualization/kvm_netbsd0001/#n04
 >> > and I'm not sure if it's worth to put workaround for qemu quirk
 >> > in re(4) driver. (because wm(4) on qemu works)
 >> 
 >> If people keep tripping on it, if nothing else it makes us look bad.
 >> Is there a way to get qemu installs to default to wm(4)?
 >
 > Problem also affects when running as HVM domU under XenServer where it is not 
 > possible to change from re(4).

 There is a workaround for XenServer to enable switching to wm(4):
 http://discussions.citrix.com/topic/329848-openbsd-with-message-watchdog-timeout/

 However, this does require patching vendor-provided files in all your 
 dom0s that the VM may run on (could be a significant number in a XenServer 
 pool) and the files may be replaced without warning when applying a 
 hotfix.

 -- 
 Stephen

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/41679 (Lots of re0: watchdog timeout using qemu/kvm)
Date: Mon, 2 Jun 2014 01:11:43 +0000

 On Fri, May 02, 2014 at 01:50:00PM +0000, Stephen Borrill wrote:
  >> Problem also affects when running as HVM domU under XenServer
  >> where it is not possible to change from re(4).
  >  
  >  There is a workaround for XenServer to enable switching to wm(4):
  >  http://discussions.citrix.com/topic/329848-openbsd-with-message-watchdog-timeout/
  >  
  >  However, this does require patching vendor-provided files in all your 
  >  dom0s that the VM may run on (could be a significant number in a XenServer 
  >  pool) and the files may be replaced without warning when applying a 
  >  hotfix.

 That sounds like we should indeed fix the issue.

 ...not that I know anything about re(4) or can do it myself :-/

 -- 
 David A. Holland
 dholland@netbsd.org

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.