From nobody@FreeBSD.org  Mon Apr 21 19:00:40 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5F25A106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Apr 2008 19:00:40 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 54AB78FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Apr 2008 19:00:40 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m3LJ0Jrm089371
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Apr 2008 19:00:19 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m3LJ0In5089370;
	Mon, 21 Apr 2008 19:00:18 GMT
	(envelope-from nobody)
Message-Id: <200804211900.m3LJ0In5089370@www.freebsd.org>
Date: Mon, 21 Apr 2008 19:00:18 GMT
From: Bartosz Nowicki <b.nowicki@admin.net.pl>
To: freebsd-gnats-submit@FreeBSD.org
Subject: RealTek 8168/8111B couses system crash
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         122970
>Category:       amd64
>Synopsis:       [re] [hang] RealTek 8168/8111B couses system crash
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    yongari
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 21 19:10:00 UTC 2008
>Closed-Date:    Mon May 31 23:05:03 UTC 2010
>Last-Modified:  Mon May 31 23:05:03 UTC 2010
>Originator:     Bartosz Nowicki
>Release:        7.0-STABLE
>Organization:
Admin.net.pl
>Environment:
FreeBSD ps.polskiswiat.com 7.0-STABLE FreeBSD 7.0-STABLE #3: Fri Apr 18 00:26:46 UTC 2008     root@ps.polskiswiat.com:/usr/obj/usr/src/sys/polskiswiat  amd64

>Description:
Network driver causes strange behaviour.

Symptoms are:

- connection drops after too large packet. For example ps ax command under ssh throws user from console exactly after PID 30.
- files served over HTTP are cut down to random length
- server hangs randomly
- network card seeds random sourced mac packages
- strange logs output:

Apr 21 13:02:44 ps kernel: a
Apr 21 13:03:16 ps kernel: f
Apr 21 13:17:45 ps kernel: c
Apr 21 13:17:45 ps kernel: .
Apr 21 13:18:00 ps kernel: c
Apr 21 13:25:23 ps kernel: 
Apr 21 13:25:25 ps kernel: .
Apr 21 13:25:26 ps kernel: 5
Apr 21 13:25:27 ps kernel: 
Apr 21 13:25:36 ps kernel: 8
Apr 21 13:25:47 ps kernel: t
Apr 21 13:26:26 ps kernel: 9
Apr 21 13:33:59 ps kernel: P
Apr 21 13:35:54 ps kernel: i
Apr 21 13:41:57 ps kernel: 1
Apr 21 13:44:16 ps kernel: <<11101>i0pf>wi:p f5w0:0  5A0c0c eApct cTeCpPt 7 8T.C4P7 .7458.6.:4870. 4859..62:3810 .6260.31.110.72:06320.7200 6ou:t4 9v5i4a2  roeu0t
Apr 21 13:44:16 ps kernel: 
Apr 21 13:44:33 ps kernel: 0
Apr 21 13:44:33 ps kernel: o
Apr 21 13:46:34 ps kernel: 
Apr 21 13:47:16 ps kernel: 
Apr 21 13:47:16 ps kernel: 0
Apr 21 13:47:34 ps kernel: 0
Apr 21 13:47:35 ps kernel: <1<101>10i>ippffww::  550000  AAcccceepptt  TTCCPP  7788..4477..4455..66::808 06 66.61.11.12.0220.22.0260:65:04098960 6o uotu tv ivai ar e0r
Apr 21 13:47:35 ps kernel: e
Apr 21 13:47:35 ps kernel: 0
Apr 21 13:47:53 ps kernel: .
Apr 21 13:47:53 ps kernel: 7
Apr 21 13:47:53 ps kernel: 4
Apr 21 13:52:11 ps kernel: 1
Apr 21 13:53:34 ps kernel: 2
Apr 21 13:54:11 ps kernel: 

Hardware causing this problems is :

