linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC]: 64 bit LUN/Tags, dummy device in host_queue, host_lock <-> LLDD reentrancy
@ 2002-08-23 20:27 Luben Tuikov
  2002-08-26 16:16 ` Patrick Mansfield
  0 siblings, 1 reply; 19+ messages in thread
From: Luben Tuikov @ 2002-08-23 20:27 UTC (permalink / raw)
  To: linux-scsi

Here's some of the things which have been looming in my mind for
some time now. Nothing important really, but I felt at least to
share it with you guys, just to keep in mind, that's all.
Comment at will.


* SAM-3 specifies that a LUN is 64 bit. While there may not
be any devices which actually even come close to using this
huge space, it provides different _addressing__modes_.

This very nicely fits LUN virtualization (iSCSI, LUN masking, etc),
and would allow one to do magic for storage devices (IP SANs, etc).

A 64 bit LUN could be presented to userspace which may/can then
present a nice ``picture'' (GUI or what not) of the underlying
physical/virtual (depending on the SCSI port name/id) storage
network.

(E.g. iSCSI communicates 64 bit LUNs only...)


* SAM-3 specifies that tags are 64 bit. It is not inconcievable that
a Task Manager (LUN structure, SAM-3, 4.8, 4.12) would use
those tags to order/id/whatnot the tasks it receives for
execution.

A really, leally long shot: Now that they are being moved up to
the block layer, it may be convenient to define them as such.


* In scsi_scan.c :: void scan_scsis(), select_queue_depths() is called
when there is a _dummy_ device in host_queue. This comes from
doing that juggle with SDpnt and oldSDpnt, allocating it in one
place and freeing it in another...

So when select_queue_depths() is called, in the host_queue, there's
_one__more_ device than there really should be, because of that SDpnt/oldSDpnt.

I filter the dummy SDpnt in select_queue_depths() by checking
vendor, model, rev and attached. But I'd rather
just get only the _actual_ devices in the host_queue, by
probably getting rid of that SDpnt/oldSDpnt juggle logic.


* It seems to me that the host_lock exists just to indirectly
impose/hint/etc. reentrancy of the LLDD methods exposed to the kernel.

Isn't the next step to stipulate that all methods of LLDDs should
be renentrant in and of themselves (which are exposed to the kernel
of course). That is, they'll have to achieve their own reentrancy
via their own locks and queues. Wouldn't this be a cleaner approach?

The kernel will have one less thing to worry about.

I realize that some LLDD will be really easy to convert and
other will have to undergo deep surgery, but this kind
of reentrancy seems to be implied by the host lock.

-- 
Luben

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [RFC]: 64 bit LUN/Tags, dummy device in host_queue, host_lock <-> LLDD reentrancy
@ 2002-08-26  8:02 Aron Zeh
  2002-08-26 14:11 ` James Bottomley
  2002-08-26 17:17 ` Patrick Mansfield
  0 siblings, 2 replies; 19+ messages in thread
From: Aron Zeh @ 2002-08-26  8:02 UTC (permalink / raw)
  To: Luben Tuikov; +Cc: linux-scsi




> * SAM-3 specifies that a LUN is 64 bit. While there may not
> be any devices which actually even come close to using this
> huge space, it provides different _addressing__modes_.
>
> This very nicely fits LUN virtualization (iSCSI, LUN masking, etc),
> and would allow one to do magic for storage devices (IP SANs, etc).
>
> A 64 bit LUN could be presented to userspace which may/can then
> present a nice ``picture'' (GUI or what not) of the underlying
> physical/virtual (depending on the SCSI port name/id) storage
> network.
>
> (E.g. iSCSI communicates 64 bit LUNs only...)

To me all of the proposed changes look good. The one above I'd be
interested in particularly. It would help sorting out a lot of woes we had
with writing a fibre-channel HBA driver. For fibre-channel LUNs and port
IDs (WWPN) are 64-bit and depending on configuration, high values can be
(and in our case are) common.

Aron



^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [RFC]: 64 bit LUN/Tags, dummy device in host_queue, host_lock <-> LLDD reentrancy
@ 2002-08-26 16:29 Aron Zeh
  2002-08-26 16:48 ` James Bottomley
  0 siblings, 1 reply; 19+ messages in thread
From: Aron Zeh @ 2002-08-26 16:29 UTC (permalink / raw)
  To: James Bottomley; +Cc: Luben Tuikov, linux-scsi


