Subject: Re: SCSI
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Dr R.S. Brooks <R.S.Brooks@liverpool.ac.uk>
List: netbsd-help
Date: 04/12/2001 17:18:37
On Sun, 8 Apr 2001, Manuel Bouyer wrote:

>On Sat, Apr 07, 2001 at 11:27:33AM +0200, Robert Szczygielski wrote:
>> Hellow !!
>>  TEKRAM DC-395U PCI USCSI 
>> in NetBSD.
>
>Sorry, we don't have driver for this in NetBSD yet. I think there was a driver
>for 1.4.x on the tekram web site.

There is indeed a driver on the Tekram website.  I got one of these
cards earlier this year from a local supplier who had some ultra-wide
SCSI disks on special offer.  As Manuel says, the driver is for 1.4.x,
but it only took an hour or so to make the necessary changes for 1.5.

HOWEVER, if you mean the DC395UW, although the driver seems to work, there
are clearly some problems.

I had bought 2 x 2.1 GB disks (intending to put / and /usr on the first,
/var on the second and swap on both).  Having built a new kernel, I
copied the (IDE) system disk to the two SCSI disks, and was able to boot.
The first problem which I noticed was that when I tried reading from
the SCSI disks with dd, systat vmstat showed a very high interrupt rate.

After rebooting from the IDE disk (to avoid any unpredictable activity
on the SCSI disks), and running

	dd if=/dev/rsd0e of=/dev/null bs=32768

I could get about 9.2 MB/sec, but reading from both disks simultaneously
makde the data rate drop to around 7.5 MB/sec.  At that time, I was too busy
to investigate further.  However, a few weeks later I got hold of an
Advansys (adw) card, and was able to compare the performance of the two
cards.  The DC395UW did seem to be producing an awful lot of interrupts
(about 6,000 per second when I was doing 32 KB reads off two disks
simultaneously).  In fact the interrupt rate seemed to be affecting system
performance.  In contrast, the Advansys card showed only a slight drop
in throughput (to about 8.8 MB/sec) when reading both disks simultaneously.

I also got in touch with Kurt Garloff, who has done a lot of work on the
Linux driver (originally released by Tekram).  His first though was that
perhaps the driver wasn't advertising scatter-gather capability properly
in NetBSD.  So I tried reading a 512 byte block and a 32 KB block with
dd, using vmstat -i to count the number of interrupts for each.  Both
took 112 interrupts (!!!), so it seems that it's not a scatter-gather
failure.  In contrast, the adw card generates 9 interrupts to do the
same I/O.

Kurt Garloff thought that the DC395UW would probably generate about 8
interrupts per read, although he hadn't specifically looked at the
interrupt rate from the card under load.  He also hinted that there were
still some problems remaining in the Linux driver.  He didn't say exactly
what, but there are release notes on
http://www.garloff.de/kurt/linux/dc395/index.html

The code from the Tekram website is something of a cat's breakfast (to
say the least), so much so that it's quite difficult to read.  However,
I did spot at least one instance of what looked to be an error handler
which didn't.  I suspect both Linux and NetBSD drivers are much the
same code (with the NetBSD driver being severely hacked about).  My first
thought was to diff the original and most recent versions of the Linux
driver and apply the changes were appropriate to the NetBSD driver.
Unfortunately, the resulting diff was almost as big as the driver, and
I haven't had time to look at it further.

I think my next step is to install Linux and see if the card produces the
same interrupt rate there.

I will have a go at the driver when I can, but I think for the time being
anyone looking for an ultra-wide SCSI card would be better with the
Advansys!

As my knowlege of SCSI protocol is a bit vague, could someone point me
to online documentation/description?  ISTR reading somewhere that although
the released IEEE docs cost money, the final drafts were available online.

Oh yes, and where do I find the incantation to make indent produce KNF?


Roger

------------------------------------------------------------------------------
Roger Brooks (Systems Programmer),          |  Email: R.S.Brooks@liv.ac.uk
Computing Services Dept,                    |  Tel:   +44 151 794 4441
The University of Liverpool,                |  Fax:   +44 151 794 4442
PO Box 147, Liverpool L69 3BX, UK           | 
------------------------------------------------------------------------------