From nobody@www.freebsd.org  Fri May 10 08:15:41 2002
Return-Path: <nobody@www.freebsd.org>
Received: from nwww.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by hub.freebsd.org (Postfix) with ESMTP id BD8EF37B407
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 10 May 2002 08:15:40 -0700 (PDT)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g4AFHOhG089250
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 10 May 2002 08:17:24 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.2/8.12.2/Submit) id g4AFHOCC089249;
	Fri, 10 May 2002 08:17:24 -0700 (PDT)
Message-Id: <200205101517.g4AFHOCC089249@www.freebsd.org>
Date: Fri, 10 May 2002 08:17:24 -0700 (PDT)
From: Thomas Nystrm <thn@saeab.se>
To: freebsd-gnats-submit@FreeBSD.org
Subject: hang of vr interface running at 100 MBit/full duples
X-Send-Pr-Version: www-1.0

>Number:         37929
>Category:       kern
>Synopsis:       hang of vr interface running at 100 MBit/full duples
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    silby
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 10 08:20:02 PDT 2002
>Closed-Date:    Wed Aug 21 22:04:30 PDT 2002
>Last-Modified:  Wed Aug 21 22:04:30 PDT 2002
>Originator:     Thomas Nystrm
>Release:        4.5-RELEASE
>Organization:
Svensk Aktuell Elektronik AB
>Environment:
FreeBSD omar.int.saeab.se 4.5-RELEASE FreeBSD 4.5-RELEASE #18: Fri May 10 16:45:37 CEST 2002     root@omar.int.saeab.se:/usr/src/sys/compile/OMAR  i386

DFE-530TX, controller marked DL10030, identified as VR3043, Rhine I
Motherboard Mercury/Kobian MT133a with AMD Duron running at 900 MHz.
128 MB memory.

Network is build around a 100 MB switch (D-LINK DES-1008D) with my
computer placed on its own port. FTPserver also placed on its own port.
Very low other traffic on the network.

>Description:
When sending a large file with FTP the vr interface hangs.

I have tracked down the problem to the tx-part of the driver. The txstatus
given in the ring descriptor have the value 0x00008800 when this happens.
I have looked in the doc's for VIA Rhine chip and bit 0x800 is stated as
'reserved'. A fix by reinitialize the board when this bit is set seems
to wake up the board again but the problem occurs soon after.

I have also tried to turn off DMA for the disks, no success.

I have tried to the patch given in kern/35720 without success (doesn't
even seems to be called).

>How-To-Repeat:
Occurs every time I tries.
 
>Fix:
-

>Release-Note:
>Audit-Trail:

From: Thomas Nystrom <thn@saeab.se>
To: freebsd-gnats-submit@FreeBSD.org, thn@saeab.se
Cc:  
Subject: Re: kern/37929: hang of vr interface running at 100 MBit/full duples
Date: Wed, 15 May 2002 12:25:44 +0200

 This is a multi-part message in MIME format.
 --------------E50CD34C1BFFA3B64FEC3D14
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 The problem is solved by the attached patches.
 
 In the documentation for the VT6102 chip it could be found that there
 are two different registers each to set the TXFIFO and RXFIFO threshold.
 The driver only sets one of theese registers but the other
 non-initialized register have higher priority.
 
 The patches initialize both registers (changes to both if_vr.c and the
 register definitions in if_vrreg.h). Both patches are relative to the
 files included in 4.5-RELEASE.
 
 /thn
 --------------E50CD34C1BFFA3B64FEC3D14
 Content-Type: text/plain; charset=us-ascii;
  name="if_vr.c.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="if_vr.c.diff"
 
 --- /usr/FreeBSD/4.5/disk/usr/src/sys/pci/if_vr.c	Sun Dec 16 16:46:08 2001
 +++ if_vr.c	Wed May 15 11:56:32 2002
 @@ -1402,6 +1402,13 @@
  	for (i = 0; i < ETHER_ADDR_LEN; i++)
  		CSR_WRITE_1(sc, VR_PAR0 + i, sc->arpcom.ac_enaddr[i]);
  
 +	/* VT6102 have two registers to set threshholds, set both */
 +	VR_CLRBIT(sc, VR_BCR0, VR_BCR0_RX_THRESH);
 +	VR_SETBIT(sc, VR_BCR0, VR_BCR0_RXTHRESHSTORENFWD);
 +
 +	VR_CLRBIT(sc, VR_BCR1, VR_BCR1_TX_THRESH);
 +	VR_SETBIT(sc, VR_BCR1, VR_BCR1_TXTHRESHSTORENFWD);
 +
  	VR_CLRBIT(sc, VR_RXCFG, VR_RXCFG_RX_THRESH);
  	VR_SETBIT(sc, VR_RXCFG, VR_RXTHRESH_STORENFWD);
  
 
 --------------E50CD34C1BFFA3B64FEC3D14
 Content-Type: text/plain; charset=us-ascii;
  name="if_vrreg.h.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="if_vrreg.h.diff"
 
 --- /usr/FreeBSD/4.5/disk/usr/src/sys/pci/if_vrreg.h	Mon May 14 21:13:43 2001
 +++ if_vrreg.h	Wed May 15 10:52:05 2002
 @@ -278,6 +278,46 @@
  #define VR_STICKHW_LEGWOL_ENB	0x80
  
  /*
 + * BCR0 register bits. (At least for the VT6102 chip.)
 + */
 +#define VR_BCR0_DMA_LENGTH	0x07
 +
 +#define VR_BCR0_DMA_32BYTES	0x00
 +#define VR_BCR0_DMA_64BYTES	0x01
 +#define VR_BCR0_DMA_128BYTES	0x02
 +#define VR_BCR0_DMA_256BYTES	0x03
 +#define VR_BCR0_DMA_512BYTES	0x04
 +#define VR_BCR0_DMA_1024BYTES	0x05
 +#define VR_BCR0_DMA_STORENFWD	0x07
 +
 +#define VR_BCR0_RX_THRESH	0x38
 +
 +#define VR_BCR0_RXTHRESHCFG	0x00
 +#define VR_BCR0_RXTHRESH64BYTES	0x08
 +#define VR_BCR0_RXTHRESH128BYTES 0x10
 +#define VR_BCR0_RXTHRESH256BYTES 0x18
 +#define VR_BCR0_RXTHRESH512BYTES 0x20
 +#define VR_BCR0_RXTHRESH1024BYTES 0x28
 +#define VR_BCR0_RXTHRESHSTORENFWD 0x38
 +#define VR_BCR0_EXTLED		0x40
 +#define VR_BCR0_MED2		0x80
 +
 +/*
 + * BCR1 register bits. (At least for the VT6102 chip.)
 + */
 +#define VR_BCR1_POT0		0x01
 +#define VR_BCR1_POT1		0x02
 +#define VR_BCR1_POT2		0x04
 +#define VR_BCR1_TX_THRESH	0x38
 +#define VR_BCR1_TXTHRESHCFG	0x00
 +#define VR_BCR1_TXTHRESH64BYTES	0x08
 +#define VR_BCR1_TXTHRESH128BYTES 0x10
 +#define VR_BCR1_TXTHRESH256BYTES 0x18
 +#define VR_BCR1_TXTHRESH512BYTES 0x20
 +#define VR_BCR1_TXTHRESH1024BYTES 0x28
 +#define VR_BCR1_TXTHRESHSTORENFWD 0x38
 +
 +/*
   * Rhine TX/RX list structure.
   */
  
 
 --------------E50CD34C1BFFA3B64FEC3D14--
 
