From: Patrick Mansfield <patmans@us.ibm.com>
To: "Surekha.PC" <surekhap@cisco.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: iSCSI HBA needs to have a unique host id
Date: Fri, 14 Nov 2003 09:31:24 -0800 [thread overview]
Message-ID: <20031114093124.B2794@beaverton.ibm.com> (raw)
In-Reply-To: <009d01c3aa95$9d613b70$a0074d0a@apac.cisco.com>; from surekhap@cisco.com on Fri, Nov 14, 2003 at 03:26:36PM +0530
On Fri, Nov 14, 2003 at 03:26:36PM +0530, Surekha.PC wrote:
>
> Hi all,
>
> The host id for iSCSI HBA does not remain unique with 2.6 linux
> kernel. It keeps changing when iSCSI host is added and removed
> dynamically. This is a problem for persistent device naming for iSCSI
> devices through host id.
>
> It would be good to maintain a database of already allocated host id's
> for the existing hosts. This would render the iSCSI HBA to get the same
> controller id, irrespective of loading/unloading the driver repeatedly.
The N in hostN has to be unique across all hosts, since we have
/sysfs/class/scsi_host/hostN.
> Would like to know if there is any provision in 2.6 to achieve the
> above?
udev + scsi_id will be able to give persistent names to any SCSI attached
storage that supply a unique ID, including iSCSI.
If you want to name based on location (like host, chan, id, lun), udev has
a topology and "place" matching. It needs work so we can wild card the
host number and use it for scsi, and it has to include the parent name for
scsi, but the general idea is include in udev (I'm not working on this for
udev).
As long as the iSCSI uses a parent that has unique and relevant name, then
the udev place can be modified to work.
i.e for pci we have:
[elm3b79 patman]$ ls /sysfs/devices/pci0000:01/0000:01:0c.0/host5/5:0:6:0
block detach_state model queue_depth rev type
delete device_blocked online rescan scsi_level vendor
So if you could use "place" with wildcards something like:
0000:01:0c.0/*/*:0:6:0
We could use it to name scsi devices based on location.
It would be nice if the host number was a tag or name based on the
parent's name (or as you say stored), but then we would have to encode the parent's bus or such
to avoid name collision, and the scsi_device bus_id names get long.
For sysfs devices would look like:
devices/pci0000:01/0000:01:0c.0/host_pci_0000:01:0c.0/pci_0000:01:0c.0:0:6:0
And:
/sysfs/class/scsi_host/pci_0000:01:0c.0:0:6:0
So the hostN is replaced by the <parent's bus>_<parent's bus_id>, ugly,
but then the scsi device bus_id is unique, and (assuming the parent
assigned channels and target id's the same) can by itself be used with
udev's "place" with no modifications to udev.
-- Patrick Mansfield
prev parent reply other threads:[~2003-11-14 17:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-14 9:56 iSCSI HBA needs to have a unique host id Surekha.PC
2003-11-14 17:12 ` Steven Dake
2003-11-14 17:37 ` Matthew Wilcox
2003-11-14 17:31 ` Patrick Mansfield [this message]
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=20031114093124.B2794@beaverton.ibm.com \
--to=patmans@us.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=surekhap@cisco.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