re0: <RealTek 8168/8111B PCIe Gigabit Ethernet> port 0xd800-0xd8ff mem 0xfeaff000-0xfeafffff irq 19 at device 0.0 on pci2
rgephy0: <RTL8169S/8110S/8211B media interface> PHY 1 on miibus0
Apr 21 14:25:16 ps kernel: rgephy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
re0: Ethernet address: 00:1d:92:63:3e:2f
re0: [FILTER]
re0: [FILTER]


We tried to patch driver with HEAD patch as in this thread - http://groups.google.com.ua/group/lucky.freebsd.amd64/browse_thread/thread/b40f82fe8632bb54 , with no success. Machine have to be rebooted every day to keep everything in proper place.

Hadrware is working fine, worked under linux before without any glitches.
>How-To-Repeat:
Install 64 bit 7.0-STABLE on AMD Athlon(tm) 64 X2 Dual Core Processor 6000 with RealTek 8168 network card. Use 100 mbit connection, use it as a web server for a day (with low or moderate traffic). 
After a day try to use SSH. Download some jpgs from webserver - it will be closer to /dev/urandom not jpeg (no header, 22kb downloaded file instead of 70 kb original one) and so on.
>Fix:
Problem MIGHT be fixed using this patch http://people.freebsd.org/~yongari/re/re.HEAD.patch  (or these two patches http://people.freebsd.org/~yongari/re/if_re.c + http://people.freebsd.org/~yongari/re/if_rlreg.h)  but it doesn't work in our case.


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: yongari 
State-Changed-When: Tue Apr 22 06:44:48 UTC 2008 
State-Changed-Why:  
I've MFCed several fixes from HEAD to RELENG_7. Would you try 
again after updating latest RELENG_7? 


Responsible-Changed-From-To: freebsd-amd64->yongari 
Responsible-Changed-By: yongari 
Responsible-Changed-When: Tue Apr 22 06:44:48 UTC 2008 
Responsible-Changed-Why:  
Grab. 

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

From: Pyun YongHyeon <pyunyh@gmail.com>
To: Bartosz Nowicki <b.nowicki@admin.net.pl>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: amd64/122970: RealTek 8168/8111B couses system crash
Date: Wed, 18 Mar 2009 14:25:45 +0900

 On Mon, Apr 21, 2008 at 07:00:18PM +0000, Bartosz Nowicki wrote:
 > 
 > >Number:         122970
 > >Category:       amd64
 > >Synopsis:       RealTek 8168/8111B couses system crash
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       low
 > >Responsible:    freebsd-amd64
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Mon Apr 21 19:10:00 UTC 2008
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Bartosz Nowicki
 > >Release:        7.0-STABLE
 > >Organization:
 > Admin.net.pl
 > >Environment:
 > FreeBSD ps.polskiswiat.com 7.0-STABLE FreeBSD 7.0-STABLE #3: Fri Apr 18 00:26:46 UTC 2008     root@ps.polskiswiat.com:/usr/obj/usr/src/sys/polskiswiat  amd64
 > 
 > >Description:
 > Network driver causes strange behaviour.
 > 
 > Symptoms are:
 > 
 > - connection drops after too large packet. For example ps ax command under ssh throws user from console exactly after PID 30.
 > - files served over HTTP are cut down to random length
 > - server hangs randomly
 > - network card seeds random sourced mac packages
 > - strange logs output:
 > 
 > Apr 21 13:02:44 ps kernel: a
 > Apr 21 13:03:16 ps kernel: f
 > Apr 21 13:17:45 ps kernel: c
 > Apr 21 13:17:45 ps kernel: .
 > Apr 21 13:18:00 ps kernel: c
 > Apr 21 13:25:23 ps kernel: 
 > Apr 21 13:25:25 ps kernel: .
 > Apr 21 13:25:26 ps kernel: 5
 > Apr 21 13:25:27 ps kernel: 
 > Apr 21 13:25:36 ps kernel: 8
 > Apr 21 13:25:47 ps kernel: t
 > Apr 21 13:26:26 ps kernel: 9
 > Apr 21 13:33:59 ps kernel: P
 > Apr 21 13:35:54 ps kernel: i
 > Apr 21 13:41:57 ps kernel: 1
 > Apr 21 13:44:16 ps kernel: <<11101>i0pf>wi:p f5w0:0  5A0c0c eApct cTeCpPt 7 8T.C4P7 .7458.6.:4870. 4859..62:3810 .6260.31.110.72:06320.7200 6ou:t4 9v5i4a2  roeu0t
 > Apr 21 13:44:16 ps kernel: 
 > Apr 21 13:44:33 ps kernel: 0
 > Apr 21 13:44:33 ps kernel: o
 > Apr 21 13:46:34 ps kernel: 
 > Apr 21 13:47:16 ps kernel: 
 > Apr 21 13:47:16 ps kernel: 0
 > Apr 21 13:47:34 ps kernel: 0
 > Apr 21 13:47:35 ps kernel: <1<101>10i>ippffww::  550000  AAcccceepptt  TTCCPP  7788..4477..4455..66::808 06 66.61.11.12.0220.22.0260:65:04098960 6o uotu tv ivai ar e0r
 > Apr 21 13:47:35 ps kernel: e
 > Apr 21 13:47:35 ps kernel: 0
 > Apr 21 13:47:53 ps kernel: .
 > Apr 21 13:47:53 ps kernel: 7
 > Apr 21 13:47:53 ps kernel: 4
 > Apr 21 13:52:11 ps kernel: 1
 > Apr 21 13:53:34 ps kernel: 2
 > Apr 21 13:54:11 ps kernel: 
 > 
 > Hardware causing this problems is :
 > 
 > re0: <RealTek 8168/8111B PCIe Gigabit Ethernet> port 0xd800-0xd8ff mem 0xfeaff000-0xfeafffff irq 19 at device 0.0 on pci2
 > rgephy0: <RTL8169S/8110S/8211B media interface> PHY 1 on miibus0
 > Apr 21 14:25:16 ps kernel: rgephy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
 > re0: Ethernet address: 00:1d:92:63:3e:2f
 > re0: [FILTER]
 > re0: [FILTER]
 > 
 > 
 > We tried to patch driver with HEAD patch as in this thread - http://groups.google.com.ua/group/lucky.freebsd.amd64/browse_thread/thread/b40f82fe8632bb54 , with no success. Machine have to be rebooted every day to keep everything in proper place.
 > 
 > Hadrware is working fine, worked under linux before without any glitches.
 > >How-To-Repeat:
 > Install 64 bit 7.0-STABLE on AMD Athlon(tm) 64 X2 Dual Core Processor 6000 with RealTek 8168 network card. Use 100 mbit connection, use it as a web server for a day (with low or moderate traffic). 
 > After a day try to use SSH. Download some jpgs from webserver - it will be closer to /dev/urandom not jpeg (no header, 22kb downloaded file instead of 70 kb original one) and so on.
 > >Fix:
 > Problem MIGHT be fixed using this patch http://people.freebsd.org/~yongari/re/re.HEAD.patch  (or these two patches http://people.freebsd.org/~yongari/re/if_re.c + http://people.freebsd.org/~yongari/re/if_rlreg.h)  but it doesn't work in our case.
 > 
 
 Is this still issue on latest stable? I've MFCed a couple of
 stability fixes for PCIe controller. Would you give it spin and
 let me know how it goes?
State-Changed-From-To: feedback->closed 
State-Changed-By: yongari 
State-Changed-When: Mon May 31 23:04:37 UTC 2010 
State-Changed-Why:  
Close. Feedback timeout(> 12 months). 
If you are able to reproduce the issue again on more recent FreeBSD 
please open PR again. 
Thanks for reporting! 

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