NetBSD Problem Report #46083

From www@NetBSD.org  Thu Feb 23 18:40:57 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id E4CCF63CAE9
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 23 Feb 2012 18:40:56 +0000 (UTC)
Message-Id: <20120223184056.0A0F763BCEF@www.NetBSD.org>
Date: Thu, 23 Feb 2012 18:40:56 +0000 (UTC)
From: kretschm@cs.uni-bonn.de
Reply-To: kretschm@cs.uni-bonn.de
To: gnats-bugs@NetBSD.org
Subject: gem(4) is broken on NetBSD 6_BETA (macppc)
X-Send-Pr-Version: www-1.0

>Number:         46083
>Notify-List:    uwe@NetBSD.org
>Category:       kern
>Synopsis:       gem(4) is broken on NetBSD 6_BETA (macppc)
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 23 18:45:00 +0000 2012
>Closed-Date:    Sat Aug 27 23:19:30 +0000 2016
>Last-Modified:  Sat Aug 27 23:19:30 +0000 2016
>Originator:     Matthias Kretschmer
>Release:        NetBSD 6_BETA macppc
>Organization:
>Environment:
NetBSD blavet.barock.local 6.0_BETA NetBSD 6.0_BETA (BLAVET) #1: Mon Feb 20 13:58:05 CET 2012  matthias@telemann.barock.local:/var/itch/netbsd6/obj/var/itch/netbsd6/src/sys/arch/macppc/compile/BLAVET macppc
>Description:
gem(4) is broken NetBSD 6_BETA (on macppc)

The gem(4) interface on the iBook does not work properly anymore with
6_BETA.  On 5.1_STABLE from some months ago it works like a charm.
When having network usage, the interface somehow gets in an unusable
state which hangs the system.  This is a critical problem for me, as
the gem(4) interface is my primary network interface and I often boot
this box from network for testing purposes.  On 5.1_STABLE I do not
have such problems at all.

When I'm lucky, I see a "gem0: device timeout" kernel message.
Sometimes I don't even see this.

When booting from network, sometimes it stops while processing the
init scripts, sometimes I can log in before it hangs.  Keyboard input
is processed (I can read what I type on console), but processes are
stalled.
>How-To-Repeat:
Boot the box from network or generate a lot of network traffic by for
example extracting a big source tarball on NFS.
>Fix:

>Release-Note:

>Audit-Trail:

From: Valery Ushakov <uwe@stderr.spb.ru>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/46083: gem(4) is broken on NetBSD 6_BETA (macppc)
Date: Mon, 16 May 2016 13:34:21 +0300

 I've noticed this too.  It looks like under load gem(4) also starts
 sending garbled ethernet frames from time to time, that have random 2,
 4 or 6 bytes prepended to them.  In the latter case the destination
 address shifts into the position of the source address, so the
 receiver gets confused and complains about frames from itself.

 -uwe

From: Valery Ushakov <uwe@stderr.spb.ru>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/46083: gem(4) is broken on NetBSD 6_BETA (macppc)
Date: Mon, 16 May 2016 15:01:38 +0300

 On Mon, May 16, 2016 at 10:35:01 +0000, Valery Ushakov wrote:

 >  I've noticed this too.  It looks like under load gem(4) also starts
 >  sending garbled ethernet frames from time to time, that have random 2,
 >  4 or 6 bytes prepended to them.  In the latter case the destination
 >  address shifts into the position of the source address, so the
 >  receiver gets confused and complains about frames from itself.

 Looking closer, I can see 5 and 7 bytes prefixes too.

 I can also see that bogus prefixes are actually suffixes of other
 frames.  E.g. I had a bulk scp providing load to trigger the bug and
 also had a ping running in parallel.  There're quite a few bad frames
 that start with "234567", "4567", "67" - which is what ping payload
 ends with.  There are some packets where I can guess the bogus prefix
 is the suffix of an irc ping packet (in the 6 byte prefix there's
 enough info to guess, and then infer for shorter prefixes/suffixes).

 -uwe

