Pre-Allocating Contiguous Memory

Napatech Link-Capture™ Software and WinPcap-NT Installation Guide for Windows

Platform
Napatech SmartNIC
Content Type
Software Installation Guide
Capture Software Version
Link™ Capture Software 12.8

Fragmented memory

The kernel-mode driver is able to allocate a huge amount of memory, but as the memory needs to be contiguous it can sometimes be a problem as the memory gets fragmented over time.

Pre-allocating contiguous memory

In order to avoid this problem, the kernel-mode driver can allocate and reserve the memory at Windows startup. This is done by setting the registry key ReservedDMAPoolSize to the desired amount of memory in MB (MByte). See Registry entries for configuration.

The allocating can be done from different NUMA nodes by appending the registry key with [<x>] where <x> is the NUMA node.

By default 232 MB from NUMA node 0 are reserved, corresponding to the default host buffer configuration:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Nt3gd\Parameters\Configuration]
ReservedDMAPoolSize:dword:232

Calculating ReservedDMAPoolSize

The optimal ReservedDMAPoolSize depends on the host buffer configuration in ntservice.ini.

By default, four 16 MB host buffers are allocated for Rx and Tx on NUMA node 0:

HostBufferRx=[4,16,0]
HostBufferTx=[4,16,0]

For NUMA node 0, ReservedDMAPoolSize should be

20 + (Rx host buffer size + 4) × Rx host buffer count + (Tx host buffer size + 4) × Tx host buffer count

For subsequent NUMA nodes, ReservedDMAPoolSize should be

4 + (Rx host buffer size + 4) × Rx host buffer count + (Tx host buffer size + 4) × Tx host buffer count

Example

Given this host buffer configuration in ntservice.ini:

HostBufferRx=[4,32,0],[4,32,1]
HostBufferTx=[4,32,0],[4,32,1]

you should reserve 308 MB from NUMA node 0 and 292 MB from NUMA node 1:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Nt3gd\Parameters\Configuration]
ReservedDMAPoolSize[0]:dword:308
ReservedDMAPoolSize[1]:dword:292