ProtocolReceiveComplete IRQL

Hello !
My ProtocolReceiveComplete routine executes on DISPATCH_LEVEL.
DDK says, thay by default it is PASSIVE_LEVEL …
So, I guess, that my routine does something not by default …

How can I make it execute on PASSIVE_LEVEL ?


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Use a work item, see NdisScheduleWorkItem().

However, as you state, the docs clearly say “ProtocolReceiveComplete
runs at IRQL PASSIVE_LEVEL”.

Can you check the call stack in your ProtocolReceiveComplete()? What
are the functions below ProtocolReceiveComplete() on the stack?

How do you know the current IRQL? If it is for sure DISPATCH_LEVEL
then this is a candidate for the OSR bug bash.

Stephan

On Mon, 28 Jan 2002 12:51:01 +0300, “foxgen” wrote:

>
> Hello !
>My ProtocolReceiveComplete routine executes on DISPATCH_LEVEL.
>DDK says, thay by default it is PASSIVE_LEVEL …
>So, I guess, that my routine does something not by default …
>
>How can I make it execute on PASSIVE_LEVEL ?


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I use KeGetCurrentIrql in the very beginning of my ProtocolReceiveComplete

Actually it’s the first function, I call from it.
and I get 2 from it … that is DISPATCH_LEVEL…

My Stack during ProtocolReceiveComplete (I use windbg) :

klpid!PtReceiveComplete
NDIS!ethFilterDprIndicateReceivePacket+0x407
e100bnt5!RxProcessInterrupt+0x452
e100bnt5!MiniportHandleInterrupt+0x60
NDIS!ndisMDpc+0xc8
nt!KiRetireDpcList+0x30
nt!KiIdleLoop+0x26

----- Original Message -----
From: “Stephan Wolf”
Newsgroups: ntdev
To: “NT Developers Interest List”
Sent: Monday, January 28, 2002 5:05 PM
Subject: [ntdev] Re: ProtocolReceiveComplete IRQL

> Use a work item, see NdisScheduleWorkItem().
>
> However, as you state, the docs clearly say “ProtocolReceiveComplete
> runs at IRQL PASSIVE_LEVEL”.
>
> Can you check the call stack in your ProtocolReceiveComplete()? What
> are the functions below ProtocolReceiveComplete() on the stack?
>
> How do you know the current IRQL? If it is for sure DISPATCH_LEVEL
> then this is a candidate for the OSR bug bash.
>
> Stephan
> —
> On Mon, 28 Jan 2002 12:51:01 +0300, “foxgen” wrote:
>
> >
> > Hello !
> >My ProtocolReceiveComplete routine executes on DISPATCH_LEVEL.
> >DDK says, thay by default it is PASSIVE_LEVEL …
> >So, I guess, that my routine does something not by default …
> >
> >How can I make it execute on PASSIVE_LEVEL ?
>
> —
> You are currently subscribed to ntdev as: xxxxx@yandex.ru
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Umm, as you can see on the stack, your PtReceiveComplete() is called
from KiRetireDpcList() context, which is (of course) running at
DISPATCH_LEVEL.

So this looks like a bug in NDIS to me!

