New SCSI Framework Patches Available
Justin T. Gibbs
gibbs at plutotech.com
Thu Oct 2 20:40:48 PDT 1997
------- Blind-Carbon-Copy
X-Mailer: exmh version 2.0zeta 7/24/97
To: gibbs at FreeBSD.org
Subject: New SCSI Framework Patches Available
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Thu, 02 Oct 1997 21:40:15 -0600
From: "Justin T. Gibbs" <gibbs at narnia.plutotech.com>
Common Access Method SCSI layer Patches Available
You've all seen messages talking about a new SCSI layer for FreeBSD,
and I'm pleased to announce the first Alpha release of that work. I plan
to release snapshots on a weekly basis as new features and hardware support
are added. To see what is currently supported, skip down to the supported
hardware section.
So now you must be asking yourself, "What is CAM? and why would I want it?"
CAM is an ANSI ratified spec that defines a software interface for talking
to SCSI and ATAPI devices. This new SCSI layer for FreeBSD is not strictly
CAM compliant, but follows many of the precepts of CAM. More importantly,
this work addresses many of the short comings of the previous SCSI layer
and should provide better performance, reliability, and ease the task of
adding support for new controllers.
I hope that many of you will try it. "work in progress", this code has been
through over two months of testing here at Pluto and I feel pretty good
about the stability of the code. If you do have the facilities to
experiment, please do. I welcome your feedback especially about the
performance of the new system.
Features:
Round-robin, per priority level scheduling of devices and their
resources.
I/O Completion, error recovery, and processing queued I/O is
performed in a separate software interrupt handler. The old
system had the potential of blocking out hardware interrupts
for lengthy periods as much of this processing occurred as the
result of a call from the controller's interrupt handler.
The generic SCSI layer now understands tagged I/O and exports
this functionality to the peripheral drivers. This allows drivers
like the "direct access" driver to perform ordered tagged
transactions for meta-data writes. Async, ordered, meta-data
writes are now enabled in vfs_bio.c
The "direct access" driver prevents "tag starvation" from occurring
by guaranteeing that at least one write in every 5 second period
to a tagged queuing device has an ordered tag. This removes the
need for individual controller drivers to worry about this problem.
Complete and controller independent handling of the "QUEUE FULL" and
"BUSY" status codes. The number of tags that are queued to a
device are dynamically adjusted by the generic layer.
Interrupt driven sub-device probing. At boot time, all buses are
probed in parallel yielding a much faster boot. As probing occurs
after all interrupt and timer services are available, no additional
(and often error prone) "polling" code is needed in each controller
driver.
Better error recovery. When an error occurs, the queue of
transactions to the erring device is "frozen", full status is
reported back to the peripheral driver, and the peripheral driver
can recover the device without perturbing queued up I/O. As
all transactions have an associated priority and generation count,
after recovery is complete, transactions that are retried are
automatically re-queued in their original order.
All error handling is performed based on a detected failure.
The old code would often perform actions "just in case" before
accessing a device as the error recovery mechanism was inadequate.
Now, for example, if your disk spins down, the system will properly
recover even if the device is already open.
Support for "high power" commands. Peripheral drivers can mark
actions that may tax a power supply as "high powered". Only a
certain number (default of 4, but configurable with the
CAM_MAX_HIGHPOWER kernel option) of these commands are allowed
to be active at a time. This allows a user to, for example,
disable spin-up on the drives in an enclosure and let the system
spin them up in a controlled fashion.
By default, all luns are scanned on devices during probe. In the
old SCSI layer, this was often problematic as it performed a
Test Unit Ready prior to performing an Identify. Many devices
that properly handle the Identify will hang the bus if you attempt
a different command to a high lun.
Transfer negotiations only occurs to devices that actually
support negotiations (based on their inquiry information).
This is performed in a controller independent fashion.
There is now a generic quirk mechanism that allows controllers,
peripheral drivers, or the CAM transport layer to define their
own quirks entries. Currently the CAM transport layer has
quirk entries that allow for modulation of tags and disabling
multi-lun probing. The AdvanSys driver uses quirk entries to
control some of the "hardware bug fixes" in the driver that only
apply to certain types of devices.
Hard-wiring of devices to specific unit numbers is supported
as it was in the old system.
Userland "pass-through" commands are supported. The interface is
different than from the old SCSI code, but sample code is
provided (including patches to XMCD), and we do plan to provide
a scsi.8 command in the future.
SUPPORTED HARDWARE
Aic7xxx driver (ahc):
This driver supports all of the devices the original FreeBSD
driver supports but with the following new features:
Autotermination support for aic7860 based cards.
Indirect SCB paging that allows up to 255 SCBs to
be active on aic7770, aic7850, and aic7860 cards.
Bug fixes to the multi-lun support.
The beginnings of a target mode implementation.
AdvanSys Driver (adv):
This driver supports the entire line of AdvanSys narrow
channel devices. Tagged queuing is also supported.
The only caveat is that bounce buffering is not implemented
yet, so ISA cards must be used in systems with less than
16MB of RAM.
The next driver I will be working on will support the Buslogic Multimaster
cards.
Supported peripherals:
Direct Access driver (da):
512 byte sectored disk drivers. Support for other sector sizes is
planned, but further investigation on the "right" approach for this
is needed. It probably belongs in the disk-slice code.
CDROM driver (cd):
This driver should support everything the old driver did.
Other peripheral drivers are in the works.
HOW TO INSTALL IT
BACKUP YOUR OLD KERNEL!!!
cp /kernel /kernel.works
Get the code:
ftp://ftp.FreeBSD.org/pub/FreeBSD/incoming/cam-971002.tar.gz
ftp://ftp.FreeBSD.org/pub/FreeBSD/incoming/cam-971002.diffs.gz
ftp://ftp.FreeBSD.org/pub/FreeBSD/incoming/cam-971002samples.tar.gz
cd /usr/src
tar xvfz cam-971002.tar.gz
zcat cam-971002.diffs.gz | patch
cd usr.sbin/config
make clean all install
cd sys/i386/conf
vi MYKERNEL
Comment out all unsupported SCSI devices, and substitute "da" for
"sd". Look in LINT or GENERIC for examples.
config MYKERNEL
cd ../../MYKERNEL
make all
make install
If you want XMCD or the userland sample code, untar cam-971002samples.tar.gz
and read the enclosed README file.
- --
Justin T. Gibbs
===========================================
FreeBSD - Turning PCs into workstations
===========================================
------- End of Blind-Carbon-Copy
More information about the aic7xxx
mailing list