GetScatterGatherList questions (error handling & AdapterListControl)

Can GetScatterGatherList return before the AdapterListControl routine completes? Looking at how the routine seems to operate, I suspect it can’t, but does anyone know if this is guaranteed?

Can GetScatterGatherList fail after calling the AdapterListControl routine? I don’t see how the system could sensibly function if it could. Can I safely assume that it won’t fail after calling AdapterListControl?

Thanks!

Michael Kohne
xxxxx@kohne.org
“You must be smarter than the equipment you are trying to operate.”

GetScatterGatherList can return before the AdapterControlList function
is invoked, so it can return before it completes. In the simplest cases
it’s a straight call-through, but in complex situations you could end up
having your request dropped on a queue to wait for map registers, in
which case your AdapterListControl function would be invoked in some
other thread that calls PutScatterGatherList.

GetScatterGatherList won’t fail once it calls your AdapterListControl
routine.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Kohne
Sent: Tuesday, May 09, 2006 10:51 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] GetScatterGatherList questions (error handling &
AdapterListControl)

Can GetScatterGatherList return before the AdapterListControl routine
completes? Looking at how the routine seems to operate, I suspect it
can’t, but does anyone know if this is guaranteed?

Can GetScatterGatherList fail after calling the AdapterListControl
routine? I don’t see how the system could sensibly function if it could.
Can I safely assume that it won’t fail after calling AdapterListControl?

Thanks!

Michael Kohne
xxxxx@kohne.org
“You must be smarter than the equipment you are trying to operate.”


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

> -------Original Message-------

From: Peter Wieland
> Subject: RE: [ntdev] GetScatterGatherList questions (error handling & AdapterListControl)
> Sent: May 09 '06 13:56
>
> GetScatterGatherList can return before the AdapterControlList function
> is invoked, so it can return before it completes. In the simplest cases
> it’s a straight call-through, but in complex situations you could end up
> having your request dropped on a queue to wait for map registers, in
> which case your AdapterListControl function would be invoked in some
> other thread that calls PutScatterGatherList.
>
> GetScatterGatherList won’t fail once it calls your AdapterListControl
> routine.
>
> -p
>
Ahh. So I managed to convince myself it must be the complete opposite of the way it really is. Sigh. Wishful thinking mode must have been engaged.

Thank you for setting me straight. At least the GSG not failing after calling AdapterListControl is helpful.

Follow up question:
If I have more than one oustanding GetScatterGather request, will the adapter list control routines be called in the order that the GetScatterGather routines were called? Is this guaranteed in any way?

The reason I ask is that I have multiple outstanding S/G lists at any one time, and it’s important that I keep the order of operations correct.

One other thing: I’m convinced that by proper reasoning or reading I could have figured this out. What did I miss in the DDK docs that would have led me to the proper conclusion? I’ve found that if I can get to the root of a mistaken idea, I can prevent others in the future.

Thanks!


Michael Kohne
xxxxx@kohne.org
“You must be smarter than the equipment you are trying to operate.”

Let me check with the DMA folks.

My suspicion is that as long as you ensure you call GetScatterGatherList
in the “right” order, and you let it return before you call it again,
that your callbacks will run in the right order as well.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Kohne
Sent: Tuesday, May 09, 2006 4:45 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] GetScatterGatherList questions (error handling &
AdapterListControl)

-------Original Message-------
From: Peter Wieland
> Subject: RE: [ntdev] GetScatterGatherList questions (error handling &

> AdapterListControl)
> Sent: May 09 '06 13:56
>
> GetScatterGatherList can return before the AdapterControlList
> function is invoked, so it can return before it completes. In the
> simplest cases it’s a straight call-through, but in complex
> situations you could end up having your request dropped on a queue to

> wait for map registers, in which case your AdapterListControl
> function would be invoked in some other thread that calls
PutScatterGatherList.
>
> GetScatterGatherList won’t fail once it calls your AdapterListControl

