Subject: Re: Re: MI SONIC Ethernet driver for mac68k
To: None <tsutsui@ceres.dti.ne.jp, port-mac68k@NetBSD.org>
From: Michael R. Zucca <mzucca@verizon.net>
List: port-m68k
Date: 06/06/2007 12:26:07
>From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
>Date: 2007/06/06 Wed AM 11:54:57 CDT
>To: port-mac68k@NetBSD.org
>Cc: hauke@Espresso.Rhein-Neckar.DE, thorpej@shagadelic.org, port-m68k@NetBSD.org, 
	briggs@NetBSD.org, ivan.carrillo@gmail.com, tsutsui@ceres.dti.ne.jp
>Subject: Re: MI SONIC Ethernet driver for mac68k

>I wrote:
>
>> Summary:
>> 	TX on sn0	RX on sn0
>> MD:	1026KB/s	 846KB/s
>> MI:  	 793KB/s	 854KB/s
>
>more results:
>
>MI driver with BUS_DMA_COHERENT support:
>	TX on sn0	RX on sn0
>	 842KB/s	 888KB/s
>
>MI driver with BUS_DMA_COHERENT support and 16bytes TX DMA threshold:
>	TX on sn0	RX on sn0
>	 903KB/s	 886KB/s

You may never be able to beat the PSC DMA engine on TX because TX using the Sonic's DMA engine will be a read across the NuBus to DRAM, which is going to be a two cycle operation (I think), whereas, the PSC doing the TX DMA is going to be a write to the NuBus which is a single cycle operation. So, perhaps the best bet is PSC DMA for TX and Sonic DMA for RX. That way, you're only ever doing single cycle writes on the NuBus regardless of the transfer direction. It's also possible that the PSC DMA can do special large block cycles on the NuBus but it's not clear if the Sonic can do the same. That's, assuming of course, that the current MD Sonic driver we have is actually taking complete advantage of the PSC's capabilities. :)

Still, it would be kind of cool if somebody spent some time getting the most out of the PSC DMA engine. If we had real, working PSC DMA API we could use DMA for all the device channels it supports: SCSI, Net, Serial, etc. The trick is figuring out how to setup two DMA transactions in the registers and then switching them on the channel's interrupt while programming the other channel with the next item in the DMA chain. If that could be put into a reliable interface, I think most of the MD drivers we have could be made to use DMA relatively easily since most platforms seem to have good examples of how to use all chips in mac68k with DMA.

Wish I had time for this, myself. :(