public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] SCSI Core patches
@ 2003-01-15 15:35 Martin Peschke3
  2003-01-15 15:52 ` James Bottomley
  0 siblings, 1 reply; 33+ messages in thread
From: Martin Peschke3 @ 2003-01-15 15:35 UTC (permalink / raw)
  To: patmans; +Cc: Luben Tuikov, linux-scsi

Patrick,

> > I would like to come to an agreement that the method of scsilun_to_int
> > is wrong and that we have to care for 64 bit LUNs in the SCSI core,
> > i.e. store LUNs as they are provided by the REPORT_LUNs response and
> > passing them unchanged to HBA drivers.
>
> I agree with that, I'm not planning on creating a patch for it. Someone
> with the proper adapter and storage should probably work on a patch, and
> there is currently (AFAIK!) only one open source driver that can handle
an
> 8 byte lun :)

Ok, I've got it. I'll try to come up with a proposal and an appropriate
patch
as a base for further discussion. I have the hardware environment ready
at hand. But prior to testing such a patch, some more work needs to be
done in our HBA driver in order to heave it from 2.4 to 2.5.

If anybody on the list has objections against 64 bit LUNs, it is now time
to
speak out.


Martin Peschke


^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: [PATCH] SCSI Core patches
@ 2003-01-14 21:29 Martin Peschke3
  2003-01-14 22:16 ` Patrick Mansfield
  0 siblings, 1 reply; 33+ messages in thread
From: Martin Peschke3 @ 2003-01-14 21:29 UTC (permalink / raw)
  To: patmans; +Cc: Luben Tuikov, linux-scsi


Patrick,

> Yes, so the driver-to-HBA interface does not have to be use 8 byte LUNs
> (not that I agree with that approach), but FCP must use 8 bytes.

No. This is a contradiction in terms.
Still, I can't see how to have a valid 8 byte LUN at hand for SCSI
devices using 8 byte LUNs if we apply a lossy compression to LUNs
in the SCSI stack.

> The qlogic uses a 2 byte lun for host -> adapter communication, even
> though it sends an 8 byte lun to the target. For most targets, just using
> the upper two bytes is OK, I don't know what they do for the different
> scsi addressing modes.

However this is done in detail, it is guessing in place of reliable
addressing.

I would like to come to an agreement that the method of scsilun_to_int
is wrong and that we have to care for 64 bit LUNs in the SCSI core,
i.e. store LUNs as they are provided by the REPORT_LUNs response and
passing them unchanged to HBA drivers.

The discussion about the implementation should be done after that as
the second step.


Martin Peschke


^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: [PATCH] SCSI Core patches
@ 2003-01-14 20:37 Martin Peschke3
  2003-01-14 21:27 ` Patrick Mansfield
  0 siblings, 1 reply; 33+ messages in thread
From: Martin Peschke3 @ 2003-01-14 20:37 UTC (permalink / raw)
  To: patmans; +Cc: Luben Tuikov, Christoph Hellwig, linux-scsi


Patrick,

> The current 2.5 scsi code uses REPORT LUNS,

ok, I've been aware of that

> and has a 64 bit to 32 bit
> converter (scsi 64 bit lun to linux sdev->lun, the sdev->lun is host byte
> ordered)

What is the reasoning behind that? Why does it exchange bytes 0+1 and
bytes 2+3?

> look at scsi_scan.c::scsilun_to_int. scsilun_to_int (it doesn't
> handle the address method in the first two bits of the LUN, probably a
bug
> for some targets).

It is a bug, I think.
When sending SCSI commands, an FCP device expects me to provide exactly
that 8 byte LUN that is reported by REPORT_LUNS. How is it possible
for an HBA driver that needs a working 8 byte LUN to revert all these
modifications done by scsilun_to_int?
Ok, it would be easy to exchange bytes again. But it is impossible to
recover from the loss of 4 bytes and the 2 most significant bits.
The scsilun_to_int routine does not make sense to me.
We have to go with the actual LUNs retrieved by means of
the REPORT_LUNS command.

> > I think, the SCSI ID for FCP should also be 64 bit in size and
> > ought to be comprised of the World-Wide Port Name (WWPN) rather
> > than the more volatile 24 bit Destination ID (D_ID).
>
> I would rather the SCSI target ID be like an address rather than an
> identifier (such as might be in a scsi_nexus), right now we have a
> sdev->name that currently holds a device id.

How persistent is a SCSI ID expected to be?
Do SCSI applications in a Linux 2.5 environment, e.g. your favourite
burning
software, depend on persistent SCSI ID's in order to address the right
device?
Or, are all issues related to persistency solved by the combination of
sysfs
and hotplug, especially when considering SCSI support?

Thanks advance for your answers. They might be helpfull for me
when trying to solve the 32 bit vs. 64 bit issue in our HBA driver.


Martin Peschke


^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: [PATCH] SCSI Core patches
@ 2003-01-14 20:01 Martin Peschke3
  2003-01-14 20:17 ` Patrick Mansfield
  0 siblings, 1 reply; 33+ messages in thread
