public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: virtio_scsi LUN usage
Date: Fri, 04 Jul 2014 16:29:00 +0200	[thread overview]
Message-ID: <53B6BA2C.80103@suse.de> (raw)

Hi Paolo,

virtio_scsi has this:

static void virtio_scsi_init_hdr(struct virtio_scsi_cmd_req *cmd,
				 struct scsi_cmnd *sc)
{
	cmd->lun[0] = 1;
	cmd->lun[1] = sc->device->id;
	cmd->lun[2] = (sc->device->lun >> 8) | 0x40;
	cmd->lun[3] = sc->device->lun & 0xff;
	cmd->tag = (unsigned long)sc;
	cmd->task_attr = VIRTIO_SCSI_S_SIMPLE;
	cmd->prio = 0;
	cmd->crn = 0;
}

As you might've seen I'm currently working on updating the SCSI 
stack to use 64-bit LUNs.
So while virtio scsi is in principle capable of using 64-bit LUNs, 
this peculiar usage makes it impossible to actually _use_ 64-bit LUNs.
Can't we get rid of this encoding and let the backend provide is 
with correct numbers?

It should work if we were just to implement a REPORT_LUN intercept, 
which sets the correct top two bytes in the command ... with that we 
should be getting only the LUNs for a particular target, and could 
then just use the provided LUN numbers as-is.

Long term I would prefer to have another 'target' field (preferably 
also 64bit wide), which could be used to specify the target 
directly. But that would require a spec change and feature flags 
yadda yadda...

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

                 reply	other threads:[~2014-07-04 14:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53B6BA2C.80103@suse.de \
    --to=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox