All of lore.kernel.org
 help / color / mirror / Atom feed
* virtio_scsi LUN usage
@ 2014-07-04 14:29 Hannes Reinecke
  0 siblings, 0 replies; only message in thread
From: Hannes Reinecke @ 2014-07-04 14:29 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Stefan Hajnoczi, SCSI Mailing List

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-04 14:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-04 14:29 virtio_scsi LUN usage Hannes Reinecke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.