From: Valery Ushakov <uwe@stderr.spb.ru>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/46083: gem(4) is broken on NetBSD 6_BETA (macppc)
Date: Tue, 17 May 2016 02:31:08 +0300

 This patch against -6 seems to fix it for me.  I guess this is also
 why TCP checksumming was "broken".

 --- gem.c.~1.98.2.1.~	2016-05-17 02:04:34.000000000 +0300
 +++ gem.c	2016-05-17 02:20:23.000000000 +0300
 @@ -1365,14 +1365,12 @@
  		return;

  	/*
 -	 * Remember the previous number of free descriptors and
 -	 * the first descriptor we'll use.
 +	 * Remember the previous number of free descriptors.
  	 */
  	ofree = sc->sc_txfree;
 -	firsttx = sc->sc_txnext;

  	DPRINTF(sc, ("%s: gem_start: txfree %d, txnext %d\n",
 -	    device_xname(sc->sc_dev), ofree, firsttx));
 +	    device_xname(sc->sc_dev), ofree, sc->sc_txnext));

  	/*
  	 * Loop through the send queue, setting up transmit descriptors
 @@ -1477,7 +1475,8 @@
  		/*
  		 * Initialize the transmit descriptors.
  		 */
 -		for (nexttx = sc->sc_txnext, seg = 0;
 +		firsttx = sc->sc_txnext;
 +		for (nexttx = firsttx, seg = 0;
  		     seg < dmamap->dm_nsegs;
  		     seg++, nexttx = GEM_NEXTTX(nexttx)) {

 <end of patch>

 -uwe

From: Valery Ushakov <uwe@stderr.spb.ru>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/46083: gem(4) is broken on NetBSD 6_BETA (macppc)
Date: Tue, 17 May 2016 04:36:20 +0300

 On Mon, May 16, 2016 at 23:35:01 +0000, Valery Ushakov wrote:

 >  This patch against -6 seems to fix it for me.

 It needs a bit more work to make "packets enqueued" DPRINTF at the end
 print the right value.

 -uwe

From: "Julian Coleman" <jdc@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46083 CVS commit: src/sys/dev/ic
Date: Tue, 17 May 2016 14:44:53 +0000

 Module Name:	src
 Committed By:	jdc
 Date:		Tue May 17 14:44:53 UTC 2016

 Modified Files:
 	src/sys/dev/ic: gem.c

 Log Message:
 PR kern/46083

 Track the start of each packet, so that we set the "Start of Frame" bit in
 all the relevant transmit descriptors when enqueing multiple packets.

 Patch from Valery Ushakov, slightly modified by me to handle debug output.

 Tested on macppc/6.x and sparc64/7.99.x.


 To generate a diff of this commit:
 cvs rdiff -u -r1.104 -r1.105 src/sys/dev/ic/gem.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->pending-pullups
State-Changed-By: jdc@NetBSD.org
State-Changed-When: Fri, 20 May 2016 08:55:10 +0000
State-Changed-Why:
pullup-7 #1170
pullup-6 #1384


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46083 CVS commit: [netbsd-7] src/sys/dev/ic
Date: Sun, 22 May 2016 10:24:50 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun May 22 10:24:50 UTC 2016

 Modified Files:
 	src/sys/dev/ic [netbsd-7]: gem.c

 Log Message:
 Pull up following revision(s) (requested by jdc in ticket #1170):
 	sys/dev/ic/gem.c: revision 1.105
 PR kern/46083
 Track the start of each packet, so that we set the "Start of Frame" bit in
 all the relevant transmit descriptors when enqueing multiple packets.
 Patch from Valery Ushakov, slightly modified by me to handle debug output.
 Tested on macppc/6.x and sparc64/7.99.x.


 To generate a diff of this commit:
 cvs rdiff -u -r1.102 -r1.102.2.1 src/sys/dev/ic/gem.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46083 CVS commit: [netbsd-7-0] src/sys/dev/ic
Date: Sun, 22 May 2016 10:25:52 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun May 22 10:25:52 UTC 2016

 Modified Files:
 	src/sys/dev/ic [netbsd-7-0]: gem.c

 Log Message:
 Pull up following revision(s) (requested by jdc in ticket #1170):
 	sys/dev/ic/gem.c: revision 1.105
 PR kern/46083
 Track the start of each packet, so that we set the "Start of Frame" bit in
 all the relevant transmit descriptors when enqueing multiple packets.
 Patch from Valery Ushakov, slightly modified by me to handle debug output.
 Tested on macppc/6.x and sparc64/7.99.x.


 To generate a diff of this commit:
 cvs rdiff -u -r1.102 -r1.102.6.1 src/sys/dev/ic/gem.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Manuel Bouyer" <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46083 CVS commit: [netbsd-6] src/sys/dev/ic
Date: Sat, 27 Aug 2016 14:04:25 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Sat Aug 27 14:04:25 UTC 2016

 Modified Files:
 	src/sys/dev/ic [netbsd-6]: gem.c

 Log Message:
 Pull up following revision(s) (requested by jdc in ticket #1384):
 	sys/dev/ic/gem.c: revision 1.105
 PR kern/46083
 Track the start of each packet, so that we set the "Start of Frame" bit in
 all the relevant transmit descriptors when enqueing multiple packets.
 Patch from Valery Ushakov, slightly modified by me to handle debug output.
 Tested on macppc/6.x and sparc64/7.99.x.


 To generate a diff of this commit:
 cvs rdiff -u -r1.98.2.1 -r1.98.2.2 src/sys/dev/ic/gem.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 27 Aug 2016 23:19:30 +0000
State-Changed-Why:
Pullups complete.


>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-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.