Hi,

I am new to writing device drivers and in the process of developing a
filter intermediate driver. I have 3 NIC on my system. If i am getting
the data on all the 3 NICs, Will the Ndis serialze the protocolReceive
or is it the IM developer responsibility?.

My understanding is that:- The miniport does not send any new packet to
upperlayer protocol unless the ProtocolReceive/ProtocolReceivePacket
returns. Is it right?

What about the multiprocessor Systems?

Thanks in Advance.

Gaurav

Re: Serialization of ProtocolReceivePacket by Calvin

Calvin
Wed Apr 12 15:39:32 CDT 2006

> My understanding is that:- The miniport does not send any new packet to
> upperlayer protocol unless the ProtocolReceive/ProtocolReceivePacket
> returns. Is it right?

It's unsafe to make such assumption. Miniport can shoot RX packets up as
long as its DPC(s) has detected received packets. It's true that miniport
usually indicates packet at DISPATCH and generally interrupt is disabled
until DPC returns. But that doesn't mean DPCs are serialized since miniport
may queued multiple DPCs to different CPUs per interrupt, for example, while
it's doing "Receive Side Scaling".

--
Calvin Guan (Windows DDK MVP)
NetXtreme Longhorn Miniport Prime
Broadcom Corp. www.broadcom.com



Re: Serialization of ProtocolReceivePacket by Stephan

Stephan
Thu Apr 13 03:30:48 CDT 2006

Also, if the OP has more than one NIC, his receive routine is likely to
get called more than once in a multiprocessor environment.

Only "serialized" NDIS miniport drivers are guaranteed to have all of
their MiniportXyz() routines called in a serialized manner (hence the
name).

However, NDIS intermediate drivers are *de*serialized by implication.
So please make sure you are able to handle *any* number of parallel
calls to the receive handler in your IM at *any* time.

Stephan
---
Calvin Guan wrote:
> > My understanding is that:- The miniport does not send any new packet to
> > upperlayer protocol unless the ProtocolReceive/ProtocolReceivePacket
> > returns. Is it right?
>
> It's unsafe to make such assumption. Miniport can shoot RX packets up as
> long as its DPC(s) has detected received packets. It's true that miniport
> usually indicates packet at DISPATCH and generally interrupt is disabled
> until DPC returns. But that doesn't mean DPCs are serialized since miniport
> may queued multiple DPCs to different CPUs per interrupt, for example, while
> it's doing "Receive Side Scaling".
>
> --
> Calvin Guan (Windows DDK MVP)
> NetXtreme Longhorn Miniport Prime
> Broadcom Corp. www.broadcom.com