> ARZEH@de.ibm.com said:
> > To me all of the proposed changes look good. The one above I'd be
> > interested in particularly. It would help sorting out a lot of woes we
> > had with writing a fibre-channel HBA driver. For fibre-channel LUNs
> > and port IDs (WWPN) are 64-bit and depending on configuration, high
> > values can be (and in our case are) common.
>
> Actually, I'd like to see us moving towards adopting the capabilities of
> driverfs for this.
>
> PUN is to all intents and purposes now an abstraction in the FC realm.
LUNs
> too, as long as they retain the grouping abstraction with PUNs.  The mid
layer
> really doesn't need to know what these are (there are a few pieces of
code
> that populate the LUN field for SCSI-1 devices that would need rework).
All
> the mid layer really needs is the Scsi_Device structure that describes an

> individual LUN (and some knowledge of LUN and PUN grouping for reset
action
> prediction).  It doesn't need to know or care about the current PUN and
LUN
> numbers.
>
> If FC drivers move straight to using driverfs, you can populate the
driverfs
> names with whatever is meaningful to you for PUN (WWN, portid etch) and
LUN
> and thus avoid this problem (and also the mapping code most have to take
these
> to and from the PUN/LUN numbers).  Since driverfs is a tree, the PUN/LUN
> division is done in a directory (and could, theoretically be done on more
than
> just a two level split).
>
> James

James, there are some things that I don't fully understand, yet.

Does the use of driverfs-names mean that the HBA driver somehow comes into
the discovery-loop for devices (e.g. scan_scsis somehow interacts with the
HBA driver to determine which driverfs entry to create.)?
Shouldn't there be some sort of rule for LUN (or unit) naming within at
least the same hardware class? That is for: parallel, iSCSI, FC, etc.
Will the SCSI stack automatically try to discover all devices behind the
HBA (e.g, on the FC SAN)? Or will there be an interface to restrict the
range, etc?
Lastly, how will you keep track of LUNs in the SCSI stack? Will the current
LUN field disappear in favour of a generic character string?

Cheers,
Aron






^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [RFC]: 64 bit LUN/Tags, dummy device in host_queue, host_lock <-> LLDD reentrancy
@ 2002-08-26 17:01 Aron Zeh
  2002-08-26 17:15 ` James Bottomley
  0 siblings, 1 reply; 19+ messages in thread
From: Aron Zeh @ 2002-08-26 17:01 UTC (permalink / raw)
  Cc: James Bottomley, Luben Tuikov, linux-scsi



> ARZEH@de.ibm.com said:
> > Does the use of driverfs-names mean that the HBA driver somehow comes
> > into the discovery-loop for devices (e.g. scan_scsis somehow interacts
> > with the HBA driver to determine which driverfs entry to create.)?
>
> Well, scanning is really only for legacy.  Way into the future, I'd like
to
> see hotplug notification for device attach events, so no fibre controller
ever
> need be troubled by the scan.  All they'd do is send a device attach
> notification into SCSI when they detect one.  (SCSI would probably then
turn
> around and ask for a REPORT_LUNS).

Blimey, that was a quick response. Only to spurn some more questions from
me though. Sorry.

If you say scanning is legacy only does that mean you expect it to be gone
by kernel 2.6?
I currently don't know of a way that SCSI devices (LUNs) generate hotplug
notifications by. (FC sends RSCNs and other nasty stuff for ports, which
are one level higher up. I don't think reconfiguring the LUNs behind a port
would generate any message, would it?)
Even of messages are generated, they'd probably differ according to the
underlying hardware. Would HBA drivers have to catch them and use more
generic callbacks to tell the SCSI stack?

Cheers,
Aron


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

end of thread, other threads:[~2002-08-28 14:38 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-23 20:27 [RFC]: 64 bit LUN/Tags, dummy device in host_queue, host_lock <-> LLDD reentrancy Luben Tuikov
2002-08-26 16:16 ` Patrick Mansfield
  -- strict thread matches above, loose matches on Subject: below --
2002-08-26  8:02 Aron Zeh
2002-08-26 14:11 ` James Bottomley
2002-08-26 17:17 ` Patrick Mansfield
2002-08-26 20:48   ` Luben Tuikov
2002-08-26 16:29 Aron Zeh
2002-08-26 16:48 ` James Bottomley
2002-08-26 17:27   ` Mike Anderson
2002-08-26 19:00     ` James Bottomley
2002-08-26 20:57       ` Mike Anderson
2002-08-26 21:10         ` James Bottomley
2002-08-26 22:38           ` Mike Anderson
2002-08-26 22:56             ` Patrick Mansfield
2002-08-26 23:10             ` Doug Ledford
2002-08-28 14:38             ` James Bottomley
2002-08-26 21:15         ` Mike Anderson
2002-08-26 17:01 Aron Zeh
2002-08-26 17:15 ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).