5

Which case would be considered correct?

  1. Doing reads with a Read 16 command no matter if the LBA's are 32 or 64 bit.

  2. If the max LBA is 32 bit then do a Read 10 command and if the max LBA is 64 bit then do a Read 16 command.

What are the pros and cons of each choice?

I know for a Read Capacity command it is correct to run a 10 and if it returns FFFFFFFFh then run a 16. Why is this the case? The Read Capacity 16 command works for both cases and avoids even needing the Read Capacity 10 at all.

diggers3
  • 229
  • 3
  • 17

1 Answers1

5

Keep in mind that the reason that SCSI has multiple "sizes" of commands like this is, in many cases, because SCSI is a very old protocol. (It was first standardized in 1986, and was in development for some time before that!) At the time, a large SCSI device would range in the low hundreds of megabytes — even a 32-bit LBA was considered excessive at the time. The 64-bit LBA commands simply didn't exist until much later.

The question here is really just whether you want to support these old devices. If you do, you will need to use Read (10) for reads on "small" devices, as they may not recognize Read (16). Similarly, the use of Read Capacity (10) before Read Capacity (16) is because older devices won't recognize the larger version.

  • So the older devices are where the issue lies... If it is a new device, even if the LBA is 32 bit or less the Read 16 and Read Capacity 16 will be fine? – diggers3 Sep 10 '14 at 19:37
  • Thanks, I will leave the Read 10 in the code. I will use the 16 and make changes as necessary. I am testing pretty new drives for throughput and latency. Is there any difference you would expect as far as that goes? – diggers3 Sep 10 '14 at 19:41
  • I would be very surprised if there was a difference in performance between the 10 and 16-byte READ CDBs. I think you'd be fine just to use READ (16) exclusively. – Mike Andrews Sep 22 '14 at 20:42
  • 1
    @gubblebozer Not all devices (especially older devices) support READ (16). You'll get better compatibility results if you avoid it when not necessary. –  Sep 22 '14 at 20:47