Hi Martin, Thanks for your input, and for the link to your nice writeup. On Thu, May 9, 2013 at 7:43 PM, Martin K. Petersen <martin.petersen@xxxxxxxxxx> wrote: >>>>>> "Ronnie" == ronnie sahlberg <ronniesahlberg@xxxxxxxxx> writes: > > Ronnie> * please have a look at the tests and the test results I linked > Ronnie> to above. I currently have quite a few tests but am happy to > Ronnie> add more. > > Aside from issuing commands with various bits set, I'd like to see some > more sanity checking. Mainly to see whether it responds correctly to the > features is claims to support. I will start to add such. I think your document will provide ideas on what to start writing tests for. > > I.e. do the values reported in the Block Limits VPD look sane given what > we know about the device in general (SCSI level, capacity, PI supported, > discard supported, etc.)? I have added tests for the block limits VPD as SCSI.Inquiry.InquiryBlockLimits. It checks that the pagelength is valid. 3C if SBC3 is claimed and 0C if prior to SBC3. It then validates that the UNMAP counts are sane. Sane being that if LBPU==0 then these must be 0, and if LBPU==1 then these must be >1, must be >than 2**LBPPBE and either 0xffffffff or <1M. (1M is arbitrary for "crazy large" number of blocks) The other fields I had a hard time to come up with good sanity tests for. Any suggestions ? Do you have examples of things that vendors get wrong here ? > > Right now you always expect RDPROTECT/WRPROTECT > 0 to fail, but they > should succeed if the device is formatted with PI. I have added a check so that the tests are skipped if the device does not support protection information or if it supports protection information but but it is not enabled. I will add tests for when protection information is enabled in the future, I will need to find time to add it to tgt first. > > FWIW, my slightly outdated document is here: > > https://oss.oracle.com/~mkp/docs/linux-advanced-storage.pdf Very nice document. Section 1.3 could update though. READCAPACITY16 is only mandatory in SBC-2 IF the device supports protection information, but optional if it does not. In SBC-3 it is always mandatory though. Thin provisioning and different logical/physical block sizes were only added to this command in SBC-3 not SBC-2. I have thus updated my READCAPACITY16 tests so that IF SBC-3 is claimed, or if IQN->PROTECT is set then the device must support this opcode or the test will fail. Otherwise, if it is not SBC-3 and if PROTECT is clear, then the test will be skipped but not fail if the opcode is missing. If you want to, have time and if you have specific opcodes/features that vendors get wrong, I am happy to add tests if you point me in the right direction for what you want me to add tests for. regards ronnie sahlberg > > -- > Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html