From: Martin Peschke3 @ 2003-01-14 20:01 UTC (permalink / raw)
  To: patmans; +Cc: Luben Tuikov, linux-scsi


Patrick,

> With the current scsi code, going to a 64-bit lun means changing
sdev->lun
> and conditionally changing references to it to use a 64-bit struct
> scsilun, or (mainly in the lldd) to call a conversion function if you
must
> use less than 64-bits.

Why would a conversion function be required?
Have we a conversion function for our current 32 bit LUNS which is larger
than required by our Parallel SCSI HBA drivers?
What would chang for those drivers if we go to 64 bit LUNs?

>(Currently, no open source FCP adapters use an 8
> byte lun to talk to the host adapter hardware, not even the qlogic
> adapter.)

Here you are under a misapprehension
http://www-124.ibm.com/developerworks/opensource/linux390
/current2_4_19-may2002.shtml#kernel20021125

Using 8 byte LUNs for FCP is not a question of driver-to-HBA communication
but is required by FCP.
ftp://ftp.t11.org/t10/drafts/fcp2/fcp2r07a.pdf
An HBA dd has to put an 8 byte LUN into the control block used for
SCSI command transfer (FCP_CMND IU), for example.
I am wondering how those drivers make up an 8 byte LUN
from a 32 bit LUN.


Martin Peschke


^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: [PATCH] SCSI Core patches
@ 2003-01-14 16:19 Martin Peschke3
  2003-01-14 16:51 ` Tony Battersby
  2003-01-14 18:56 ` Patrick Mansfield
  0 siblings, 2 replies; 33+ messages in thread
From: Martin Peschke3 @ 2003-01-14 16:19 UTC (permalink / raw)
  To: Luben Tuikov; +Cc: patmans, Christoph Hellwig, linux-scsi



Luben Tuikov <luben@splentec.com>@vger.kernel.org on 01/13/2003 10:30:05 PM

Sent by:    linux-scsi-owner@vger.kernel.org


To:    patmans@us.ltcfwd.linux.ibm.com
cc:    Christoph Hellwig <hch@infradead.org>, linux-scsi@vger.kernel.org
Subject:    Re: [PATCH] SCSI Core patches


Luben Tuitkov wrote:
> Patrick Mansfield wrote:
> >
> > This is _not_ just for multi-path. The current scsi code does not
properly
> > size the target and lun based on the transport. For SPI the target and
lun
> > need only be one byte; for FCP they are 4 and 8 bytes; for iSCSI I
don't
> > know what. (Our current four byte host-ordered lun does not match
anything
> > in any SCSI spec.)
>
> I brought this up last year sometime, either privately or here (search
> the archives if anyone is interested) and the idea of using a 64-bit LUN
> was shot down as in ``we don't need so many bits''.

I've been pleading for 64 bit values, too.
The FCP driver for zSeries I am maintaining for 2.4 uses a mapping
between 64 bit and 32 bit values. This is ugly and I'd like to get
rid of it in its 2.5 port if possible.

