Subject: Re: SATA-II directions
To: Jonathan A. Kollasch <jakllsch@kollasch.net>
From: Frank van der Linden <fvdl@netbsd.org>
List: tech-kern
Date: 07/24/2007 11:06:03
--+QahgC5+KEYLbs62
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Sun, Jul 22, 2007 at 01:36:49PM -0500, Jonathan A. Kollasch wrote:
> Or, would writing a proper SATA framework be much better?
NCQ can be done within the current framework. I know, because I did it
a few years ago :-) Sadly, that code can't be made public.
If you look at the ATA code, you can see that the block IO queue
is already a linked list. However, it basically only uses the head of the
list (chp->ch_queue->queue_xfer). There's only one active xfer at the
time (chp->ch_queue->active_xfer), and that needs to become a list.
You can add a maximum queue length variable to the ata_queue structure
Set the default value 1, set it to the maximum NCQ queue depth for
drives that are capable of it.
The cleanup functions for killing all xfers become somewhat more complex
with more than 1 active xfer, but it's not that hard.
- Frank
--+QahgC5+KEYLbs62
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)
iD8DBQFGpcD7+kPCkesgSF0RApU2AJ4or9e2DXOiiyUKaAw1xqXEKVCyYgCfe/MA
nP5wQjC/9pm+QwhhrFg8QPI=
=y1Co
-----END PGP SIGNATURE-----
--+QahgC5+KEYLbs62--