> routine.
>
> -p
>
Ahh. So I managed to convince myself it must be the complete opposite of
the way it really is. Sigh. Wishful thinking mode must have been
engaged.

Thank you for setting me straight. At least the GSG not failing after
calling AdapterListControl is helpful.

Follow up question:
If I have more than one oustanding GetScatterGather request, will the
adapter list control routines be called in the order that the
GetScatterGather routines were called? Is this guaranteed in any way?

The reason I ask is that I have multiple outstanding S/G lists at any
one time, and it’s important that I keep the order of operations
correct.

One other thing: I’m convinced that by proper reasoning or reading I
could have figured this out. What did I miss in the DDK docs that would
have led me to the proper conclusion? I’ve found that if I can get to
the root of a mistaken idea, I can prevent others in the future.

Thanks!


Michael Kohne
xxxxx@kohne.org
“You must be smarter than the equipment you are trying to operate.”


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

> Can GetScatterGatherList fail after calling the AdapterListControl routine? I

Yes it can. It allocates memory. Use BuildScatterGatherList instead.

Also read this great blog, Peter describes the DMA support in Windows in
details there:

http://blogs.msdn.com/peterwie/

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

There’s a subtle distinction here.

Yes GetScatterGatherList can fail, but not AFTER it’s called the AdapterListControl routine & notified the driver of the mappings.

-p


From: xxxxx@lists.osr.com on behalf of Maxim S. Shatskih
Sent: Wed 5/10/2006 3:44 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] GetScatterGatherList questions (error handling & AdapterListControl)

Can GetScatterGatherList fail after calling the AdapterListControl routine? I

Yes it can. It allocates memory. Use BuildScatterGatherList instead.

Also read this great blog, Peter describes the DMA support in Windows in
details there:

http://blogs.msdn.com/peterwie/

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


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

The DMA folks have confirmed my suspicion. As long as your careful not
to subject them to any races, you’ll get FIFO order on your DMA
operations.

If you have two processors in calls to GetScatterGatherList at the same
time then the order of those two operations will be indeterminate.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Tuesday, May 09, 2006 5:25 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] GetScatterGatherList questions (error handling &
AdapterListControl)

Let me check with the DMA folks.

My suspicion is that as long as you ensure you call GetScatterGatherList
in the “right” order, and you let it return before you call it again,
that your callbacks will run in the right order as well.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Kohne
Sent: Tuesday, May 09, 2006 4:45 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] GetScatterGatherList questions (error handling &
AdapterListControl)

-------Original Message-------
From: Peter Wieland
> Subject: RE: [ntdev] GetScatterGatherList questions (error handling &

> AdapterListControl)
> Sent: May 09 '06 13:56
>
> GetScatterGatherList can return before the AdapterControlList
> function is invoked, so it can return before it completes. In the
> simplest cases it’s a straight call-through, but in complex
> situations you could end up having your request dropped on a queue to

> wait for map registers, in which case your AdapterListControl
> function would be invoked in some other thread that calls
PutScatterGatherList.
>
> GetScatterGatherList won’t fail once it calls your AdapterListControl

> routine.
>
> -p
>
Ahh. So I managed to convince myself it must be the complete opposite of
the way it really is. Sigh. Wishful thinking mode must have been
engaged.

Thank you for setting me straight. At least the GSG not failing after
calling AdapterListControl is helpful.

Follow up question:
If I have more than one oustanding GetScatterGather request, will the
adapter list control routines be called in the order that the
GetScatterGather routines were called? Is this guaranteed in any way?

The reason I ask is that I have multiple outstanding S/G lists at any
one time, and it’s important that I keep the order of operations
correct.

One other thing: I’m convinced that by proper reasoning or reading I
could have figured this out. What did I miss in the DDK docs that would
have led me to the proper conclusion? I’ve found that if I can get to
the root of a mistaken idea, I can prevent others in the future.

Thanks!


Michael Kohne
xxxxx@kohne.org
“You must be smarter than the equipment you are trying to operate.”


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