DDK NDIS Packet protocol driver dropping packets

Hi

I am developing a simple NDIS protocol driver based directly on the sample
“packet protocol” provided by the Win2K DDK. I am pretty new to driver
development.

I have written a user-mode application that asynchronously checks for
received packets and executes a callback routine each time a new packet
arrives so the callback can implement custom handling of the packet.
Pretty standard stuff I’m sure!!

The DDK sample driver seems to queue packet requests and then service each
request with a new received packet. (Not sure exactly why it does this.)

The problem I’m having is that while the callback function is busy
processing the packet, incoming packets simply get dropped, as the
protocol driver sees no pending requests in its request queue. I am trying
to modify the driver to queue the received packets (instead of dropping
them) so that the user-mode application is guaranteed to receive all
packets, no matter how long it takes to process each one.

I have searched for information on how to do this without much success.

Any help would be greatly appreciated.

Aharon

You must make sure that when each packet is received there is always a
user-provided buffer to put it in.

One improvement is to have the user mode application make multiple
concurrent packet reads. The driver queues them all (status pending, etc.).
As packets come in the driver fetches a pending read from the queue and file
it with packet data, then completes it. As long as there are enough pending
reads, you are OK.

Next step would be to modify read operation so that each user mode read
actually provides a large buffer to the driver. The large buffer is filled
with multiple packets. More packets-per-read, fewer kernel-user transitions,
better performance.

Also, shared memory might work.

Some Network Performance Notes at:

http://www.pcausa.com/support/KB06300101.htm

Good luck,

Thomas F. Divine

PCAUSA - Tools & Resources For Network Software Developers
NDIS Protocol/Intermediate/Hooking - TDI Client/Filter
http: - http:

“Aharon” wrote in message news:xxxxx@ntdev…
>
> Hi
>
> I am developing a simple NDIS protocol driver based directly on the sample
> “packet protocol” provided by the Win2K DDK. I am pretty new to driver
> development.
>
> I have written a user-mode application that asynchronously checks for
> received packets and executes a callback routine each time a new packet
> arrives so the callback can implement custom handling of the packet.
> Pretty standard stuff I’m sure!!
>
> The DDK sample driver seems to queue packet requests and then service each
> request with a new received packet. (Not sure exactly why it does this.)
>
> The problem I’m having is that while the callback function is busy
> processing the packet, incoming packets simply get dropped, as the
> protocol driver sees no pending requests in its request queue. I am trying
> to modify the driver to queue the received packets (instead of dropping
> them) so that the user-mode application is guaranteed to receive all
> packets, no matter how long it takes to process each one.
>
> I have searched for information on how to do this without much success.
>
> Any help would be greatly appreciated.
>
> Aharon
>
></http:></http:>