Responsible-Changed-From-To: freebsd-bugs->silby 
Responsible-Changed-By: silby 
Responsible-Changed-When: Fri May 17 10:43:32 PDT 2002 
Responsible-Changed-Why:  
I'm taking all the vr-related PRs for now. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37929 

From: Dominic Marks <dominic_marks@btinternet.com>
To: freebsd-gnats-submit@freebsd.org
Cc: silby@freebsd.org
Subject: Re: kern/37929: hand of vr interface running at 100 MBit/full duples
Date: Sun, 19 May 2002 19:43:32 +0100

 This didn't work for me when I tried it. I am using a 10Mbit Hub based
 network though, so perhaps we have different problems here.
 
 -- 
 Dominic

From: Mike Silbersack <silby@silby.com>
To: Dominic Marks <dominic_marks@btinternet.com>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: kern/37929: hand of vr interface running at 100 MBit/full duples
Date: Sun, 19 May 2002 13:53:15 -0500 (CDT)

 On Sun, 19 May 2002, Dominic Marks wrote:
 
 >
 > This didn't work for me when I tried it. I am using a 10Mbit Hub based
 > network though, so perhaps we have different problems here.
 >
 > --
 > Dominic
 
 Didn't work as in it made things worse, or it had no change whatsoever?
 
 Mike "Silby" Silbersack
 

From: Dominic Marks <dominic_marks@btinternet.com>
To: Mike Silbersack <silby@silby.com>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: kern/37929: hand of vr interface running at 100 MBit/full duples
Date: Sun, 19 May 2002 19:56:28 +0100

 On Sun, May 19, 2002 at 01:53:15PM -0500, Mike Silbersack wrote:
 > 
 > 
 > On Sun, 19 May 2002, Dominic Marks wrote:
 > 
 > >
 > > This didn't work for me when I tried it. I am using a 10Mbit Hub based
 > > network though, so perhaps we have different problems here.
 > >
 > > --
 > > Dominic
 > 
 > Didn't work as in it made things worse, or it had no change whatsoever?
 
 Sorry, I should be more specific. The card worked as normal for a
 period and then died again. Reseting it with ifconfig vr0 down up
 brought it back to life.
 
 > Mike "Silby" Silbersack
 > 
 
 Thanks!
 -- 
 Dominic
State-Changed-From-To: open->closed 
State-Changed-By: silby 
State-Changed-When: Wed Aug 21 22:02:49 PDT 2002 
State-Changed-Why:  
This, and other patches supplied by Thomas have been committed; 
the Via Rhine chips now appear reliable, if a minor hiccup 
here and there can be tolerated. 

Anyone meeting Thomas should supply him with a free beverage 
or snack of his choice, even if they do not own a Via Rhine 
card. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37929 
>Unformatted:
