public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Christof Schmitt <christof.schmitt@de.ibm.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH] zfcp: Report FCP LUN to SCSI midlayer
Date: Fri, 22 Jun 2007 21:01:38 +0200	[thread overview]
Message-ID: <467C1C92.2080405@s5r6.in-berlin.de> (raw)
In-Reply-To: <1182476482.3923.44.camel@mulgrave.il.steeleye.com>

James Bottomley wrote:
> H:C is really mid-layer defined (although I'd like to get rid of C
> eventually).  They really correspond to physical enumeration of the HBA
> devices.  T (or I) is the one we think could be abstracted and placed
> within the gift of the transport, but so far there's been a lot of
> debate with few actual concrete proposals.  L is basically defined by
> SAM for every transport, but I'm really unsure how it should be
> represented in all its SAM specified glory.

If we reduce this discussion to the sysfs representation, then there is
one important point to understand:  The sysfs device path is
implementation-defined.  It always has been, always will be.  That's
inherent to sysfs.

So, having the current implementation-defined H:C:T:L in the sysfs
device path is alright.

Trying to squeeze the SAM LU identifiers and target port identifiers
into the sysfs path might not be such a good idea, exactly because there
is a number of different formats of these identifiers.  We certainly
want to find devices in sysfs in a transport-independent way.

So these identifiers should go somewhere else.  How about exporting
sysfs attributes for each sdev with common names like
	logical_unit_identifier
	target_port_identifier
	initiator_port_identifier
but with transport-dependent contents?  The various transport-layer
implementations can do this without hand-holding of the SCSI core; the
only thing that's important is that all transports use the same names
for these attributes.  The attributes shall be human-readable and can be
used by system management software like udev, hal, lsscsi, whatever.

If SCSI mid-layer wants to control what attribute names are used but
wants to leave the formatting of the contents to the transports, add for
example something like:

struct scsi_transport_template {
	...
	int (* print_logical_unit_identifier)(char *buf,
					struct scsi_device *sdev);
	int (* print_target_port_identifier)(char *buf,
					struct scsi_device *sdev);
	int (* print_initiator_port_identifier)(char *buf,
					struct scsi_device *sdev);
	...
};

Then SCSI mid-layer creates and destroys the attributes and
transport-layer implementations deliver contents for them.  The print_
hooks can also be used for debug printk's or the like if need be.

What's then left of the issues with H:C:T:L are the varying difficulties
that some transports have to fill in some more or less sensible values
in the mid-layer's variables corresponding to H:C:T:L.  Well, actually
the values don't have to make a lot of sense because they are
implementation defined and not for users to draw conclusions from them.

Or is there more to it?
-- 
Stefan Richter
-=====-=-=== -==- =-==-
http://arcgraph.de/sr/

  reply	other threads:[~2007-06-22 19:01 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 [this message]
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
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=467C1C92.2080405@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=James.Bottomley@SteelEye.com \
    --cc=christof.schmitt@de.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox