All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Bart Van Assche <bvanassche@acm.org>,
	James Bottomley <jbottomley@parallels.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	Ewan Milne <emilne@redhat.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCHv4 0/6]  Support 64-bit LUNs
Date: Wed, 11 Jun 2014 08:34:21 +0200	[thread overview]
Message-ID: <5397F86D.1030503@suse.de> (raw)
In-Reply-To: <53974739.8070303@acm.org>

On 06/10/2014 07:58 PM, Bart Van Assche wrote:
> On 06/03/14 10:58, Hannes Reinecke wrote:
>> this patchset updates the SCSI stack to support full 64-bit LUNs.
>> The first patch is a simple fix; the next patch updates
>> the sequential scan logic to be compliant with SPC.
>> The third patch addresses a firmware issue with earlier
>> qla2xxx HBAs.
>> The next two patches update the SCSI stack and all drivers
>> to use 64-bit LUNs where appropriate.
>> And finally we need to update the conversion routines
>> scsilun_to_int to cope with 64bit LUNs.
>>
>> Two drivers have issues with 64bit LUNs:
>> - The qla2xxx driver uses a 32-bit LUN value for TMFs.
>>    But as the driver uses a max_lun value from 0xFFFF
>>    we should be safe for the time being.
>> - The zfcp driver uses a 32-bit LUN for debug records; the
>>    record format would need to be updated to cope with
>>    64-bit LUNs. But again, this driver uses 0xFFFFFFFF
>>    for max_lun, so it doesn't do any harm.
>>
>> The other changes have been pretty straightforward.
>
> Hello Hannes,
>
> Many SCSI LLD's use int_to_scsilun() in the hot path (queuecommand()).
> This patch series makes the int_to_scsilun() function slightly more
> expensive. Has it been considered to cache the result of int_to_scsilun()
> such that LLD's can copy the cached int_to_scsilun() result instead of
> having to call int_to_scsilun() in the queuecommand() function ?
> Something like the (untested) patch below might be sufficient:
>
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index e02b3aa..9e50d78 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -244,6 +244,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
>   	sdev->queue_ramp_up_period = SCSI_DEFAULT_RAMP_UP_PERIOD;
>   	sdev->id = starget->id;
>   	sdev->lun = lun;
> +	int_to_scsilun(lun, &sdev->scsi_lun);
>   	sdev->channel = starget->channel;
>   	sdev->sdev_state = SDEV_CREATED;
>   	INIT_LIST_HEAD(&sdev->siblings);
> diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
> index 5853c91..48ea68e 100644
> --- a/include/scsi/scsi_device.h
> +++ b/include/scsi/scsi_device.h
> @@ -100,6 +100,8 @@ struct scsi_device {
>
>   	unsigned int id, lun, channel;
>
> +	struct scsi_lun scsi_lun;	/* int_to_scsilun(lun) */
> +
>   	unsigned int manufacturer;	/* Manufacturer of device, for using
>   					 * vendor-specific cmd's */
>   	unsigned sector_size;	/* size in bytes */
>
> Thanks,
>
Hmm. No, so far it hasn't been considered. Maybe it's even 
worthwhile to move the situation around, ie using primarily the 
64-bit LUN and only convert it into an integer if so requested.
But yeah, it's definitely something we should look into.

Maybe _after_ the patchset is in?

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-06-11  6:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03  8:58 [PATCHv4 0/6] Support 64-bit LUNs Hannes Reinecke
2014-06-03  8:58 ` [PATCH 1/6] scsi: Remove CONFIG_SCSI_MULTI_LUN Hannes Reinecke
2014-06-03  8:58 ` [PATCH 2/6] scsi_scan: Restrict sequential scan to 256 LUNs Hannes Reinecke
2014-06-03  8:58 ` [PATCH 3/6] qla2xxx: Restrict max_lun to 16-bit for older HBAs Hannes Reinecke
2014-06-03  8:58 ` [PATCH 4/6] scsi: use 64-bit LUNs Hannes Reinecke
2014-06-03  8:58 ` [PATCH 5/6] scsi: use 64-bit value for 'max_luns' Hannes Reinecke
2014-06-25 12:28   ` Christoph Hellwig
2014-06-25 12:31     ` Hannes Reinecke
2014-06-25 12:33       ` Christoph Hellwig
2014-07-09  0:00     ` Rusty Russell
2014-07-09  0:00       ` Rusty Russell
2014-06-03  8:58 ` [PATCH 6/6] scsi_scan: Fixup scsilun_to_int() Hannes Reinecke
2014-06-10 11:37   ` Bart Van Assche
2014-06-10 13:41     ` Douglas Gilbert
2014-06-10 14:06     ` James Bottomley
2014-06-10 14:48       ` Bart Van Assche
2014-06-10 15:01         ` James Bottomley
2014-06-10 16:08           ` Bart Van Assche
2014-06-10 14:55       ` Douglas Gilbert
2014-06-10 17:58 ` [PATCHv4 0/6] Support 64-bit LUNs Bart Van Assche
2014-06-11  6:34   ` Hannes Reinecke [this message]
2014-06-11  6:53     ` Bart Van Assche
2014-06-11 13:44       ` Douglas Gilbert

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=5397F86D.1030503@suse.de \
    --to=hare@suse.de \
    --cc=bvanassche@acm.org \
    --cc=emilne@redhat.com \
    --cc=hch@infradead.org \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    /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 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.