Subject: Re: MI SONIC Ethernet driver for mac68k
To: None <hauke@Espresso.Rhein-Neckar.DE>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-mac68k
Date: 06/02/2007 09:35:31
hauke@Espresso.Rhein-Neckar.DE wrote:

> Works fine on a Quadra 650's obio sn.

Thanks.

> Do your patches make the MI sonic driver use DMA there, and is it supposed
> to make a difference? I am getting around 600 KBytes/sec for ftp transfers
> from a ss10 with hme with both the MD and MI drivers.

MI sonic driver performs DMA from/to mbufs directly,
and MD one does DMA against static buffer and then
copys from/to mbufs.

..But with a quick ttcp tests, it seems MI one is a bit slower
so I'm afraid maybe copying buffer isn't bottleneck,
while I guess MI one still has a good stability on loads.
("dd if=/dev/rsd0a of=/nfsdir/root.fs bs=32k" often hanged up
 with MD driver when I was debugging the old fs bug)


BTW, does esp(4) SCSI work without problem on your Q650?

On my LC630, "dd if=/dev/rsd0a of=/dev/null bs=64k" doesn't work
while "bs=63k" works:
---
# dmesg
 :
Apple Macintosh Quadra 630  (68040)
 :
obio0 at mainbus0
esp0 at obio0 addr 0 (quick): address 0x366000: NCR53C96, 16MHz, SCSI ID 7
scsibus0 at esp0: 8 targets, 8 luns per target
 :
scsibus0: waiting 2 seconds for devices to settle...
sd0 at scsibus0 target 0 lun 0: <SEAGATE, ST51080N, 0958> disk fixed
sd0: 1030 MB, 4826 cyl, 4 head, 109 sec, 512 bytes/sect x 2109840 sectors
sd0: sync (248.00ns offset 15), 8-bit (4.032MB/s) transfers, tagged queueing
sd1 at scsibus0 target 1 lun 0: <MELCO, DSC-UGTV, 2.03> disk fixed
sd1: 29311 MB, 16383 cyl, 16 head, 229 sec, 512 bytes/sect x 60030432 sectors
sd1: sync (312.00ns offset 15), 8-bit (3.205MB/s) transfers
cd0 at scsibus0 target 4 lun 0: <MATSHITA, CD-ROM CR-8004, 1.1f> cdrom removable
cd0: sync (500.00ns offset 8), 8-bit (2.000MB/s) transfers
 :

# dd if=/dev/rsd0a of=/dev/null bs=64k       
0+0 records in
0+0 records out
0 bytes transferred in 0.053 secs (0 bytes/sec)
# dd if=/dev/rsd0a of=/dev/null bs=63k
^C1420+0 records in
1420+0 records out
91607040 bytes transferred in 41.951 secs (2183667 bytes/sec)
#
---

and it often shows the following messages on newfs(8) etc:
---
# newfs /dev/rsd1a
/dev/rsd1a: 154.9MB (317200 sectors) block size 8192, fragment size 1024
        using 4 cylinder groups of 38.73MB, 4957 blks, 9600 inodes.
super-block backups (for fsck_ffs -b #) at:
sd1(esp0:0:1:0): esp0: timed out [ecb 0x942f88 (flags 0x1, dleft 10000, stat 0)], <state 5, nexus 0x942f88, phase(l 3, c 0, p 0), resid 10000, msg(q 0,o 0) DMA active>
sd1(esp0:0:1:0): sync negotiation disabled
sd1(esp0:0:1:0): esp0: timed out [ecb 0x942f88 (flags 0x41, dleft 10000, stat 0)], <state 5, nexus 0x942f88, phase(l 3, c 0, p 0), resid 10000, msg(q 20,o 0) DMA active> AGAIN
sd0: async, 8-bit transfers
sd1: async, 8-bit transfers
cd0: async, 8-bit transfers
sd1(esp0:0:1:0): esp0: timed out [ecb 0x942f88 (flags 0x1, dleft 10000, stat 0)], <state 5, nexus 0x942f88, phase(l 3, c 0, p 0), resid 10000, msg(q 0,o 0) DMA active>
sd1(esp0:0:1:0): esp0: timed out [ecb 0x942f88 (flags 0x41, dleft 10000, stat 0)], <state 5, nexus 0x942f88, phase(l 3, c 0, p 0), resid 10000, msg(q 20,o 0) DMA active> AGAIN
sd1(esp0:0:1:0): esp0: timed out [ecb 0x942f88 (flags 0x1, dleft 10000, stat 0)], <state 5, nexus 0x942f88, phase(l 3, c 0, p 0), resid 10000, msg(q 0,o 0) DMA active>
sd1(esp0:0:1:0): esp0: timed out [ecb 0x942f88 (flags 0x41, dleft 10000, stat 0)], <state 5, nexus 0x942f88, phase(l 3, c 0, p 0), resid 10000, msg(q 20,o 0) DMA active> AGAIN
---

I have to reduce sc->sc_maxxfer size to 63KB in
arch/mac68k/obio.esc.c:
---
Index: esp.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mac68k/obio/esp.c,v
retrieving revision 1.47
diff -u -r1.47 esp.c
--- esp.c	7 Mar 2007 17:22:19 -0000	1.47
+++ esp.c	2 Jun 2007 00:25:30 -0000
@@ -296,6 +296,13 @@
 	/* We need this to fit into the TCR... */
 	sc->sc_maxxfer = 64 * 1024;
 
+        switch (current_mac_model->machineid) {
+        case MACH_MACQ630:
+		/* XXX on LC630 64KB xfer causes timeout errors */
+		sc->sc_maxxfer = 63 * 1024;
+		break;
+	}
+
 	if (!quick) {
 		sc->sc_minsync = 0;	/* No synchronous xfers w/o DMA */
 		sc->sc_maxxfer = 8 * 1024;
---
Izumi Tsutsui