From: Luben Tuikov <ltuikov@yahoo.com>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Swen Schillig <swen@vnet.ibm.com>, Hannes Reinecke <hare@suse.de>,
James Bottomley <James.Bottomley@steeleye.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: Sat, 30 Jun 2007 23:27:35 -0700 (PDT) [thread overview]
Message-ID: <725061.42209.qm@web31801.mail.mud.yahoo.com> (raw)
In-Reply-To: <4686CA8D.20504@s5r6.in-berlin.de>
--- Stefan Richter <stefanr@s5r6.in-berlin.de> wrote:
> SAM itself speaks of the LUN as 8 bytes quantity as well as 64 bits
> quantity (and 2 bytes quantity as well as 16 bits quantity). Of course
> whether this dualism should be exposed in an API is another question.
"64 bit quantity", the keyword here is "quantity", _not_ "integer".
Any "u64" variation means "integer" since it dictates a BE or LE
interpretation. A mere "64 bit quantity" does not expose a BE or LE
bit ordering, and thus does not represent itself as an integer.
It is though one such for human-readability. Ideally, you'd not want
to expose this in the representation.
> SAS defines the SAS address as fitting into eight bytes. It furthermore
> defines the SAS address as a bitfield consisting of 4, 24, and 36 bits
> wide parts. (And it defines the SAM object Target port identifier to be
> implemented as SAS address.)
>
> [u8 tpid[MAX_SIZE] or u8 tpid[] or union tpid]
Notice that you've already moved down to a protocol layer, in this
case SAS and have decomposed the tpid as defined in its protocol.
Thus, you've moved too "deep" into the internal choice of what
a SAS tpid is which is only interesting for people generating
such entities, deep into the details of the _protocol_.
I doubt that your intention is to expose the _composition_ itself
of the port identifier for _each_ protocol to SCSI Core.
> Target Port Identifier is a property of Target Port. This has nothing
> to do with transport protocols.
Yes, in OOP(aradigm) this is a "virtual property".
> Of course the size, source, deeper meaning, and hence potential
> human-readable representations of Target Port Identifier are transport
> protocol dependent.
Classic OOP design.
> I acknowledge that this is a practical problem
> which can easily be solved by /not/ storing tpid in midlayer's struct
> scsi_target, thus also eliminating the need for a tpid datatype in
> midlayer's API.
> Well, it reproduces it, hence "says" it; but you are of course right in
> that it does not /define/ it.
>
> [...]
> > Ask yourself these questions: "What does SCSI Core provide?", "What should
> > SCSI Core provide?", "What should SCSI Core not provide?", "Why?".
> > Give good justifications to your answers.
>
> Among else: It should provide a framework which enables userspace to
> find the unique object identifiers (that are required to uniquely and
> persistently identify logical units) always in the same place. (That's
> just my opinion. Current userspace tools like e.g. udev scripts are
> adapted to hunt those identifiers down in various places, and this works
> too.)
This information can be had by using default SPC commands, issued by
specialized userspace tools. For example the SG tools maintained by Doug.
I'd rather have SCSI Core provide just _service_, i.e. means of getting
at those properties, but _not_ providing the properties themselves, i.e.
by trying to find them or figure them out on it's own. (I.e. by itself
issuing commands and what not.)
Of course, some of those identifiers and what not can be easily had
and seen simply by looking at the sysfs tree exported by the
respective protocol, just like my SAS Stack does. An example
of a 1-1 sysfs representation of a SAS domain can be seen here:
http://marc.info/?l=linux-scsi&m=112629509826900&w=2
But this is the exception. I'd opt for using the SG tools exclusively.
> I acknowledge that this can be accomplished by only passing string
> representations of identifiers through to midlayer.
Tpid and such should only exist in the respective protocol layers.
It should NOT be exposed to SCSI Core. The only thing that should be
is an opaque token by which the protocol layer identifies which target
port SCSI Core wants the command sent to, the LUN should be
identified in the SCSI Command struct!
There is a nice summary of this "opaque token" idea in the commentary to
sas_slave_alloc()::sas_scsi_host.c, and in
sas_do_lu_discovery()::sas_discover.c in my SAS stack (out of tree).
Also if you take a look at struct sas_task you'd see where the LUN
is.
> I also agree that
> midlayer should contain as little transport-dependent details as
> possible, and that much of what I wrote in my previous post was contrary
> to that. (And now back to driver debugging... :-)
I think that from the beginning you had some great ideas which are
still current. It also seems (and has always been the case) that
you have good understanding of the SCSI Architecture Model which is
a good thing.
Luben
next prev parent reply other threads:[~2007-07-01 6:27 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
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 [this message]
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=725061.42209.qm@web31801.mail.mud.yahoo.com \
--to=ltuikov@yahoo.com \
--cc=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