public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* iSCSI HBA needs to have a unique host id
@ 2003-11-14  9:56 Surekha.PC
  2003-11-14 17:12 ` Steven Dake
  2003-11-14 17:31 ` Patrick Mansfield
  0 siblings, 2 replies; 4+ messages in thread
From: Surekha.PC @ 2003-11-14  9:56 UTC (permalink / raw)
  To: linux-scsi


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.
 
Would like to know if there is any provision in 2.6 to achieve the
above?

thanks,
surekha 


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

* Re: iSCSI HBA needs to have a unique host id
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Steven Dake @ 2003-11-14 17:12 UTC (permalink / raw)
  To: Surekha.PC; +Cc: linux-scsi


On Fri, 2003-11-14 at 02:56, 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.
> 
Surekha,

Persistent device naming should be handled through userspace application
so that the policy of the device naming is more controllable.  I suggest
examining the uSDE project www.sourceforge.net/projects/usde for an
example implementation.  In this case, target disks can be persistently
named by their unique IEEE identifier and HBAs can be persistently named
by their PCI slot path address.  These are only sample policies that
could be implemented..  The usde framework allows for any policy to be
implemented.

Thanks
-steve


> 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.
>  
> Would like to know if there is any provision in 2.6 to achieve the
> above?
> 
> thanks,
> surekha 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 


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

* Re: iSCSI HBA needs to have a unique host id
  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:31 ` Patrick Mansfield
  1 sibling, 0 replies; 4+ messages in thread
From: Patrick Mansfield @ 2003-11-14 17:31 UTC (permalink / raw)
  To: Surekha.PC; +Cc: linux-scsi

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

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

* Re: iSCSI HBA needs to have a unique host id
  2003-11-14 17:12 ` Steven Dake
@ 2003-11-14 17:37   ` Matthew Wilcox
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2003-11-14 17:37 UTC (permalink / raw)
  To: Steven Dake; +Cc: Surekha.PC, linux-scsi

On Fri, Nov 14, 2003 at 10:12:30AM -0700, Steven Dake wrote:
> I suggest
> examining the uSDE project www.sourceforge.net/projects/usde for an
> example implementation.

I suggest you look at the udev project instead since uSDE is unlikely
to be used by more than a tiny minority of systems.

http://lwn.net/Articles/55176/

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

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

end of thread, other threads:[~2003-11-14 17:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox