public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* RE: How to find which (physical) SCSI HBA corresponds to which ho st n umber?
@ 2005-04-01  4:23 Rajat  Jain, Noida
  2005-04-01 17:47 ` Bryan Henderson
  0 siblings, 1 reply; 5+ messages in thread
From: Rajat  Jain, Noida @ 2005-04-01  4:23 UTC (permalink / raw)
  To: Bryan Henderson, Rajat Jain, Noida; +Cc: linux-scsi


Hi Bryan,

Thanks for the reply. I got my queries solved. 

> 
> As with other SCSI numbering (LUNs, Linux device numbers), 
> you normally don't try to prescribe which numbers go to which 
> equipment, but rather discover afterward -- 
> proc/scsi/hba_name/host_number.  The identifying information 
> is dependent on the particular HBA type and driver, and 
> sometimes doesn't exist.
> 

This proc entry is made AFTER the device is registered with SCSI mid-level
driver (scsi_mod). 

I have a system with "N" number of similar HBAs attached. So basically what
that means is that after I add a SCSI device to one of the HBAs, the only
option I have left with me is following

For n = 0 to N
Do
	echo "scsi add-single-device n 0 ID 0" > /proc/scsi/scsi
done
 
i.e. trial and method that tries to scan for the particular target on ALL
the HBAs???

Rajat

> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org 
> [mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of Bryan Henderson
> Sent: Friday, April 01, 2005 4:57 AM
> To: Rajat Jain, Noida
> Cc: linux-scsi@vger.kernel.org
> Subject: Re: How to find which (physical) SCSI HBA 
> corresponds to which host n umber?
> 
> By default, Linux assigns host numbers to HBAs somewhat 
> arbitrarily.  In practice, it's fairly predictable as long as 
> you don't change anything -- Linux assigns them sequentially 
> starting at zero in the order in which it discovers them, 
> which is controlled first by the order in which Linux 
> initializes the corresponding HBA driver.
> 
> But you can control it a little.  The 'scsihosts' module 
> parameter of the SCSI midlayer driver scsi_mod reserves host 
> numbers for specific HBA drivers.  It looks like 
> "scsihosts=aic7xxx,aic7xxx,qla1280".  That means to reserve 
> host numbers 0 and 1 for the aic7xxx driver and 2 for qla1280. 
> The two reserved for aic7xxx are assigned in the order that 
> the aic7xxx driver registers them, which is ordinarily the 
> order in which the aic7xxx driver detects them.  I don't 
> think there's usually a way to control that, but it should be 
> repeatable as long as the hardware configuration stays the 
> same.  But it's generally not good to rely on the hardware 
> configuration staying the same.  Some day, one card will be 
> broken or temporarily removed, and that will change the host 
> number of the other one.
> 
> As with other SCSI numbering (LUNs, Linux device numbers), 
> you normally don't try to prescribe which numbers go to which 
> equipment, but rather discover afterward -- 
> proc/scsi/hba_name/host_number.  The identifying information 
> is dependent on the particular HBA type and driver, and 
> sometimes doesn't exist.
> 
> -
> 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
> 


Disclaimer: 

This message and any attachment(s) contained here are information that is
confidential,proprietary to HCL Technologies and its customers, privileged
or otherwise protected by law.The information is solely intended for the
individual or the entity it is addressed to. If you are not the intended
recipient of this message, you are not authorized to read, forward,
print,retain, copy or disseminate this message or any part of it. If you
have received this e-mail in error, please notify the sender immediately by
return e-mail and delete it from your computer.



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

* RE: How to find which (physical) SCSI HBA corresponds to which ho st n umber?
  2005-04-01  4:23 How to find which (physical) SCSI HBA corresponds to which ho st n umber? Rajat  Jain, Noida
@ 2005-04-01 17:47 ` Bryan Henderson
  2005-04-01 20:05   ` How to find which (physical) SCSI HBA corresponds to which ho st number? Guy
  2005-04-01 21:07   ` How to find which (physical) SCSI HBA corresponds to which ho st n umber? James Bottomley
  0 siblings, 2 replies; 5+ messages in thread
From: Bryan Henderson @ 2005-04-01 17:47 UTC (permalink / raw)
  Cc: linux-scsi, Rajat Jain, Noida

>>proc/scsi/hba_name/host_number.
>
>This proc entry is made AFTER the device is registered with SCSI 
mid-level
>driver (scsi_mod). 

This proc entry is not related to a device.  It's the entry that describes 
the HBA, and it gets created as part of registering the HBA (host).

>after I add a SCSI device to one of the HBAs, the only
>option I have left with me is following
>
>For n = 0 to N
>Do
>                echo "scsi add-single-device n 0 ID 0" > /proc/scsi/scsi

If you and Linux could identify the host in common terms, you wouldn't 
have to do this.  But the question is open as to in what terms you 
personally identify the host to which you attached the device.  Is it the 
controller to the west?  The red one?  The new one?  The one with serial 
number 8436547?  The one at PCI address X:Y:Z?  The one that has your disk 
drives on it?

The host proc file often has a serial number in it.  Sometimes it has a 
fibre channel worldwide node name.

It seems to me that you're probably right, though: the easiest thing is 
just to try to add the bus/target/LUN to every host.  In an ideal world, 
you'd do this with hotplug.


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

* RE: How to find which (physical) SCSI HBA corresponds to which ho st number?
  2005-04-01 17:47 ` Bryan Henderson
@ 2005-04-01 20:05   ` Guy
  2005-04-01 21:07   ` How to find which (physical) SCSI HBA corresponds to which ho st n umber? James Bottomley
  1 sibling, 0 replies; 5+ messages in thread
From: Guy @ 2005-04-01 20:05 UTC (permalink / raw)
  To: 'Bryan Henderson'; +Cc: linux-scsi, 'Rajat Jain, Noida'



> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
> owner@vger.kernel.org] On Behalf Of Bryan Henderson
> Sent: Friday, April 01, 2005 12:47 PM
> To: Rajat Jain, Noida
> Cc: linux-scsi@vger.kernel.org; Rajat Jain, Noida
> Subject: RE: How to find which (physical) SCSI HBA corresponds to which ho
> st number?
> 
> >>proc/scsi/hba_name/host_number.
> >
> >This proc entry is made AFTER the device is registered with SCSI
> mid-level
> >driver (scsi_mod).
> 
> This proc entry is not related to a device.  It's the entry that describes
> the HBA, and it gets created as part of registering the HBA (host).
> 
> >after I add a SCSI device to one of the HBAs, the only
> >option I have left with me is following
> >
> >For n = 0 to N
> >Do
> >                echo "scsi add-single-device n 0 ID 0" > /proc/scsi/scsi
> 
> If you and Linux could identify the host in common terms, you wouldn't
> have to do this.  But the question is open as to in what terms you
> personally identify the host to which you attached the device.  Is it the
> controller to the west?  The red one?  The new one?  The one with serial
> number 8436547?  The one at PCI address X:Y:Z?  The one that has your disk
> drives on it?

It would be great is Linux could maintain IDs based on a hardware address.
If PCI X:Y:Z is real, then this would be my choice.  Using this method, one
could replace a card and still have the same IDs.  Or add/remove a card(s).
I added a tape drive and of course, it became st0 and my old tape drive
became st1.  Not very well though out.  IMO.
> 
> The host proc file often has a serial number in it.  Sometimes it has a
> fibre channel worldwide node name.
> 
> It seems to me that you're probably right, though: the easiest thing is
> just to try to add the bus/target/LUN to every host.  In an ideal world,
> you'd do this with hotplug.

Guy


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

* RE: How to find which (physical) SCSI HBA corresponds to which ho st n umber?
  2005-04-01 17:47 ` Bryan Henderson
  2005-04-01 20:05   ` How to find which (physical) SCSI HBA corresponds to which ho st number? Guy
@ 2005-04-01 21:07   ` James Bottomley
  2005-04-02 14:31     ` Matt Domsch
  1 sibling, 1 reply; 5+ messages in thread
From: James Bottomley @ 2005-04-01 21:07 UTC (permalink / raw)
  To: Bryan Henderson; +Cc: Rajat Jain, Noida, SCSI Mailing List

On Fri, 2005-04-01 at 09:47 -0800, Bryan Henderson wrote:
> If you and Linux could identify the host in common terms, you wouldn't 
> have to do this.  But the question is open as to in what terms you 
> personally identify the host to which you attached the device.  Is it the 
> controller to the west?  The red one?  The new one?  The one with serial 
> number 8436547?  The one at PCI address X:Y:Z?  The one that has your disk 
> drives on it?

I'm not very good on 2.4, but I believe it has a SCSI_IOCTL_GET_PCI.
However, if you're ever planning on moving to 2.6 it might not be such a
good choice since I believe that ioctl now gives the information in a
different format (but obviously, for 2.6, you'd use sysfs anyway and not
bother with ioctls).

James



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

* Re: How to find which (physical) SCSI HBA corresponds to which ho st n umber?
  2005-04-01 21:07   ` How to find which (physical) SCSI HBA corresponds to which ho st n umber? James Bottomley
