public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Hannes Reinecke <hare@suse.de>, Swen Schillig <swen@vnet.ibm.com>,
	Mike Anderson <andmike@us.ibm.com>,
	Christof Schmitt <christof.schmitt@de.ibm.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH] zfcp: Report FCP LUN to SCSI midlayer
Date: Mon, 25 Jun 2007 16:48:44 -0500	[thread overview]
Message-ID: <1182808124.3461.17.camel@localhost.localdomain> (raw)
In-Reply-To: <46801010.3050604@s5r6.in-berlin.de>

On Mon, 2007-06-25 at 20:57 +0200, Stefan Richter wrote:
> Hannes Reinecke wrote:
> > why don't we stick with the original implementation like zfcp had it?
> > We can simpley expand the midlayer to add an attribute 'lun'
> > to each scsi_device. This would be the LUN as returned by eg
> > REPORT LUNS.
> > No translation, nothing. Would be easy to implement and would allow
> > any administrator to map the h:c:i:l value to the 'real' lun.
> 
> I would also like to have the Target Port identifier in there.  This, in
> combination with the LUN alias Logical Unit identifier is useful for all
> kinds of persistent device mapping.

Really, no.  Target port is a target, not a LUN property; worse, it's
potentially transport defined.  The way target ports are currently shown
is by the relevant transport class as per target things (see the FC
transport for an example).  There's no real reason the mid-layer has to
know about these.

> The LUN could be the same data format (and display format) for all
> transports == 8 bytes.  SBP-3's native format is 2 bytes but we can
> transform and print it in the 8 bytes format; shouldn't hurt.
> 
> Actually, the SCSI midlayer integer 'l' can be used as internal
> intermediary data format as long as only those LUN variants are in
> real-world use which can be losslessly transformed to and from SCSI
> midlayer's integer 'l'.

You're sort of confusing what we display as the LUN and what we
represent it as internally (admittedly they're the same at the moment).
The object would be to separate these and the debate is really about
what to display.  I think the number for single level simple peripheral
addressing bus==0 or flat addressing and the full 64 bit entity
otherwise seems to be what people are converging on.

> The transport identifiers have transport-dependent data sizes, and the
> display formats are not standardized.  So that's requiring a little bit
> more care than the LUNs but it isn't overly complicated either.
> 
> So,
>   - SCSI mid layer should maintain sysfs attributes for each sdev which
>     show Logical Unit identifier and Target Port identifier.

LUN possibly, TPID no; the transport class does that one.

>   - Do we pass the LUN through to SCSI midlayer's sysfs code via the
>     theoretically lossy scsilun_to_int/ int_to_scsilun transformation?

Absolutely ... otherwise you won't get the correct representation when
that gets decided.

>   - Do we pass the target port identifier through as a data member in
>     struct scsi_device, or as a hook "int (* print_target_port_id)(..);"
>     in struct scsi_transport_template?
> 
>   - Do we also want initiator port identifier, initiator port name,
>     target port name, LU name?  If so, create a subdirectory for that
>     whole bunch of additional attributes?  (Most of these are just
>     optional.  In case of SBP-2/3, the initiator port identifier is
>     totally uninteresting to userspace; the initiator port name is of
>     mild interest but can be retrieved elsewhere from sysfs by some
>     black magic.)

Again, no ... these are transport dependent quantities and belong in the
transport class (if they're relevant to the transport).

> I am slowly working on loosely related stuff in the fw-sbp2
> transport-layer driver and could produce a respective patch for the
> midlayer infrastructure along the way, if nobody else does before me.
> (Next weekend at the earliest.)

James



  parent reply	other threads:[~2007-06-25 21:48 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-19  8:25 [PATCH] zfcp: Report FCP LUN to SCSI midlayer Swen Schillig
2007-06-19  8:28 ` Hannes Reinecke
2007-06-19 12:19 ` Stefan Richter
2007-06-19 17:12 ` Christoph Hellwig
2007-06-20  2:46   ` James Bottomley
2007-06-21 15:03     ` Christof Schmitt
2007-06-21 16:46       ` Stefan Richter
2007-06-21 16:54         ` Stefan Richter
2007-06-22  1:41         ` James Bottomley
2007-06-22 19:01           ` Stefan Richter
2007-06-21 20:58       ` James Bottomley
2007-06-22  4:40         ` Mike Anderson
2007-06-22 11:34           ` Christof Schmitt
2007-06-22 14:11           ` James Bottomley
2007-06-22 16:16             ` Doug Maxey
2007-06-25 20:43               ` Luben Tuikov
2007-06-25 22:53                 ` Stefan Richter
2007-06-25 10:39             ` Swen Schillig
2007-06-25 14:03               ` Hannes Reinecke
2007-06-25 18:57                 ` Stefan Richter
2007-06-25 21:27                   ` Luben Tuikov
2007-06-25 21:55                     ` Stefan Richter
2007-06-26  0:35                       ` Luben Tuikov
2007-06-26 21:29                     ` Matthew Wilcox
2007-06-25 21:48                   ` James Bottomley [this message]
2007-06-25 22:27                     ` Stefan Richter
2007-06-26  1:04                       ` Luben Tuikov
2007-06-26 10:44                         ` Stefan Richter
2007-06-26 14:20                           ` James Bottomley
2007-06-26 15:47                             ` Stefan Richter
2007-06-26 17:01                               ` James Bottomley
2007-06-27  0:27                                 ` Stefan Richter
2007-06-27  0:45                                 ` [PATCH] SCSI: delete outdated comment in API reference Stefan Richter
2007-06-26  0:49                     ` [PATCH] zfcp: Report FCP LUN to SCSI midlayer Luben Tuikov
2007-06-26  9:38                       ` Stefan Richter
2007-06-27 10:27                 ` Swen Schillig
2007-06-28  4:21                   ` Luben Tuikov
2007-06-28 15:40                     ` Stefan Richter
2007-06-30 19:07                       ` Luben Tuikov
2007-06-30 21:26                         ` Stefan Richter
2007-07-01  6:27                           ` Luben Tuikov
2007-07-01 11:07                             ` Stefan Richter
2007-06-25 20:32             ` Luben Tuikov

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=1182808124.3461.17.camel@localhost.localdomain \
    --to=james.bottomley@steeleye.com \
    --cc=andmike@us.ibm.com \
    --cc=christof.schmitt@de.ibm.com \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stefanr@s5r6.in-berlin.de \
    --cc=swen@vnet.ibm.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