2005-01-03 23:14:08

by Bagalkote, Sreenivas

[permalink] [raw]
Subject: RE: How to add/drop SCSI drives from within the driver?

Hello All,

I am trying to stoke this thread once more. Please review the brief summary
of all discussion and a new sysfs based proposal.

o The more ideal and long-term way to handle addition and removal of
devices is through hotplug mechanism. Currently it is not fully developed.
Moreover, the megaraid SCSI driver doesn't get any event notification from
the FW that the configuration has been changed.

o Management App that communicates to FW via driver private ioctls is the
one that creates/modifies the configuration. This is transparent to the
driver.

o Logical drives being "logical", the driver exports the logical drives
on virtual
SCSI addresses. The management app that knows about LD0, LD1 .. LDn, does
not know the LDn to HCTL mapping (Host:Channel:Target:Lun)

o Everybody understands that as long as the SCSI scan/rescan is triggered
by
the management app, there is no getting around knowing HCTL mapping. The app
must know the HCTL quad of a logical drive.

o Our original solution was that the driver returns HCTL of a LD via
ioctl. This
has been squarely rejected because kernel cannot add any more private
ioctls.

Considering that the app has to somehow _know_ the HCTL given a logical
drive
(that it has deleted or will be adding), please provide your feedback on the
following
proposal. I know that it is not radically different.

The driver would create nodes for all possible logical drives.

/sys/modules
|-- megaraid_mbox
| |-- LD0
| |-- LD1
| |-- LD2
| |-- LD(i)
| |-- LD40

One of the attributes of a LD node would be HCTL information. A management
app
can then scan, delete the LDs using corresponding HCTL address.

Y'all have a great new year!

Sreenivas
LSI Logic


2005-01-04 00:45:46

by James Bottomley

[permalink] [raw]
Subject: RE: How to add/drop SCSI drives from within the driver?

On Mon, 2005-01-03 at 18:02 -0500, Bagalkote, Sreenivas wrote:
> o Everybody understands that as long as the SCSI scan/rescan is triggered
> by
> the management app, there is no getting around knowing HCTL mapping. The app
> must know the HCTL quad of a logical drive.

Actually, if that's all you're trying to do, what about

echo '- - -' > /sys/class/scsi_host/host<n>/scan

That'll trigger a rescan of the entire card and the device will be found
and added?

Then, if you simply publish your LD number as an extra parameter of the
device, you can look through /sys to find it.

James