Re: LSI SAS2008 SATA TRIM not working

2015-09-08 Thread Chang Limin
Kurt Miller  intricatesoftware.com> writes:

> 
> On Thu, 2014-02-06 at 18:56 -0500, Kurt Miller wrote:
> > Various sources indicate that LSI's SAS2008 controllers support TRIM
> > when running their IT firmware (LSI [1] and this list [2]). However, I
> > have not been able to get it working with Dell PERC H200 or H310 cross
> > flashed into LSI IT firmware. Currently I'm testing with Samsung 840 EVO
> > SATA SSDs. I have tried various LSI IT firmware versions (P14, P16, P18)
> > and various Linux distributions (Ubuntu 13.10, Ubuntu 12.04, Ubuntu 14
> > beta, RHEL 7 beta, Fedora 19).
> >
> > Is TRIM working for anyone using LSI SAS2008 controllers?
> 
> It turns out yes, TRIM is working for LSI SAS2008 controllers. However,
> the Samsung 840 EVO's are not compatible with it and are also missing
> from the LSI compatibility list for the controller [1]. When I got my
> hands on an SSD that is on the list, TRIM worked as expected.
> 
> [1] http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus
> %20Adapters%20Common%20Files/LSI_6Gb_SAS_SATA_HBA_Compatibility_List.pdf
> 
> Regards,
> -Kurt
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo  vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

I find the Hitachi HUS110 disk storage also does not support fstrim, 
actually it supports unmap. 
The reason is the lbpme in 'sg_readcap -16' return 0, but the unmap in 
'sg_vpd -p 0xb2' return 1. 
Maybe the storage is not fully compatible to the SCSI standard.

# sg_readcap -16 /dev/dm-2
Read Capacity results:
   Protection: prot_en=0, p_type=0, p_i_exponent=0
   Logical block provisioning: lbpme=0, lbprz=1

# sg_vpd --page=0xb2 /dev/dm-2
Logical block provisioning VPD page (SBC):
  Unmap command supported (LBPU): 1
  Write same (16) with unmap bit supported (LBWS): 1


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: LSI SAS2008 SATA TRIM not working

2014-02-11 Thread Kurt Miller
I can report that the Samsung 840 Pro *does* support trim on the LSI
SAS2008. As suspected it supports deterministic read zeros after trim.

One other thing to note, in my testing the P16 LSI firmware has broken
trim support. P14 and P15 report incorrect values for
/sys/block/sdX/queue/discard_granularity. P17 and P18 appear to work
fine and report correct values for discard_granularity.

-Kurt

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: LSI SAS2008 SATA TRIM not working

2014-02-09 Thread Kurt Miller
On Fri, 2014-02-07 at 20:24 -0500, Martin K. Petersen wrote:
> > "Kurt" == Kurt Miller  writes:
> 
> Kurt> #  hdparm -I /dev/sdc
> 
> [...]
> 
> I don't see any deterministic read after trim/read zero after trim
> support on your drive. And I have a sneaking suspicion that those are
> two of the fields that the LSI firmware looks at when deciding whether
> to support logical block provisioning (in addition to support for the
> DSM TRIM command).
> 

I wonder how to bring this issue to LSI's attention? My cross flashed
used controllers are out of support with LSI so I don't think I can get
them to listen to me.

>From a pricing perspective the Samsung 840 Pro looks interesting and is
on LSI's supported list. Does anyone have one of these around and can
check for deterministic read after trim? (hdparm -I /dev/sdc | grep
TRIM).

Thanks,
-Kurt

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: LSI SAS2008 SATA TRIM not working

2014-02-07 Thread Martin K. Petersen
> "Kurt" == Kurt Miller  writes:

Kurt> #  hdparm -I /dev/sdc

[...]

I don't see any deterministic read after trim/read zero after trim
support on your drive. And I have a sneaking suspicion that those are
two of the fields that the LSI firmware looks at when deciding whether
to support logical block provisioning (in addition to support for the
DSM TRIM command).

-- 
Martin K. Petersen  Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: LSI SAS2008 SATA TRIM not working

2014-02-07 Thread Kurt Miller
On Fri, 2014-02-07 at 15:59 -0500, Martin K. Petersen wrote:
> > "Kurt" == Kurt Miller  writes:
> Kurt>provisioning: lbpme=0, lbprz=0 Last logical block
>^^^
> 
> This indicates the SAT on the mpt2sas board didn't enable discard
> support for the drive.
> 
> Please provide the full output of hdparm -I. Maybe we can get some clues
> as to why that is...

Thanks again.

#  hdparm -I /dev/sdc

/dev/sdc:

ATA device, with non-removable media
Model Number:   Samsung SSD 840 EVO 500GB   
Serial Number:  S1DHNSAD921246E 
Firmware Revision:  EXT0BB0Q
Transport:  Serial, ATA8-AST, SATA 1.0a, SATA II Extensions,
SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
Used: unknown (minor revision code 0x0039) 
Supported: 9 8 7 6 5 
Likely used: 9
Configuration:
Logical max current
cylinders   16383   16383
heads   16  16
sectors/track   63  63
--
CHS current addressable sectors:   16514064
LBAuser addressable sectors:  268435455
LBA48  user addressable sectors:  976773168
Logical  Sector size:   512 bytes
Physical Sector size:   512 bytes
Logical Sector-0 offset:  0 bytes
device size with M = 1024*1024:  476940 MBytes
device size with M = 1000*1000:  500107 MBytes (500 GB)
cache/buffer size  = unknown
Nominal Media Rotation Rate: Solid State Device
Capabilities:
LBA, IORDY(can be disabled)
Queue depth: 32
Standby timer values: spec'd by Standard, no device specific minimum
R/W multiple sector transfer: Max = 16  Current = 16
DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
 Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4 
 Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
Enabled Supported:
   *SMART feature set
Security Mode feature set
   *Power Management feature set
   *Write cache
   *Look-ahead
   *Host Protected Area feature set
   *WRITE_BUFFER command
   *READ_BUFFER command
   *NOP cmd
   *DOWNLOAD_MICROCODE
SET_MAX security extension
   *48-bit Address feature set
   *Device Configuration Overlay feature set
   *Mandatory FLUSH_CACHE
   *FLUSH_CACHE_EXT
   *SMART error logging
   *SMART self-test
   *General Purpose Logging feature set
   *WRITE_{DMA|MULTIPLE}_FUA_EXT
   *64-bit World wide name
Write-Read-Verify feature set
   *WRITE_UNCORRECTABLE_EXT command
   *{READ,WRITE}_DMA_EXT_GPL commands
   *Segmented DOWNLOAD_MICROCODE
   *Gen1 signaling speed (1.5Gb/s)
   *Gen2 signaling speed (3.0Gb/s)
   *Gen3 signaling speed (6.0Gb/s)
   *Native Command Queueing (NCQ)
   *Phy event counters
   *READ_LOG_DMA_EXT equivalent to READ_LOG_EXT
   *DMA Setup Auto-Activate optimization
Device-initiated interface power management
   *Asynchronous notification (eg. media change)
   *Software settings preservation
   *SMART Command Transport (SCT) feature set
   *SCT Write Same (AC2)
   *SCT Error Recovery Control (AC3)
   *SCT Features Control (AC4)
   *SCT Data Tables (AC5)
   *reserved 69[4]
   *DOWNLOAD MICROCODE DMA command
   *SET MAX SETPASSWORD/UNLOCK DMA commands
   *WRITE BUFFER DMA command
   *READ BUFFER DMA command
   *Data Set Management TRIM supported (limit 8 blocks)
Security: 
Master password revision code = 65534
supported
not enabled
not locked
not frozen
not expired: security count
supported: enhanced erase
2min for SECURITY ERASE UNIT. 8min for ENHANCED SECURITY ERASE UNIT. 
Logical Unit WWN Device Identifier: 50025388a003c374
NAA : 5
IEEE OUI: 002538
Unique ID   : 8a003c374
Checksum: correct

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: LSI SAS2008 SATA TRIM not working

2014-02-07 Thread Martin K. Petersen
> "Kurt" == Kurt Miller  writes:

Kurt> Thank you for your reply. Below is the output you requested. Note
Kurt> that when the EVO's are connected to a SATA AHCI port on my
Kurt> desktop motherboard, TRIM works okay. Please let me know if you
Kurt> need additional information.

Kurt>provisioning: lbpme=0, lbprz=0 Last logical block
   ^^^

This indicates the SAT on the mpt2sas board didn't enable discard
support for the drive.

Please provide the full output of hdparm -I. Maybe we can get some clues
as to why that is...

