mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergey Panov <sipan@sipan.org>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Matthew Wilcox <matthew@wil.cx>,
	SCSI Mailing List <linux-scsi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Luben Tuikov <ltuikov@yahoo.com>,
	Christoph Hellwig <hch@infradead.org>,
	Douglas Gilbert <dougg@torque.net>,
	Patrick Mansfield <patmans@us.ibm.com>,
	Luben Tuikov <luben_tuikov@adaptec.com>
Subject: Re: [PATCH 2.6.13 5/14] sas-class: sas_discover.c Discover process (end devices)
Date: Wed, 14 Sep 2005 22:04:39 -0400	[thread overview]
Message-ID: <1126749879.11188.49.camel@sipan.sipan.org> (raw)
In-Reply-To: <1126723396.4588.3.camel@mulgrave>

On Wed, 2005-09-14 at 14:43 -0400, James Bottomley wrote:
> On Wed, 2005-09-14 at 00:57 -0400, Sergey Panov wrote: 
> > LUN id should be presented to the management layers in a way similar to
> > MAC addresses or FC/SAS/... WWN . E.g. the usual LUN 4  on some FC
> > device will be identified by something like (in 00b, or "Peripheral
> > device addressing"):
> > 
> > WWPN = 22:00:00:0c:50:05:df:6d
> > LUN  = 00:04:00:00:00:00:00:00
> > 
> > 
> > Interestingly enough, the following is also LUN = 4 device, but in a
> > different addressing mode (01b, AKA "Logical unit addressing"):
                                  "Flat space addressing"               
> > 
> > WWPN = 22:00:00:0c:50:05:df:6d
> > LUN  = 40:04:00:00:00:00:00:00
> 
> Firstly, those two LUNs are actually not equivalent (according to SAM-3
> section 4.9.1) because two luns are defined to be different if expressed
> in different representations.

I was not saying those are two different addresses of the same LUN, but
those two are LUN 4 in 00b and LUN 4 in 01b addressing mode.

 But according to 4.9.4 a target with more then 255 LUNs may use 00b
addressing for LUNs 0-255 and 01b addressing for LUNs 256 and higher.

In your integer representation those would be lun=4 and lun=16388 ,
because in that integer representation 00b LUNs occupy range  0-255 and
01b LUNs cover range 16384-32768 (while LU numbers are actually
0-16383). 

It is my understanding that "lun" values in ranges 256-16383 and
32769-65535 do not represent any LUN at all if target supports only
single level addressing.  

> Secondly, The idea of using u64 is that all transports that don't use
> hierarchical LUNs can simply copy the number as they do today.  This
> idea rests on the assumption that arrays responding to REPORT_LUNS on
> these transports always reply with type 00b.

It is recommended to use 00b  if target has no more then 256 LUNs. But
there are arrays which support more then 256 LUNs and those arrays have
to use 01b addressing when configured with such big sets of LUNs.

>   This assumption is
> suggested (but not mandated) in SAM. If they violate this assumption,
> we'll just reject all the LUNs and I'll get a bug report.

Nice! Actually, I do believe the 01b addressing is interpreted correctly
in in code which processes response from the REPORT_LUN.

----------------------------------------

The point I was trying to make is that it would be a simplification if
SCSI code was using byte array as a LUN identifier internally. No
translation is needed when processing REPORT_LUN response and no
translation is needed in queuecommand. LLDD for non-conforming HBAs will
have to replace lun with lun[1].

The only time you want to present lun[]={0,LUN,0,0,0,0,0} as just LUN is
when that number has to be reported to the user space.  


Sergey Panov

======================================================================
Any opinions are personal and not necessarily those of my former,
present, or future employers.




  parent reply	other threads:[~2005-09-15  2:04 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-09 19:40 Luben Tuikov
2005-09-09 19:59 ` Nish Aravamudan
2005-09-09 20:11   ` Luben Tuikov
2005-09-09 23:25 ` James Bottomley
2005-09-10  2:44   ` Luben Tuikov
2005-09-10  5:39     ` Douglas Gilbert
2005-09-10 16:01     ` James Bottomley
2005-09-12 15:06       ` Luben Tuikov
2005-09-12 16:27         ` Patrick Mansfield
2005-09-12 20:08           ` Luben Tuikov
2005-09-13  9:05           ` Douglas Gilbert
2005-09-13 13:11             ` Luben Tuikov
2005-09-13 22:42             ` Patrick Mansfield
2005-09-14 12:28               ` Luben Tuikov
2005-09-14 17:13                 ` Patrick Mansfield
2005-09-14 17:17                   ` Luben Tuikov
2005-09-14 18:47               ` James Bottomley
2005-09-14 20:20                 ` Luben Tuikov
2005-09-12 17:52         ` James Bottomley
2005-09-12 20:31           ` Luben Tuikov
2005-09-12 21:23             ` James Bottomley
2005-09-13 12:49               ` Luben Tuikov
2005-09-13 15:54                 ` James Bottomley
2005-09-13 20:01                   ` Luben Tuikov
2005-09-11  9:46     ` Christoph Hellwig
2005-09-12  6:17       ` Douglas Gilbert
2005-09-12 14:57         ` James Bottomley
2005-09-12 16:45           ` Patrick Mansfield
2005-09-12 17:21             ` James Bottomley
2005-09-12 18:46               ` Patrick Mansfield
2005-09-13 19:22                 ` James Bottomley
2005-09-13 20:23                   ` Luben Tuikov
2005-09-13 20:36                     ` Matthew Wilcox
2005-09-13 21:02                       ` Luben Tuikov
2005-09-13 21:37                         ` Stefan Richter
2005-09-13 21:54                           ` Luben Tuikov
2005-09-13 22:25                         ` Patrick Mansfield
2005-09-14  5:22                           ` Sergey Panov
2005-09-14 16:28                             ` Patrick Mansfield
2005-09-14 12:13                           ` Luben Tuikov
2005-09-14  4:57                       ` Sergey Panov
2005-09-14 18:43                         ` James Bottomley
2005-09-14 20:17                           ` Luben Tuikov
2005-09-15  2:04                           ` Sergey Panov [this message]
2005-09-12 20:20               ` Luben Tuikov
2005-09-12 20:09             ` Luben Tuikov
2005-09-12 19:39           ` Luben Tuikov
2005-09-12 18:17         ` Luben Tuikov
2005-09-13 10:25         ` Christoph Hellwig
2005-09-13 12:47           ` Douglas Gilbert
2005-09-13 14:58             ` Luben Tuikov
2005-09-12 22:39       ` Luben Tuikov
2005-09-12 19:04 James.Smart
2005-09-12 19:29 ` Patrick Mansfield
2005-09-12 19:53 James.Smart
2005-09-14  0:58 Ravi Anand
2005-09-14 17:46 Ravi Anand
2005-09-16  7:28 Andreas Herrmann

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=1126749879.11188.49.camel@sipan.sipan.org \
    --to=sipan@sipan.org \
    --cc=James.Bottomley@SteelEye.com \
    --cc=dougg@torque.net \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ltuikov@yahoo.com \
    --cc=luben_tuikov@adaptec.com \
    --cc=matthew@wil.cx \
    --cc=patmans@us.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

all inboxes | Powered by JetHome®