On Fri, 2009-02-20 at 02:50 -0800, vaibhav nipunage wrote:
> Hi All,
>
> I have question about how the iscsi-target & any initator negotiate
> the block size. i.e. how initiator will understand that the iscsi-
> target is configured for another size, say 4096. How will iscsi-target
> tell the initiators that I am configured for 4096 as block size
> instead of 512?
>
This is either done via READ_CAPACITY or READ_CAPACITY_16 CDBs during
SCSI device scan on the initiator/client side using the "Logical Block
Length in Bytes" or using Block Descriptor pages with MODE_SENSE* and
MODE_SELECT* to determine the "Logical Block Length" according to sbc-3
documents.
The latter is AFAICT is the preferred method to do detection of a
changed sector/block size in an OS independent manner. Linux for
example currently does this for TYPE_DISK using
drivers/scsi/sd.c:sd_revalidate_disk() to do this in a OS dependent
manner to redetermine what the total sector/block count and sector/block
size are for a given SCSI target endpoint.
--nab