-- 
Martin K. Petersen  Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: LSI SAS2008 SATA TRIM not working

2014-02-07 Thread Kurt Miller
On Fri, 2014-02-07 at 15:44 -0500, Martin K. Petersen wrote:
> > "Kurt" == Kurt Miller  writes:
> 
> Kurt> Is TRIM working for anyone using LSI SAS2008 controllers?
> 
> Yes. But its SAT appears to be somewhat selective about which devices it
> flags as capable.
> 
> Please send me the output of:
> 
> # sg_readcap -l /dev/sdc
> # sg_vpd -p bl /dev/sdc
> # sg_vpd -p lbpv /dev/sdc
> 

Hi Martin,

Thank you for your reply. Below is the output you requested. Note that
when the EVO's are connected to a SATA AHCI port on my desktop
motherboard, TRIM works okay. Please let me know if you need additional
information.

Regards,
-Kurt

# sg_readcap -l /dev/sdc
Read Capacity results:
   Protection: prot_en=0, p_type=0, p_i_exponent=0
   Logical block provisioning: lbpme=0, lbprz=0
   Last logical block address=976773167 (0x3a38602f), Number of logical
blocks=976773168
   Logical block length=512 bytes
   Logical blocks per physical block exponent=0
   Lowest aligned logical block address=0
Hence:
   Device size: 500107862016 bytes, 476940.0 MiB, 500.11 GB

# sg_vpd -p bl /dev/sdc
Block limits VPD page (SBC):
  Write same no zero (WSNZ): 0
  Maximum compare and write length: 0 blocks
  Optimal transfer length granularity: 0 blocks
  Maximum transfer length: 0 blocks
  Optimal transfer length: 0 blocks
  Maximum prefetch length: 0 blocks
  Maximum unmap LBA count: 0
  Maximum unmap block descriptor count: 0
  Optimal unmap granularity: 0
  Unmap granularity alignment valid: 0
  Unmap granularity alignment: 0
  Maximum write same length: 0x0 blocks

# sg_vpd -p lbpv /dev/sdc
Logical block provisioning VPD page (SBC):
  Unmap command supported (LBPU): 0
  Write same (16) with unmap bit supported (LBWS): 0
  Write same (10) with unmap bit supported (LBWS10): 0
  Logical block provisioning read zeros (LBPRZ): 0
  Anchored LBAs supported (ANC_SUP): 0
  Threshold exponent: 0
  Descriptor present (DP): 0
  Provisioning type: 0


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: LSI SAS2008 SATA TRIM not working

2014-02-07 Thread Kurt Miller
On Thu, 2014-02-06 at 18:56 -0500, Kurt Miller wrote:
> Various sources indicate that LSI's SAS2008 controllers support TRIM
> when running their IT firmware (LSI [1] and this list [2]). However, I
> have not been able to get it working with Dell PERC H200 or H310 cross
> flashed into LSI IT firmware. Currently I'm testing with Samsung 840 EVO
> SATA SSDs. I have tried various LSI IT firmware versions (P14, P16, P18)
> and various Linux distributions (Ubuntu 13.10, Ubuntu 12.04, Ubuntu 14
> beta, RHEL 7 beta, Fedora 19).
>
> Is TRIM working for anyone using LSI SAS2008 controllers?

It turns out yes, TRIM is working for LSI SAS2008 controllers. However,
the Samsung 840 EVO's are not compatible with it and are also missing
from the LSI compatibility list for the controller [1]. When I got my
hands on an SSD that is on the list, TRIM worked as expected.

[1] http://www.lsi.com/downloads/Public/Host%20Bus%20Adapters/Host%20Bus
%20Adapters%20Common%20Files/LSI_6Gb_SAS_SATA_HBA_Compatibility_List.pdf

Regards,
-Kurt

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: LSI SAS2008 SATA TRIM not working

2014-02-07 Thread Martin K. Petersen
> "Kurt" == Kurt Miller  writes:

Kurt> Is TRIM working for anyone using LSI SAS2008 controllers?

Yes. But its SAT appears to be somewhat selective about which devices it
flags as capable.

Please send me the output of:

# sg_readcap -l /dev/sdc
# sg_vpd -p bl /dev/sdc
# sg_vpd -p lbpv /dev/sdc

-- 
Martin K. Petersen  Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html