@ 2005-04-02 14:31     ` Matt Domsch
  0 siblings, 0 replies; 5+ messages in thread
From: Matt Domsch @ 2005-04-02 14:31 UTC (permalink / raw)
  To: James Bottomley; +Cc: Bryan Henderson, Rajat Jain, Noida, SCSI Mailing List

On Fri, Apr 01, 2005 at 03:07:02PM -0600, James Bottomley wrote:
> On Fri, 2005-04-01 at 09:47 -0800, Bryan Henderson wrote:
> > If you and Linux could identify the host in common terms, you wouldn't 
> > have to do this.  But the question is open as to in what terms you 
> > personally identify the host to which you attached the device.  Is it the 
> > controller to the west?  The red one?  The new one?  The one with serial 
> > number 8436547?  The one at PCI address X:Y:Z?  The one that has your disk 
> > drives on it?
> 
> I'm not very good on 2.4, but I believe it has a SCSI_IOCTL_GET_PCI.

Yes, but that only works when called on a Scsi_Device attached to the
controller.  So each controller needs at least one scsi device (disk,
cdrom, whatever) attached, such that there's a /dev/sd* file to open
and call this ioctl.  That'll get you the pci bus:dev.fn tuple.  Then
on x86 systems at least, the PCI IRQ Routing Table ($PIR table in
BIOS) can tell you if your device is embedded or add-in, and which
slot number BIOS calls it.  A copy of David A. Hinds' dump_pirq script
can be found here:  http://linux.dell.com/files/tools/dump_pirq

Device 00:04.0 (slot 0): Ethernet controller
Device 00:06.0 (slot 0):
Device 00:08.0 (slot 1): Class ff00
Device 00:0f.0 (slot 0): Host bridge
Device 01:08.0 (slot 0): PCI bridge
Device 01:06.0 (slot 0): Ethernet controller
Device 02:06.0 (slot 0): SCSI storage controller
Device 03:06.0 (slot 2):
Device 03:08.0 (slot 3):
Device 08:06.0 (slot 4):
Device 08:08.0 (slot 5):
Device 0d:06.0 (slot 6): RAID bus controller
Device 0d:08.0 (slot 7):

Slot 0 lines are embedded, the other values should pretty closely
correspond to the silkscreen text on the motherboards.


That's about as close as you get.

Thanks,
Matt

-- 
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

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

end of thread, other threads:[~2005-04-02 14:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-01  4:23 How to find which (physical) SCSI HBA corresponds to which ho st n umber? Rajat  Jain, Noida
2005-04-01 17:47 ` Bryan Henderson
2005-04-01 20:05   ` How to find which (physical) SCSI HBA corresponds to which ho st number? Guy
2005-04-01 21:07   ` How to find which (physical) SCSI HBA corresponds to which ho st n umber? James Bottomley
2005-04-02 14:31     ` Matt Domsch

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