From: Luben Tuikov <ltuikov@yahoo.com>
To: Swen Schillig <swen@vnet.ibm.com>, Hannes Reinecke <hare@suse.de>
Cc: 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: Wed, 27 Jun 2007 21:21:18 -0700 (PDT) [thread overview]
Message-ID: <419361.83440.qm@web31812.mail.mud.yahoo.com> (raw)
In-Reply-To: <200706271227.48725.swen@vnet.ibm.com>
--- Swen Schillig <swen@vnet.ibm.com> wrote:
> I think Luben and Stefan suggested a good way to do that, ok apart from the be64 bits :-)
What is the objection to the use of be64_to_cpu()?
> So, just use the struct scsi_lun in its full extend, for the sysfs without a leading "0x",
> and forgetting about the scsilun_to_int conversion which isn't good for anything.
Yes, I agree with you. This is simple, straightforward, intuitive and reasonable.
In fact, I'd do
typedef __u8 lun_t[8];
and then define the macro
#define LUN_TO_U64(_lun) ((unsigned long long) be64_to_cpu(*(__be64 *)(_lun)))
This way one could do stuff like:*
printk(KERN_NOTICE "problem xyz with LUN:%016llx\n", LUN_TO_U64(sdev->LUN));
where
struct scsi_dev {
...
lun_t LUN; /* Or if you prefer all lowercase. */
...
};
And as can be seen in my SAS stack code:
kobject_set_name(&lu->lu_obj, "%016llx", LUN_TO_U64(lu->LUN));
(I actually don't have LUN_TO_U64() but reuse the SAS_ADDR() macro
which is identical.)
* It is in fact more correct to do, at the _transport_ layer:
printk(... "problem xyz with %016llx:%016llx\n",
sdev->target->tpid, sdev->LUN);
Here, it is explicitly shown that sdev (/dev/sdXYZ) is a child of
a target, having a tpid attribute, and the sdev has a property
of lun_t called LUN.
So, for example, for SAS, the message would print like this:
problem xyz with 5000a50000f13427:0000000000000000
which uniquely identifies the device and then the sysadmin
can go to the storage farm, find it and replace it if need be.
> Anyway, before anyone else is suggesting some other magic attribute extension to the LUN value,
> why not leave it as it is and just have it serving this one purpose of being a unique number ?
> (yeah, yeah I know there's already some meaning behind the 4 levels)
Again, you're exactly right. SCSI Core should NOT be interpreting the LUN.
It should just pass it around as an opaque token, as accomplished by the
lun_t type definition as shown above.
Luben
next prev parent reply other threads:[~2007-06-28 4:21 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 [this message]
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=419361.83440.qm@web31812.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=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