]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r230053:
authormav <mav@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 6 Jun 2012 12:16:54 +0000 (12:16 +0000)
committermav <mav@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 6 Jun 2012 12:16:54 +0000 (12:16 +0000)
commitd3d617f52b4aa3ab03420a8bd860ba8945ac0522
tree0de32fc83e2338db6df63306d3459db7de4d9724
parent893d45f5c2f371494d9838b7bc28aadc2417c793
MFC r230053:
Add BIO_DELETE support for SCSI Direct Access devices (da).

Depending on device capabilities use different methods to implement it.
Currently used method can be read/set via kern.cam.da.X.delete_method
sysctls. Possible values are:
 NONE - no provisioning support reported by the device;
 DISABLE - provisioning support was disabled because of errors;
 ZERO - use WRITE SAME (10) command to write zeroes;
 WS10 - use WRITE SAME (10) command with UNMAP bit set;
 WS16 - use WRITE SAME (16) command with UNMAP bit set;
 UNMAP - use UNMAP command (equivalent of the ATA DSM TRIM command).
The last two methods (UNMAP and WS16) are defined by SBC specification and
the UNMAP method is the most advanced one. The rest of methods I've found
supported in Linux, and as soon as they were trivial to implement, then
why not? Hope they will be useful in some cases.

Unluckily I have no devices properly reporting parameters of the logical
block provisioning support via respective VPD pages (0xB0 and 0xB2). So
all info I have/use now is the flag telling whether logical block
provisioning is supported or not. As result, specific methods chosen now
by trying different ones in order (UNMAP, WS16, DISABLE) and checking
completion status to fallback if needed. I don't expect problems from this,
as if something go wrong, it should just disable itself. It may disable
even too aggressively if only some command parameter misfit.

Unlike Linux, which executes each delete with separate request, I've
implemented here the same request aggregation as implemented in ada driver.
Tests on SSDs I have show much better results doing it this way: above
8GB/s of the linear delete on Intel SATA SSD on LSI SAS HBA (mps).

Sponsored by: iXsystems, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/9@236677 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/cam/scsi/scsi_all.c
sys/cam/scsi/scsi_all.h
sys/cam/scsi/scsi_da.c