How do I use NCQ of Intel X25-E(SSD) on ahci(4)?

Alexander Motin mav at FreeBSD.org
Wed Nov 18 18:05:10 UTC 2009


Ivan Voras wrote:
> Alexander Motin wrote:
>> Norikatsu Shigemura wrote:
>>>     I have a Intel 64GB SSD(X25-E) and a Western Digital Caviar Green
>>>     1TB HDD (WD10EADS), and use them on ahci(4).  ahci(4) can use NCQ
>>>     of WD10EADS, but doesn't use NCQ of X25-E.
>>>
>>> # camcontrol identify ada0
>>> pass0: <SSDSA2SH064G1GC INTEL 045C8790> ATA/ATAPI-7 SATA 2.x device
>>> pass0: 300.000MB/s transfers
>>> Native Command Queuing (NCQ)   yes              30/0x1E
>>
>> Here is the reason                                ^^^
>>
>> This drive support less tags (31) then your AHCI controller does (32).
>> Support for such case is not implemented yet. As temporary solution you
>> may limit controller to use only 31 tag, then NCQ will be used. All you
>> need is to go to ahci.c and change line
>> ch->numslots = ...;
>> to
>> ch->numslots = min(31, ...);
> 
> I know next to nothing about AHCI and drivers so this might be obviously
> wrong but wouldn't a quick (i.e. MFC-able) obvious temporary fix be to say
> 
> numslots = min(get_minimum_tags_of_all_drives(), ...)
> ?

Problem is that SIM driver has no idea about devices capabilities, and
also doesn't have method to resize queue after attach. In SCSI case,
tags are random and only simultaneous number of request is limited, and
this is handled fine by CAM. SATA NCQ is more restrictive, allowing to
use only tags 0..(N-1). I am planning to make XPT inform SIM about
supported tags for each device, to allow SIM to use that information
while scheduling requests. I didn't do it yet, just because most of
devices able to handle all 32 tags possible on SATA. This Intel SSD is
one of rare exceptions.

-- 
Alexander Motin


More information about the freebsd-current mailing list