PathId and PortId

Hi guys,

What does PathId mean in SCSI_REQUEST_BLOCK? My colleague just told me it’s a path identifier. But I really do not know what the path is. Is there any article about it?

Another thing is port id. It seems that it has no meaning in Windows, just assigned by scsiport.sys. Right?

Many thanks.

  1. PathId = SCSI bus #. In good old days there were SCSI controllers with more then one SCSI bus attached. Also some
    of the ATA drivers sometimes pretended they have not two instances of the same controller (Primary and Secondary) but
    rather they have one controller with 2 buses (Pri and Sec).

  2. Port ID is incremental value. However you’d better use SetupDiXxx calls to do enumeration instead of
    simple loop “until the one would fail to open”. There could be “holes” in numbering since Windows 2000. At least in theory…

Anton

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, February 21, 2007 12:55 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] PathId and PortId

Hi guys,

What does PathId mean in SCSI_REQUEST_BLOCK? My colleague just told me it’s a path identifier. But I really do not know what the path is. Is there any article about it?

Another thing is port id. It seems that it has no meaning in Windows, just assigned by scsiport.sys. Right?

Many thanks.


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks Anton. It’s really interesting.

Then, can I understand these stuff in this way:

Port (Id) = SCSI Controller

A SCSI controller (Port) may have more than one SCSI buses (Path).

A SCSI bus may have more than one targets (up to 7 targets). The same thing also applies to LUNs.

wrote in message news:xxxxx@ntdev…
> Thanks Anton. It’s really interesting.
>
> Then, can I understand these stuff in this way:
>
> Port (Id) = SCSI Controller
>
> A SCSI controller (Port) may have more than one SCSI buses (Path).
>
> A SCSI bus may have more than one targets (up to 7 targets). The same
> thing also applies to LUNs.

Be careful of that last one, since Fibre Channel looks like a SCSI
controller, the number is a lot higher than 7, IIRC more like 256.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

15 targets (+1 for controller itself). Or 127 targets (if it’s really FC and not Wide SCSI controller).

Each target can have up to 127 LUNs (optical disc changer, tape autoloader, RAID volume growing thru the LUN
masking/unmasking etc).

Numbers don’t really increment. In the other words it’s OK to have TargetId of 0, 1, 8 and 12. With the other numbers
missing.

Anton

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, February 21, 2007 1:16 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] PathId and PortId

Thanks Anton. It’s really interesting.

Then, can I understand these stuff in this way:

Port (Id) = SCSI Controller

A SCSI controller (Port) may have more than one SCSI buses (Path).

A SCSI bus may have more than one targets (up to 7 targets). The same thing also applies to LUNs.


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

It should be pretty large BYTE to handle more then 256 IDs :slight_smile:

Anton

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Wednesday, February 21, 2007 1:20 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] PathId and PortId

wrote in message news:xxxxx@ntdev…
> Thanks Anton. It’s really interesting.
>
> Then, can I understand these stuff in this way:
>
> Port (Id) = SCSI Controller
>
> A SCSI controller (Port) may have more than one SCSI buses (Path).
>
> A SCSI bus may have more than one targets (up to 7 targets). The same
> thing also applies to LUNs.

Be careful of that last one, since Fibre Channel looks like a SCSI
controller, the number is a lot higher than 7, IIRC more like 256.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Thanks guys. Good stuff!

Port was useful once … it is no longer.

Path allows you to express which bus a request is being sent to in the
event that your HBA supports 2 or more independent SCSI busses.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Tuesday, February 20, 2007 2:55 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] PathId and PortId

Hi guys,

What does PathId mean in SCSI_REQUEST_BLOCK? My colleague just told me
it’s a path identifier. But I really do not know what the path is. Is
there any article about it?

Another thing is port id. It seems that it has no meaning in Windows,
just assigned by scsiport.sys. Right?

Many thanks.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

> What does PathId mean in SCSI_REQUEST_BLOCK? My colleague just told

me it’s a path identifier.

Some SCSI controllers control several independent buses hanging off the same
chip. PathId is the bus number.

Another thing is port id. It seems that it has no meaning in Windows, just
assigned by scsiport.sys. Right?

Ordinal number of the SCSI controller instance.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

>Numbers don’t really increment. In the other words it’s OK to have TargetId of
0,

1, 8 and 12. With the other numbers
missing.

LUN numbers need more clarification. First, LUN 0 must exist. Second, sparse
LUN numbering requires the LUN 0 to support REPORT LUNS SCSI command, which
returns the bitmap of the valid LUN numbers.

If REPORT LUNS is not supported - then LUN numbers cannot be sparse, they must
be 0, 1, 2, 3…, and enumeration aborts on first missing number.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

