Skip to main content

Module mlx_domain

Module mlx_domain 

Source
Expand description

Mellanox (mlx5) domain strategy for [IbvDomainImpl].

Host and non-mlx5dv device memory use the default host/dmabuf registration. On an mlx5dv-capable device, CUDA device memory is bound to an indirect mlx5dv memory key so a whole allocator segment is addressable through a single key.

The segment scanning + binding bookkeeping lives here in Rust. Resource creation goes through [MlxDomainOps] so the (intricate) scan/bind logic can be unit-tested against a mock; the production implementation ([ProdMlxDomainOps]) delegates to the real functions and the rdmaxcel_sys::rdmaxcel_bind_mr_list shim. Teardown is the Drop of the owning RAII wrappers ([IbvMr], [Mlx5dvMkey]), correct by construction.

Structs§

MlxDomain
Mellanox [IbvDomainImpl].
ScannedSegment
A CUDA memory segment reported by a registered scanner.

Functions§

register_cuda_segment_scanner
Register the process-wide CUDA segment scanner, replacing any previously registered one.

Type Aliases§

CudaSegmentScanner
Enumerates the currently-live CUDA segments. An Arc (not Box) so [scan_cuda_segments] can clone it out and drop the registry lock before invoking it — see that function.