NdisGetCurrentProcessorCpuUsage (NDIS 5.1) function
Note NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.
NdisGetCurrentProcessorCpuUsage returns how busy the current processor is as a percentage.
Syntax
VOID NdisGetCurrentProcessorCpuUsage(
_Out_ PULONG pCpuUsage
);
Parameters
- pCpuUsage [out]
Pointer to a caller-supplied variable in which this function returns the percentage of CPU, on which the caller is running, that is currently being used.
Return value
None
Remarks
NDIS drivers can call NdisGetCurrentProcessorCpuUsage to determine how loaded the CPU on which they are running is so they can change how they handle certain operations to improve driver performance.
For example, a NIC driver might call this function periodically and, as its percentage of CPU usage trends higher, disable interrupts on the NIC and switch to polling the state of the NIC. This strategy yields higher performance during periods of high network traffic by eliminating interrupt-processing overhead while the NIC is generating many interrupts. Instead, the driver's polling MiniportTimer function makes indications and completes sends until network traffic declines again. When its periodic calls to NdisGetCurrentProcessorCpuUsage indicate CPU usage is trending lower again, such a driver would re-enable interrupts on the NIC and cancel its polling MiniportTimer function.
Requirements
Target platform |
Universal |
Version |
|
Header |
Ndis.h (include Ndis.h) |
Library |
Ndis.lib |
IRQL |
Any level |
See also