[vortex] 3C905CX, 2.2.18, Dell Dimension 4100 (P933) Receive Failure Fix / Inquiry

Samuel Madden madden@fracas.cs.berkeley.edu
Tue, 16 Jan 2001 20:29:44 -0800


Setting up Debian on a Dell Dimension 4100 with a P3/933 under 2.2.18.
The 3c59x module would load and send data without error, but didn't seem
to ever receive packets.  

I applied the patches suggested in:

http://www.scyld.com/pipermail/vortex/2000-December/000858.html

To no avail.

However, in reading through these posts it became clear that the driver
is extremely sensistive to various timer-loops in the code, especially with
newer drivers.  It also struck me that for-loops will stall for different
amounts of time depending on the processor, while the timeouts of the
network card probably don't vary with cpu speed.  So, I tried increasing
the timeouts in vortex_rx and was able to get the driver to work (see diff
dump below).

I'm wondering:

1) why isn't some more precise timing mechanism being used here?
2) what are the performance implications of making the rx timeouts
	significantly higher?
3) does anyone have suggestions for what optimal values might be here?  i've
	increased them quite a lot and am not really interesting in trying
	all the permuations manually.

Here's the diff -- note that this includes some changes from the message
referenced above -- they may or may not be neccessary.

File: 3c59x.c

26c26
< "3c59x.c:v0.99Rb 8/8/2000 Donald Becker, becker@scyld.com, SRM 1.16.01\n";
---
> "3c59x.c:v0.99Rb 8/8/2000 Donald Becker, becker@scyld.com\n";
897c897
< 		mdio_sync(ioaddr,32);
---
> 		mii_preamble_required++;
899,900c899,900
< 		for (phy = 0; phy <= 32 && phy_idx < 1; phy++) {
< 			int mii_status, phyx = (phy == 0 ? 24 : phy == 24 ? 0 : phy);
---
> 		for (phy = 1; phy <= 32 && phy_idx < sizeof(vp->phys); phy++) {
> 			int mii_status, phyx = phy & 0x1f;
1159c1159
< 	for (i = 500000; i >= 0 ; i--)
---
> 	for (i = 2000; i >= 0 ; i--)
1165,1166c1165
< 	for (i=500000; i >= 0; i--)
< 	/*	for (i = 2000; i >= 0 ; i--) */
---
> 	for (i = 2000; i >= 0 ; i--)
1624c1623
< 		for (i = 6000; i >= 0 ; i--)
---
> 		for (i = 600; i >= 0 ; i--)
1841c1840
< 				for (i = 5000; i >= 0; i--)
---
> 				for (i = 200; i >= 0; i--)
1852c1851
< 		for (i = 5000; i >= 0; i--)
---
> 		for (i = 200; i >= 0; i--)



-Sam Madden
UC Berkeley Database Group
madden@cs.berkeley.edu