> LUN numbers need more clarification. First, LUN 0 must exist. Second,

sparse

Um. I’ve plenty of times configured systems with scsi controllers that only
had a single unit on LUN 4 or 6, and nothing on zero. Worked fine.

Now, in pc-land to boot I believe you need LUN 0 on the boot device cable.
That certainly isn’t true for other systems. Amigas have booted for decades
from LUN 6 with nothing else on the bus.

Loren

LUN 6 or TARGET 6?

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Loren Wilton
Sent: Wednesday, February 21, 2007 6:30 AM
To: Windows System Software Devs Interest List
Subject: Re: Re:[ntdev] PathId and PortId

LUN numbers need more clarification. First, LUN 0 must exist. Second,
sparse

Um. I’ve plenty of times configured systems with scsi controllers that only
had a single unit on LUN 4 or 6, and nothing on zero. Worked fine.

Now, in pc-land to boot I believe you need LUN 0 on the boot device cable.
That certainly isn’t true for other systems. Amigas have booted for decades
from LUN 6 with nothing else on the bus.

Loren


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

> LUN 6 or TARGET 6?

Duh. Target. I’m still asleep this morning it appears.

Loren

Looks like you’ve swapped TargetId and LUN…

Anton

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Loren Wilton
Sent: Wednesday, February 21, 2007 4:30 PM
To: Windows System Software Devs Interest List
Subject: Re: Re:[ntdev] PathId and PortId

LUN numbers need more clarification. First, LUN 0 must exist. Second,
sparse

Um. I’ve plenty of times configured systems with scsi controllers that only
had a single unit on LUN 4 or 6, and nothing on zero. Worked fine.

Now, in pc-land to boot I believe you need LUN 0 on the boot device cable.
That certainly isn’t true for other systems. Amigas have booted for decades
from LUN 6 with nothing else on the bus.

Loren


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

> Um. I’ve plenty of times configured systems with scsi controllers that only

had a single unit on LUN 4 or 6, and nothing on zero. Worked fine.

On target 4 or 6, not on LUN 4 or 6.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Prior to Vista, Windows would:

Send Inquiry to LUN 0
If LargeLuns is set in the HBA’s registry info, send Report LUNs to LUN 0
with a byte count of 0x10 (not sure if they were also looking at the
HISUPPORT bit in LUN 0 Inquiry Data)
If the above returns with a LUN list length indicating more than one LUN,
issue another Report LUNs command with the correct length
EVEN IF Report LUNs returns success, send Inquiry to all LUNs 1 through 7
regardless of the LUN list returned above
Send Inquiry to any additional LUNs listed in the Report LUNs command
There is no requirement that there be no holes in the LUN numbers on
Windows, but other operating systems do require this.
I have pleanty of Fibre Channel traces that will verify this.

It seems that Vista does things a bit differently. It:

Comes right out with Report LUNs to LUN 0, data length 0x10, regardless of
the setting of the LargeLuns registry entry
If the above returns with a LUN list length indicating more than one LUN,
issue another Report LUNs command with the correct length
If that succeeds, only sends Inquiries to LUNs listed in the Report LUNs
results.

I have no ides right now what Vista would do if the Report LUNs command
comes back with Check Condition - Command Not Supported.

Jerry.

Peter Wieland
Sent by: xxxxx@lists.osr.com
02/21/2007 11:43 AM
Please respond to
“Windows System Software Devs Interest List”

To
“Windows System Software Devs Interest List”
cc

Subject
RE: Re:[ntdev] PathId and PortId

LUN 6 or TARGET 6?

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loren Wilton
Sent: Wednesday, February 21, 2007 6:30 AM
To: Windows System Software Devs Interest List
Subject: Re: Re:[ntdev] PathId and PortId

> LUN numbers need more clarification. First, LUN 0 must exist. Second,
> sparse

Um. I’ve plenty of times configured systems with scsi controllers that
only
had a single unit on LUN 4 or 6, and nothing on zero. Worked fine.

Now, in pc-land to boot I believe you need LUN 0 on the boot device cable.

That certainly isn’t true for other systems. Amigas have booted for
decades
from LUN 6 with nothing else on the bus.

Loren


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Hopefully it would send an INQUIRY in that case.

You could find out in your miniport by failing SCSIOP_REPORT_LUNS rather
than handing it off to the HBA J

-p

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@attotech.com
Sent: Wednesday, February 21, 2007 1:47 PM
To: Windows System Software Devs Interest List
Subject: RE: Re:[ntdev] PathId and PortId

Prior to Vista, Windows would:

