From owner-freebsd-current@FreeBSD.ORG Fri Jun 26 18:47:34 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16F21106564A; Fri, 26 Jun 2009 18:47:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 5AD5C8FC15; Fri, 26 Jun 2009 18:47:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 246944350; Fri, 26 Jun 2009 21:47:29 +0300 Message-ID: <4A4517BE.9040504@FreeBSD.org> Date: Fri, 26 Jun 2009 21:47:26 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.21 (X11/20090405) MIME-Version: 1.0 To: FreeBSD-Current Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: scottl@FreeBSD.org Subject: RFC: ATA to CAM integration patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2009 18:47:34 -0000 Hi. I would like to present for testing and feedback present state of my and Scott work on extending CAM subsystem to support ATA in addition to SCSI. At this moment we have: - CAM transport separated on common and SCSI-specific parts, last one wrapped with small API that allows switching; - implemented SATA-specific transport, that is automatically used when controller reports SATA bus attached to it. It supports both single drive and Port Multiplier modes. The only parts unfinished yet is the automatic hot-plug (you have to do reset/rescan manually) and heavy errors recovery; - implemented ATA disk driver for CAM infrastructure to natively operate ATA disks. It already supports most of required functionality: identify, read, write, flush, dump, NCQ; - ATAPI devices handled natively by existing SCSI peripherals drivers, by tunneling SCSI commands over ATA bus by PACKET ATA extension; - implemented AHCI controller driver, supporting most of tasty hardware features (controller command queuing, NCQ, Port Multiplier, MSI). Only some features from latest AHCI specifications for which I have no hardware left unimplemented. - camcontrol took minor changes to be able to report ATA devices. To test our work you should: - have any AHCI compatible controller configured to native AHCI mode (not a COMPATIBLE or RAID or whatever else) by BIOS; - have some Serial ATA/ATAPI drives connected to AHCI controller; - patch your recently updated 8-CURRENT with this patch: http://people.freebsd.org/~mav/cam-ata.20090626.patch - rebuild and install world and kernel; - read new ahci man page; - make sure that you will be able to boot if your SATA disk devices name change from some ad4 to ada0; - load ahci kernel module using loader prompt or loader.conf; - boot. This change does not breaks existing ATA infrastructure, it just provides higher priority driver for the same hardware. So you should be able get back at any time by just not loading ahci module. To hot-plug/unplug drive you should use `camcontrol reset ...` and then `camcontrol rescan`. Here is what I have running in my system now, connected to on-board ICH8 and JMB363 AHCI SATA controllers, using external SiI3726 Port Multiplier: %camcontrol devlist at scbus0 target 0 lun 0 (pass0,ada0) at scbus0 target 1 lun 0 (cd0,pass1) at scbus0 target 2 lun 0 (ada3,pass5) at scbus0 target 15 lun 0 (pass2) at scbus2 target 0 lun 0 (pass3,ada1) at scbus3 target 0 lun 0 (pass4,ada2) ICH8 AHCI controller works fine with multi-vector MSI enabled and all disk drives listed here are using NCQ. Trivial benchmark on usual HDD shown me about 15% speedup from enabling NCQ. I am successfully running two of my systems with this new driver during last week. Waiting for your feedback. -- Alexander Motin