diff mbox

virtio-scsi: Allow LUNs bigger than 255

Message ID 1500379864-340-1-git-send-email-thuth@redhat.com
State Accepted
Headers show

Commit Message

Thomas Huth July 18, 2017, 12:11 p.m. UTC
The virtio-scsi device expects LUNs according to a "Single level LUN
structure" as defined in the "SCSI Architecture Model" specification.
SLOF currently only uses the "Single level LUN structure using
peripheral device addressing method" which provides the possibility
to specify up to 256 different LUNs.
To be able to use LUNs greater than 255, the "Single level LUN structure
using flat space addressing method" has to be used instead. This can
be done by setting the top-most bits to "01" instead of "00" in the first
byte of the two LUN bytes.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1431584
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 board-qemu/slof/virtio-scsi.fs | 1 +
 1 file changed, 1 insertion(+)

Comments

Alexey Kardashevskiy July 19, 2017, 3:27 a.m. UTC | #1
On 18/07/17 22:11, Thomas Huth wrote:
> The virtio-scsi device expects LUNs according to a "Single level LUN
> structure" as defined in the "SCSI Architecture Model" specification.
> SLOF currently only uses the "Single level LUN structure using
> peripheral device addressing method" which provides the possibility
> to specify up to 256 different LUNs.
> To be able to use LUNs greater than 255, the "Single level LUN structure
> using flat space addressing method" has to be used instead. This can
> be done by setting the top-most bits to "01" instead of "00" in the first
> byte of the two LUN bytes.
> 
> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1431584
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  board-qemu/slof/virtio-scsi.fs | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/board-qemu/slof/virtio-scsi.fs b/board-qemu/slof/virtio-scsi.fs
> index d52741e..d7ce3cc 100644
> --- a/board-qemu/slof/virtio-scsi.fs
> +++ b/board-qemu/slof/virtio-scsi.fs
> @@ -144,6 +144,7 @@ scsi-open
>  ;
>  
>  : dev-generate-srplun ( target lun-id -- srplun )
> +    dup ff > IF 4000 or THEN    \ Use the LUN "flat space addressing method"
>      swap 0100 or 10 << or 20 <<
>  ;
>  
> 

Thanks, applied.

I am still digesting PCI patches.
diff mbox

Patch

diff --git a/board-qemu/slof/virtio-scsi.fs b/board-qemu/slof/virtio-scsi.fs
index d52741e..d7ce3cc 100644
--- a/board-qemu/slof/virtio-scsi.fs
+++ b/board-qemu/slof/virtio-scsi.fs
@@ -144,6 +144,7 @@  scsi-open
 ;
 
 : dev-generate-srplun ( target lun-id -- srplun )
+    dup ff > IF 4000 or THEN    \ Use the LUN "flat space addressing method"
     swap 0100 or 10 << or 20 <<
 ;