Constant LOOKUP_TABLE_RELEASE

Source
const LOOKUP_TABLE_RELEASE: &[(u16, u16, u16); 39];
Expand description

Lookup table for VTL2 DMA hint calculation. This table is used to retrofit dedicated DMA memory for existing configurations known at the time of writing. Dedicated DMA memory is required for devices that survive OpenHCL servicing operations (for example, NVMe and MANA devices). Those devices express their need as the “persistent memory” requirement when they create a DMA client. Since the amount of dedicated DMA memory cannot be changed at runtime, the amount of memory set aside must account for the maximum expected usage.

This table derives the maximum expected usage based on:

  1. The number of expected MANA and NVMe devices and,
  2. The amount of DMA each device needs.

To illustrate the second point, an NVMe device with 64 queue pairs will need the following memory (see nvme_driver::QueuePair::new for details):

  • Submission queue: 4 pages,
  • Completion queue: 1 page,
  • Extra memory per queue: 64 pages

If there are 32 VPs, we expect one queue pair per VP, leading to:

  • Total per NVMe device: 32 * (4 + 1 + 64) = 32 * 69 = 2208 pages = 8.59 MiB

What is not easily derivable from this source base is the max number of devices expected in any given VTL2 configuration. We derive that manually from external data sources.

The inputs are the number of VTL0 VPs (vp_count) and the amount of memory assigned to VTL2 (vtl2_memory_mb). The output is the recommended DMA hint value (dma_hint_mb).

The table is sorted by VP count, then by assigned memory. (vp_count, vtl2_memory_mb, dma_hint_mb)