1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-24 16:10:11 +00:00
freebsd/sys/compat/ndis
Bill Paul a944e196da MDLs are supposed to be variable size (they include an array of pages
that describe a buffer of variable size). The problem is, allocating
MDLs off the heap is slow, and it can happen that drivers will allocate
lots and lots of lots of MDLs as they run.

As a compromise, we now do the following: we pre-allocate a zone for
MDLs big enough to describe any buffer with 16 or less pages. If
IoAllocateMdl() needs a MDL for a buffer with 16 or less pages, we'll
allocate it from the zone. Otherwise, we allocate it from the heap.
MDLs allocate from the zone have a flag set in their mdl_flags field.
When the MDL is released, IoMdlFree() will uma_zfree() the MDL if
it has the MDL_ZONE_ALLOCED flag set, otherwise it will release it
to the heap.

The assumption is that 16 pages is a "big number" and we will rarely
need MDLs larger than that.

- Moved the ndis_buffer zone to subr_ntoskrnl.c from kern_ndis.c
  and named it mdl_zone.

- Modified IoAllocateMdl() and IoFreeMdl() to use uma_zalloc() and
  uma_zfree() if necessary.

- Made ndis_mtop() use IoAllocateMdl() instead of calling uma_zalloc()
  directly.

Inspired by: discussion with Giridhar Pemmasani
2005-02-26 00:22:16 +00:00
..
cfg_var.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
hal_var.h Add support for Windows/x86-64 binaries to Project Evil. 2005-02-16 05:41:18 +00:00
kern_ndis.c MDLs are supposed to be variable size (they include an array of pages 2005-02-26 00:22:16 +00:00
kern_windrv.c - Correct one aspect of the driver_object/device_object/IRP framework: 2005-02-24 21:49:14 +00:00
ndis_var.h Add support for Windows/x86-64 binaries to Project Evil. 2005-02-16 05:41:18 +00:00
ntoskrnl_var.h MDLs are supposed to be variable size (they include an array of pages 2005-02-26 00:22:16 +00:00
pe_var.h Fix a couple of u_int_foos that should have been uint_foos. 2005-02-18 04:33:34 +00:00
resource_var.h Add support for Windows/x86-64 binaries to Project Evil. 2005-02-16 05:41:18 +00:00
subr_hal.c Add support for Windows/x86-64 binaries to Project Evil. 2005-02-16 05:41:18 +00:00
subr_ndis.c Fix a couple of u_int_foos that should have been uint_foos. 2005-02-18 04:33:34 +00:00
subr_ntoskrnl.c MDLs are supposed to be variable size (they include an array of pages 2005-02-26 00:22:16 +00:00
subr_pe.c Couple of lessons learned during USB driver testing: 2005-02-24 17:58:27 +00:00
subr_usbd.c - Correct one aspect of the driver_object/device_object/IRP framework: 2005-02-24 21:49:14 +00:00
usbd_var.h - Correct one aspect of the driver_object/device_object/IRP framework: 2005-02-24 21:49:14 +00:00
winx64_wrap.S Make the Win64 -> ELF64 template a little smaller by using a string 2005-02-18 03:22:37 +00:00