Veto anyone? If not, please file a bug against this in the OSR bug
bash (http://www.osr.com/ddk/ddk.htm).

Stephan

On Mon, 28 Jan 2002 18:37:36 +0300, “foxgen” wrote:

>
>I use KeGetCurrentIrql in the very beginning of my ProtocolReceiveComplete
>…
>Actually it’s the first function, I call from it.
>and I get 2 from it … that is DISPATCH_LEVEL…
>
>My Stack during ProtocolReceiveComplete (I use windbg) :
>
>klpid!PtReceiveComplete
>NDIS!ethFilterDprIndicateReceivePacket+0x407
>e100bnt5!RxProcessInterrupt+0x452
>e100bnt5!MiniportHandleInterrupt+0x60
>NDIS!ndisMDpc+0xc8
>nt!KiRetireDpcList+0x30
>nt!KiIdleLoop+0x26
>
>
>----- Original Message -----
>From: “Stephan Wolf”
>Newsgroups: ntdev
>To: “NT Developers Interest List”
>Sent: Monday, January 28, 2002 5:05 PM
>Subject: [ntdev] Re: ProtocolReceiveComplete IRQL
>
>
>> Use a work item, see NdisScheduleWorkItem().
>>
>> However, as you state, the docs clearly say “ProtocolReceiveComplete
>> runs at IRQL PASSIVE_LEVEL”.
>>
>> Can you check the call stack in your ProtocolReceiveComplete()? What
>> are the functions below ProtocolReceiveComplete() on the stack?
>>
>> How do you know the current IRQL? If it is for sure DISPATCH_LEVEL
>> then this is a candidate for the OSR bug bash.
>>
>> Stephan
>> —
>> On Mon, 28 Jan 2002 12:51:01 +0300, “foxgen” wrote:
>>
>> >
>> > Hello !
>> >My ProtocolReceiveComplete routine executes on DISPATCH_LEVEL.
>> >DDK says, thay by default it is PASSIVE_LEVEL …
>> >So, I guess, that my routine does something not by default …
>> >
>> >How can I make it execute on PASSIVE_LEVEL ?


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

My experience is mainly with an IM driver. As a rule of thumb, I find
that the lower edge routines generally run at dispatch level and the
upper edge routines run at passive level.

Also, there are inaccuracies in the DDK. Just keep that in mind when
observations do not match the documentation.

Dave

foxgen wrote:

Hello !
My ProtocolReceiveComplete routine executes on DISPATCH_LEVEL.
DDK says, thay by default it is PASSIVE_LEVEL …
So, I guess, that my routine does something not by default …

How can I make it execute on PASSIVE_LEVEL ?


You are currently subscribed to ntdev as: xxxxx@okena.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Your “rules of thumb” for the IRQL that NDIS driver functions run at
remind me of my rule of thumb: “99.999% of all software bugs are due
to wrong assumptions” (rest is typos).

Yes, there are “inaccuracies in the DDK”. IMHO, by far not as bad as
it was years ago, though. Please post a report to the OSR bug bash if
you find one so we can all benefit from it.

Thanks, Stephan

On Tue, 29 Jan 2002 07:48:01 -0500, Dave McCowan
wrote:

>
>My experience is mainly with an IM driver. As a rule of thumb, I find
>that the lower edge routines generally run at dispatch level and the
>upper edge routines run at passive level.
>
>Also, there are inaccuracies in the DDK. Just keep that in mind when
>observations do not match the documentation.
>
>Dave
>
>foxgen wrote:
>
>> Hello !
>> My ProtocolReceiveComplete routine executes on DISPATCH_LEVEL.
>> DDK says, thay by default it is PASSIVE_LEVEL …
>> So, I guess, that my routine does something not by default …
>>
>> How can I make it execute on PASSIVE_LEVEL ?


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I don’t mean to imply that I suggest basing programming decisions on a
“rule of thumb.” My point is to use a rule of thumb to protect against
assumptions and possible misinformation. In this specific example, if most
lower edge routines run at dispatch level, then it may behoove one to be
cautious and implement the PtReceiveComplete as though it always runs at
dispatch, which is in conflict with the documentation.

Dave

Stephan Wolf wrote:

Your “rules of thumb” for the IRQL that NDIS driver functions run at
remind me of my rule of thumb: “99.999% of all software bugs are due
to wrong assumptions” (rest is typos).

Yes, there are “inaccuracies in the DDK”. IMHO, by far not as bad as
it was years ago, though. Please post a report to the OSR bug bash if
you find one so we can all benefit from it.

Thanks, Stephan

On Tue, 29 Jan 2002 07:48:01 -0500, Dave McCowan
> wrote:
>
> >
> >My experience is mainly with an IM driver. As a rule of thumb, I find
> >that the lower edge routines generally run at dispatch level and the
> >upper edge routines run at passive level.
> >
> >Also, there are inaccuracies in the DDK. Just keep that in mind when
> >observations do not match the documentation.
> >
> >Dave
> >
> >foxgen wrote:
> >
> >> Hello !
> >> My ProtocolReceiveComplete routine executes on DISPATCH_LEVEL.
> >> DDK says, thay by default it is PASSIVE_LEVEL …
> >> So, I guess, that my routine does something not by default …
> >>
> >> How can I make it execute on PASSIVE_LEVEL ?
>
> —
> You are currently subscribed to ntdev as: xxxxx@okena.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

FYI: MS’ Eliyas Yakub wrote:

>It’s a documentation fault. We have already fixed the docs.
>
>–
>-Eliyas
>This posting is provided “AS IS” with no warranties, and confers no rights.
>You assume all risk for your use.
>
>
>“Stephan Wolf” wrote in message
>news:xxxxx@news.t-online.de…
>[I moved this question here from NTDEV]
>
>The DDK docs clearly say:
>
> “ProtocolReceiveComplete runs at IRQL PASSIVE_LEVEL”
>
>However, it has been observed that ProtocolReceiveComplete() is
>sometimes called at IRQL DISPATCH_LEVEL (from “NDIS!ndisMDpc”
>context).
>
>Is this a bug in NDIS or a documentation fault?
>
>Stephan

===

On Mon, 28 Jan 2002 18:37:36 +0300, “foxgen” wrote:

>
>I use KeGetCurrentIrql in the very beginning of my ProtocolReceiveComplete
>…
>Actually it’s the first function, I call from it.
>and I get 2 from it … that is DISPATCH_LEVEL…
>
>My Stack during ProtocolReceiveComplete (I use windbg) :
>
>klpid!PtReceiveComplete
>NDIS!ethFilterDprIndicateReceivePacket+0x407
>e100bnt5!RxProcessInterrupt+0x452
>e100bnt5!MiniportHandleInterrupt+0x60
>NDIS!ndisMDpc+0xc8
>nt!KiRetireDpcList+0x30
>nt!KiIdleLoop+0x26
>
>
>----- Original Message -----
>From: “Stephan Wolf”
>Newsgroups: ntdev
>To: “NT Developers Interest List”
>Sent: Monday, January 28, 2002 5:05 PM
>Subject: [ntdev] Re: ProtocolReceiveComplete IRQL
>
>
>> Use a work item, see NdisScheduleWorkItem().
>>
>> However, as you state, the docs clearly say “ProtocolReceiveComplete
>> runs at IRQL PASSIVE_LEVEL”.
>>
>> Can you check the call stack in your ProtocolReceiveComplete()? What
>> are the functions below ProtocolReceiveComplete() on the stack?
>>
>> How do you know the current IRQL? If it is for sure DISPATCH_LEVEL
>> then this is a candidate for the OSR bug bash.
>>
>> Stephan
>> —
>> On Mon, 28 Jan 2002 12:51:01 +0300, “foxgen” wrote:
>>
>> >
>> > Hello !
>> >My ProtocolReceiveComplete routine executes on DISPATCH_LEVEL.
>> >DDK says, thay by default it is PASSIVE_LEVEL …
>> >So, I guess, that my routine does something not by default …
>> >
>> >How can I make it execute on PASSIVE_LEVEL ?


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com