Send Inquiry to LUN 0
If LargeLuns is set in the HBA’s registry info, send Report LUNs to LUN
0 with a byte count of 0x10 (not sure if they were also looking at the
HISUPPORT bit in LUN 0 Inquiry Data)
If the above returns with a LUN list length indicating more than one
LUN, issue another Report LUNs command with the correct length
EVEN IF Report LUNs returns success, send Inquiry to all LUNs 1 through
7 regardless of the LUN list returned above
Send Inquiry to any additional LUNs listed in the Report LUNs command
There is no requirement that there be no holes in the LUN numbers on
Windows, but other operating systems do require this.
I have pleanty of Fibre Channel traces that will verify this.

It seems that Vista does things a bit differently. It:

Comes right out with Report LUNs to LUN 0, data length 0x10, regardless
of the setting of the LargeLuns registry entry
If the above returns with a LUN list length indicating more than one
LUN, issue another Report LUNs command with the correct length
If that succeeds, only sends Inquiries to LUNs listed in the Report LUNs
results.

I have no ides right now what Vista would do if the Report LUNs command
comes back with Check Condition - Command Not Supported.

Jerry.

Peter Wieland
Sent by: xxxxx@lists.osr.com

02/21/2007 11:43 AM

Please respond to
“Windows System Software Devs Interest List”

To

“Windows System Software Devs Interest List”

cc

Subject

RE: Re:[ntdev] PathId and PortId

LUN 6 or TARGET 6?

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loren Wilton
Sent: Wednesday, February 21, 2007 6:30 AM
To: Windows System Software Devs Interest List
Subject: Re: Re:[ntdev] PathId and PortId

> LUN numbers need more clarification. First, LUN 0 must exist. Second,
> sparse

Um. I’ve plenty of times configured systems with scsi controllers that
only
had a single unit on LUN 4 or 6, and nothing on zero. Worked fine.

Now, in pc-land to boot I believe you need LUN 0 on the boot device
cable.
That certainly isn’t true for other systems. Amigas have booted for
decades
from LUN 6 with nothing else on the bus.

Loren


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Agreed, hopefully it would. If I get a chance, I’ll try it.

But that would depend on how it was failed. If I fail it with
SRB_STATUS_SELECTION_TIMEOUT, they’d just skip to the next TargetId. I’d
have to dummy up a SCSI status with sense data and all.

Alternatively … I think I have an old disk drive that doesn’t support
Report LUNs.

Jerry.

Peter Wieland
Sent by: xxxxx@lists.osr.com
02/21/2007 08:34 PM
Please respond to
“Windows System Software Devs Interest List”

To
“Windows System Software Devs Interest List”
cc

Subject
RE: Re:[ntdev] PathId and PortId

Hopefully it would send an INQUIRY in that case.

You could find out in your miniport by failing SCSIOP_REPORT_LUNS rather
than handing it off to the HBA J

-p

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@attotech.com
Sent: Wednesday, February 21, 2007 1:47 PM
To: Windows System Software Devs Interest List
Subject: RE: Re:[ntdev] PathId and PortId

Prior to Vista, Windows would:

Send Inquiry to LUN 0
If LargeLuns is set in the HBA’s registry info, send Report LUNs to LUN 0
with a byte count of 0x10 (not sure if they were also looking at the
HISUPPORT bit in LUN 0 Inquiry Data)
If the above returns with a LUN list length indicating more than one LUN,
issue another Report LUNs command with the correct length
EVEN IF Report LUNs returns success, send Inquiry to all LUNs 1 through 7
regardless of the LUN list returned above
Send Inquiry to any additional LUNs listed in the Report LUNs command
There is no requirement that there be no holes in the LUN numbers on
Windows, but other operating systems do require this.
I have pleanty of Fibre Channel traces that will verify this.

It seems that Vista does things a bit differently. It:

Comes right out with Report LUNs to LUN 0, data length 0x10, regardless of
the setting of the LargeLuns registry entry
If the above returns with a LUN list length indicating more than one LUN,
issue another Report LUNs command with the correct length
If that succeeds, only sends Inquiries to LUNs listed in the Report LUNs
results.

I have no ides right now what Vista would do if the Report LUNs command
comes back with Check Condition - Command Not Supported.

Jerry.

Peter Wieland
Sent by: xxxxx@lists.osr.com
02/21/2007 11:43 AM

Please respond to
“Windows System Software Devs Interest List”

To
“Windows System Software Devs Interest List”
cc

Subject
RE: Re:[ntdev] PathId and PortId

LUN 6 or TARGET 6?

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loren Wilton
Sent: Wednesday, February 21, 2007 6:30 AM
To: Windows System Software Devs Interest List
Subject: Re: Re:[ntdev] PathId and PortId

