FreeBSD-5.2 BETA & Davicom ethernet

Marius Strobl marius at
Tue Dec 2 10:48:46 PST 2003

On Tue, Dec 02, 2003 at 05:33:19PM +0100, Maxime Henrion wrote:
> Marius Strobl wrote:
> > On Tue, Dec 02, 2003 at 04:21:16PM +0100, Maxime Henrion wrote:
> > > 
> > > This is expected for now.  I coudln't find the time to add support for
> > > getting the MAC address from the OpenFirmware in dc(4) yet.  With a bit
> > > of luck, this will be working soon, though probably not before
> > > 5.3-RELEASE, unless someone else tackles this issue.
> > > 
> > 
> > A while ago I already sent you a patch similar to the attached one which
> > gets the MAC address for Sun onboard NICs via OpenFirmware in dc(4). But
> > you didn't like the MD ifdefs in if_dc.c and wanted to implement it some
> > layers above.
> Yes, I remember it.  But as I said, it's an ugly hack, and needs to be
> done better.  If people really need a MAC address they could use an
> "ifconfig dc0 ether xx:xx:xx:xx:xx:xx" command.  Besides, there have

I agree that this is not the best way to do it, on the other hand what
did you have in mind when you wrote "via OpenFirmware in dc(4)"?
One could leave the check for local-mac-address out for now and just
call OF_getetheraddr(), dc(4) then should compile as a module and
people would get a working MAC address, also the same on all interfaces,
until the proper way is implemented.

> been reports of crashes with dc(4) cards under sparc64 at high load.  So
> I'm really reluctant to commit this.  Which makes me wonder : do you
> experience these crashes?

No. When they were reported shortly after you commited the busdma
conversion of dc(4) I tried to reproduce them by transfering large
files and running buildworld via NFS but had no problems.
As a side note, from the reports I read it was never clear to me if
those crashes happend with onboard Davicom NICs or with other dc(4)
NICs. There now also seem to be several people that use onboard
Davicom NICs with FreeBSD/sparc64 and there where no new reports of
such crashes. In if_dc.c revision 1.122 and 1.123 mbr@ fixed a
Davicom-related bug, maybe it was also the cause for those crashes.

> > +		/*
> > +		 * If this is an onboard dc(4) the station address read from
> > +		 * the EEPROM is all zero and we have to get it from the fcode.
> > +		 */
> > +		for (i = 0; i < ETHER_ADDR_LEN; i++)
> > +			if (eaddr[i] != 0x00)
> > +				break;
> AFAICT, the "break" here breaks out of the for loop, not out of the case
> statement, which is what you probably wanted.  So, whether or not the
> MAC address is all zeros, you'll try to get the MAC address from
> OpenFirmware.

Indeed. I had this right in the first version of that patch but broke
it when merging with updated sources recently.

More information about the freebsd-sparc64 mailing list