Subject: Re: on board ethernet card problem
To: None <port-macppc@NetBSD.org>
From: Tim Kelly <hockey@dialectronics.com>
List: port-macppc
Date: 01/13/2005 09:20:00
On Thu, 13 Jan 2005 06:36:22 -0500
Michael <macallan18@earthlink.net> wrote:

> > error message:
> > 	Write failed: Host is down
> > I was quite surprised after I've connected monitor to
> > mac I've discovered following message from the kernel:
> > mcwatchdog: resetting chip
> > mcwatchdog: resetting chip
> That's something Tim should comment :)

I've seen this myself, and the comments in the arch/macppc/dev/am7c950.c
file indicate that the transmit buffer is not emptying. I believe it to
be a symptom rather than a clue.

After Bill cleared up my confusion about which options can be put in the
config files and which have to be in the source files, I added 

#define MCDEBUG

to am79c950.c and have run it with an SP test 7300. I consistently get

mc0: invalid packet size -4; dropping

with pings either way and ftp out. Obviously this is a critical
indicator of the problem, as any packets being dropped will cause
resends after timeouts at the other end and nothing will happen until
those resends occur, results in horrible performance. I get this about
half the time on ping.

I traced this back into mace_read, which indicates that the length of
the packet coming in is -4, which is passed to it from mc_rint, which
gets it from mc_dmaintr in arch/macppc/dev/if_mc.c. This is a wrapper
for the DMA stuff, and apparently something is either aligned improperly
or there is a problem somewhere in DMA. I have not had time to put in
place further debugging messages to determine what is happening. It
seems to me that the messages already in place eliminate the obvious
stuff, so the problem may be subtle (or it may be blindingly obvious to
those who know this code). At least I can reproduce it here, so I will
know when I've made progress.

I do not know why MAKEDEV would affect this. I don't see a connection,
but that is by no means from an all-knowing perspective.

tim