> LUN numbers need more clarification. First, LUN 0 must exist. Second,
> sparse

Um. I’ve plenty of times configured systems with scsi controllers that
only
had a single unit on LUN 4 or 6, and nothing on zero. Worked fine.

Now, in pc-land to boot I believe you need LUN 0 on the boot device cable.

That certainly isn’t true for other systems. Amigas have booted for
decades
from LUN 6 with nothing else on the bus.

Loren


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List
Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Storport enumerates as Jerry says. REPORT LUNS to LUN0 first, then INQUIRY to the reported LUNs, otherwise INQUIRY to LUN 0. Support for REPORT LUNS is mandatory unless you only have single LUNs.

(From SPC-2 or later
A SCSI device that is capable of supporting a LUN address other than zero shall support a REPORT LUNS command that
is addressed to logical unit zero. Support of the REPORT LUNS command by logical units other than logical unit
zero is optional. Support of the REPORT LUNS command on devices having only a single logical unit with the
logical unit number of zero is optional.)

SCSIport sends INQUIRY to LUN 0, REPORT LUNS to LUN 0, INQUIRY to LUNS 1-7, INQUIRY to other LUNS reported by REPORT LUNS. The algorithm can be modified using registry settings such as SparseLun and LargeLuns, otherwise HiSupp is checked before sending the REPORT LUNS. These parameters are covered in WinHEC/Devcon material. None of this applies to Storport.

From: xxxxx@attotech.com [mailto:xxxxx@attotech.com]
Sent: Wednesday, February 21, 2007 7:31 PM
Subject: RE: Re:PathId and PortId

Agreed, hopefully it would. If I get a chance, I’ll try it.

But that would depend on how it was failed. If I fail it with SRB_STATUS_SELECTION_TIMEOUT, they’d just skip to the next TargetId. I’d have to dummy up a SCSI status with sense data and all.

Alternatively … I think I have an old disk drive that doesn’t support Report LUNs.

Jerry.

Peter Wieland
Sent by: xxxxx@lists.osr.com

02/21/2007 08:34 PM
Please respond to
“Windows System Software Devs Interest List”

To

“Windows System Software Devs Interest List”

cc

Subject

RE: Re:[ntdev] PathId and PortId

Hopefully it would send an INQUIRY in that case.

You could find out in your miniport by failing SCSIOP_REPORT_LUNS rather than handing it off to the HBA J

-p

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@attotech.com
Sent: Wednesday, February 21, 2007 1:47 PM
To: Windows System Software Devs Interest List
Subject: RE: Re:[ntdev] PathId and PortId

Prior to Vista, Windows would:

Send Inquiry to LUN 0
If LargeLuns is set in the HBA’s registry info, send Report LUNs to LUN 0 with a byte count of 0x10 (not sure if they were also looking at the HISUPPORT bit in LUN 0 Inquiry Data)
If the above returns with a LUN list length indicating more than one LUN, issue another Report LUNs command with the correct length
EVEN IF Report LUNs returns success, send Inquiry to all LUNs 1 through 7 regardless of the LUN list returned above
Send Inquiry to any additional LUNs listed in the Report LUNs command
There is no requirement that there be no holes in the LUN numbers on Windows, but other operating systems do require this.
I have pleanty of Fibre Channel traces that will verify this.

It seems that Vista does things a bit differently. It:

Comes right out with Report LUNs to LUN 0, data length 0x10, regardless of the setting of the LargeLuns registry entry
If the above returns with a LUN list length indicating more than one LUN, issue another Report LUNs command with the correct length
If that succeeds, only sends Inquiries to LUNs listed in the Report LUNs results.

I have no ides right now what Vista would do if the Report LUNs command comes back with Check Condition - Command Not Supported.

Jerry.
Peter Wieland
Sent by: xxxxx@lists.osr.com

02/21/2007 11:43 AM

Please respond to
“Windows System Software Devs Interest List”

To

“Windows System Software Devs Interest List”

cc

Subject

RE: Re:[ntdev] PathId and PortId

LUN 6 or TARGET 6?

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Loren Wilton
Sent: Wednesday, February 21, 2007 6:30 AM
To: Windows System Software Devs Interest List
Subject: Re: Re:[ntdev] PathId and PortId

> LUN numbers need more clarification. First, LUN 0 must exist. Second,
> sparse

Um. I’ve plenty of times configured systems with scsi controllers that only
had a single unit on LUN 4 or 6, and nothing on zero. Worked fine.

Now, in pc-land to boot I believe you need LUN 0 on the boot device cable.
That certainly isn’t true for other systems. Amigas have booted for decades
from LUN 6 with nothing else on the bus.

Loren


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer