Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
Hi all.
To the receive path of NDIS filter driver arrives NetBufferLists, that consists of only one NetBuffer (as documented).
But what about MDLs.
Is it one or maybe several MDLs inside that NetBuffer?
If there are several, then the reason for this is not clear to me․ After all, MDL can have any length․
And the same question about NetBufferLists. It is one or maybe several NetBufferLists in a chain.
Thanks
Upcoming OSR Seminars | ||
---|---|---|
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead! | ||
Kernel Debugging | 13-17 May 2024 | Live, Online |
Developing Minifilters | 1-5 Apr 2024 | Live, Online |
Internals & Software Drivers | 11-15 Mar 2024 | Live, Online |
Writing WDF Drivers | 26 Feb - 1 Mar 2024 | Live, Online |
Comments
If you have a single, physically-contiguous buffer for each NetBuffer, then it is a single MDL.
If your receive buffer is not physically-contiguous for the network frame, then you will have to build multiple MDLs for each fragment.
In the NDIS driver I did for WEC7/WEC2013 I structured it such that every received packet was placed into a physically-contiguous buffer so I only needed a single MDL for each NetBuffer.
Greg
On Thu, 19 Jan 2023 15:40:35 +0000 (UTC), Arsen wrote:
OSR https://community.osr.com/
Arsen Started a new discussion. Account of MDLs in NetBuffer
Hi all.
To the receive path of NDIS filter driver arrives NetBufferLists, that consists of only one NetBuffer (as documented).
But what about MDLs.
Is it one or maybe several MDLs inside that NetBuffer?
If there are several, then the reason for this is not clear to me․ After all, MDL can have any length․
And the same question about NetBufferLists. It is one or maybe several NetBufferLists in a chain.
Thanks
Thank You Mr. Gregory.
Thank you Mr Gregory. I understand that it depends on the settings of my network card.
That's not correct. Most buffers are not physically contiguous, but an MDL must be VIRTUALLY contiguous. The whole point of an MDL is to gather physically disparate pages into a single unit.
That's also not true. An MDL is limited to 4 gigabytes. Until Windows 7, an MDL was limited to 32 megabytes, because the "Size" parameter that gives the total size of the MDL is a 16-bit field. Since each page entry is 8 bytes, that's 65536 / 8 x 4096, or 32MB. (It's a little bit less than that, because the 65536 has to include the size of the MDL structure.)
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
Mr. Tim-Roberts. Thank you. In any case, I think that network packets cannot be larger than 4 gigabytes, so there can be one mdl in one NetBuffer in the receive path, one NetBuffer and several NetBufferLists.