Hanzhu,
It is appropriate to process the data in the event callback of a
ClientEventReceive if you can do so quickly. If you cannot do so quickly,
it is appropriate to buffer some, none, or all of the ‘look-ahead’ data in
the indication and return an IRP to get the remaining data; processing the
entire receive during the IRP completion routine.
I the case of the ‘Chained’ variety the client is being given what amounts
to be the underlying NDIS_PACKET and NDIS_BUFFER chain the resulted in
receive indication. Similar guidelines apply here. If it can be
accomplished quickly, you might as well get it done. If, however, it must
wait for some reason, you do not necessarily need to ‘copy’ the data since
it is permissible to hold onto ownership of the chained receive until
processing is complete. Of course you must realize that this cannot be for
a long time as you will starve the underlying NDIS NIC of receive buffers.
As for which way increases network throughput, are you asking for the system
in general or your application? If you know that your application is bursty
with low bandwidth requirements, then, perhaps buffering the recieves and
letting the system get back to more urgent tasks would be very considerate
of your driver. If, on the other hand, your application *is* the urgent
activity, it would be far better to get the processing done and not waste
time and resources buffering, queueing, scheduling, etc.
One last note: It is not *necessary* to register a ClientEventXxxChained
handler if nature of your driver is that it does not specifically take
advantage of the potential benefits (in other words, if it is just going to
buffer the data and schedule a work-item - you might as well allocate and
IRP and wait for the CRTN).
Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of hanzhu
Sent: Monday, December 05, 2005 9:01 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] ClientEvent(Chained)Receive question
Is it appropriate to process the data indicated by the transport dirver in
the ClientEvent(Chained)Receive callback routine ? Or I should just copy all
the data from the buffer and return from these event handlers as soon as
possible? Which way can increase the network throughput?
Any help will be appreciated!
Best Regards,
hanzhu
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@msn.com To unsubscribe
send a blank email to xxxxx@lists.osr.com