Such a change would raise an issue related to device discovery.
A sparsely populated name space for SCSI ID and LUN makes SCSI
device detection harder. For LUN, this should be fixed by the usage
of REPORT_LUNS. Additionally, lldd's could specify the size or
range of SCSI IDs and LUNs which apply to them in order to reduce
discovery overhead.

Furthermore, does anybody know what the largest IDs are which are
defined by any SCSI transport?

I think, the SCSI ID for FCP should also be 64 bit in size and
ought to be comprised of the World-Wide Port Name (WWPN) rather
than the more volatile 24 bit Destination ID (D_ID).

> > The problem is that due to its hierarchical structure all 64 bits are
> > used. If SPI wants to use 5 bits, let it use 5 bits, if iSCSI wants
> > to use 64, we've got this covered too.

Yes.

> > Having a scsi_nexus or such that is host adapter specific (something
like
> > Mike A. posted about) possibly with common transport code (for FCP,
SPI,
> > and iSCSI) would be useful, and would make it easier to add
multi-pathing
> > or support for future transports. The scsi_device current_tag, sdtr,
wdtr,
> > and ppr would be moved to a scsi_nexus since they are SPI specific.

Although the 2.5 stack has much improved, it is still too SPI-centric.
Changes to SCSI ID and SCSI LUN might evolve into such helper functions
concerned with transport specifics. Code for other characteristics
might be moved by degrees then too.


Martin Peschke


^ permalink raw reply	[flat|nested] 33+ messages in thread
* [PATCH] SCSI Core patches
@ 2003-01-07 13:56 Luben Tuikov
  2003-01-07 18:21 ` Patrick Mansfield
  0 siblings, 1 reply; 33+ messages in thread
From: Luben Tuikov @ 2003-01-07 13:56 UTC (permalink / raw)
  To: linux-scsi

The three incremental patches which I posted got mutilated
when pasted into Mozilla from the X clipboard buffer.
(TAB char got 2 spaces.)

The patches are also available, in pristine form, here:
http://www.splentec.com/~luben/patches.html

-- 
Luben



^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2003-01-15 17:40 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-15 15:35 [PATCH] SCSI Core patches Martin Peschke3
2003-01-15 15:52 ` James Bottomley
2003-01-15 17:12   ` Mike Anderson
2003-01-15 17:40     ` Luben Tuikov
  -- strict thread matches above, loose matches on Subject: below --
2003-01-14 21:29 Martin Peschke3
2003-01-14 22:16 ` Patrick Mansfield
2003-01-14 20:37 Martin Peschke3
2003-01-14 21:27 ` Patrick Mansfield
2003-01-14 20:01 Martin Peschke3
2003-01-14 20:17 ` Patrick Mansfield
2003-01-14 16:19 Martin Peschke3
2003-01-14 16:51 ` Tony Battersby
2003-01-14 18:56 ` Patrick Mansfield
2003-01-07 13:56 Luben Tuikov
2003-01-07 18:21 ` Patrick Mansfield
2003-01-07 19:23   ` Luben Tuikov
2003-01-07 20:33     ` Patrick Mansfield
2003-01-07 22:14       ` Luben Tuikov
2003-01-08  1:36         ` Patrick Mansfield
2003-01-08  5:13           ` Luben Tuikov
2003-01-11 18:12           ` Christoph Hellwig
2003-01-13 20:33             ` Patrick Mansfield
2003-01-13 21:30               ` Luben Tuikov
2003-01-14 18:49                 ` Patrick Mansfield
2003-01-14 19:52                   ` Luben Tuikov
2003-01-07 19:44   ` Doug Ledford
2003-01-07 22:53     ` Patrick Mansfield
2003-01-08 17:33       ` Luben Tuikov
2003-01-08 21:13         ` Mike Anderson
2003-01-10 12:35           ` Andre Hedrick
2003-01-10 17:06           ` James Bottomley
2003-01-10 19:23             ` Luben Tuikov
2003-01-10 20:05               ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox