A typical LBA size is (going to be) 4KB, a multiplier of 32 is not
universal. You could use ceil(LBA_size_in_bytes/16), but it sometimes
leads to odd multipliers, and still there is no contiguous LBA
processing with other ugly sizes. -Laszlo

> -------- Original Message --------
> Subject: LBA to I mapping
> From: "Colin Sinclair" <[EMAIL PROTECTED]>
> Date: Wed, December 14, 2005 12:09 pm
> To: <[EMAIL PROTECTED]>
> 
> There is still some confusion on this mapping:
> 
> The minutes (and Rob just now) said "offset by 64K" which to me means
> 
>       I = 2^16 + LBA*32 + (0..31)     for 512 byte sectors
> and   I = 2^16 + LBA*33 + (0..32)   for 520 byte sectors
> 
> but Laszlo said:
> 
> "C. I also agree with the proposal to count
> the cipher blocks as I = LBA*2^16+(0,1,2...)."
> 
> which is clearly different, and contiguous sector processing is not possible.
> 
> I'm guessing the former was the intention.
> 
> > Rob said:
> > I would prefer that I increment without knowledge of the underlying
> > block size; let the unaligned devices take the hit of a full adder,
> > since they already have to stall to do the CTS (as you mentioned).
> 
> The LBA size is required to be known with whatever scheme is chosen, because 
> to get the initial I
> value for a random access sector you have to do a multiply of LBA * 
> sector_size_in_blocks. My
> mapping approach which works for any sector size avoids an awkward multiply 
> by 33 for odd-sized
> sectors. It allows a contiguous increment for consecutive nice-sized sectors 
> as you desire, but
> makes odd-sized sectors only slightly more painful (reset bottom n bits to 
> zero and add 2^n).
> 
> > LBAs in both SCSI logical units and ATA devices start at 0.
> 
> This is important. I am slightly worried that I values of 0 are not allowed 
> (since T is then 0) and
> I think this is perhaps why the current spec defines a key scope starting at 
> 1. The offset by 64K
> proposal eliminates this problem; with my mapping scheme I would just set the 
> MS bit of I (add
> 2^127), which shouldn't interfere with the 30 or so LBA bits at all:
> 
>       I = 2^127 + LBA<<n + (0,1,2...j-1), where n = ceil(log2(j))
> 
> Colin.

Reply via email to