> ----------
From: xxxxx@hotmail.com[SMTP:xxxxx@hotmail.com]
Reply To: xxxxx@lists.osr.com
Sent: Monday, February 25, 2002 1:30 PM
To: xxxxx@lists.osr.com
Subject: [ntdev] Re: MiniportReturnPacket() not getting called in NT
D- eserialized miniport DriverOn Fri, 22 Feb 2002 21:29:17 +0100, Michal Vodicka
wrote:
> > Yes, there
> >are race conditions as you stated but it is unfortunately the only way
> >because MiniportReturnPacket isn’t called for other than pending packets.
>
> Note that there is actually a safe solution for this problem. You need
> to implement an ‘Indicating’ flag in the ‘MiniportReserved’ area of
> each packet indicated to NdisMIndicateReceivePacket(). Set the flag
> before indicating the packet. In MiniportReturnPacket(), if the flag
> is set, clear the flag and return immediately. This must be done with
> a spin lock acquired!
>
> When NdisMIndicateReceivePacket() returns, acquire the same spin lock.
> Walk through the array of packets just indicated. If the ‘Indicating’
> flag is still set, clear (set to NULL) the corresponding packet
> pointer in the array. Otherwise, clear the flag. Release the spin
> lock.
>
> Now walk through the pointer array a second time. For all pointers !=
> NULL, call MiniportReturnPacket().
>
Good idea, it should work in principle (I guess you’ll have to clarify
details for people trying to implement it :). I’d like to know performance
comparison with NDIS_STATUS_RESOURCES solution on NT4. Maybe there would be
no real difference; IIRC tcpip.sys has common handler for both
ProtocolReceive and ProtocolReceivePacket which copies packet buffers. Can’t
verify it now, this project ended with my previous company and hopefully I
won’t boot NT4 anymore
Best regards,
Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]