#[non_exhaustive]pub struct NodeVfioConfig {
pub dma_entry_limit: Option<i32>,
/* private fields */
}Expand description
Configuration settings for VFIO (Virtual Function I/O) on a node. VFIO allows safe, unprivileged, userspace drivers to access I/O devices.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.dma_entry_limit: Option<i32>Optional. Specifies the maximum number of DMA entries (pages) that can be
mapped by the VFIO IOMMU type 1 driver for a container. This limit
affects the total amount of host memory that can be pinned for direct
device access, which is often critical for high-performance devices like
TPUs and GPUs. This setting corresponds to the kernel parameter at:
/sys/module/vfio_iommu_type1/parameters/dma_entry_limit.
The default value in the kernel is 65535. Higher values may be
needed for workloads mapping large memory regions.
Supported values are integers between 65535 and 4194304.
Implementations§
Source§impl NodeVfioConfig
impl NodeVfioConfig
Sourcepub fn set_dma_entry_limit<T>(self, v: T) -> Self
pub fn set_dma_entry_limit<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_dma_entry_limit<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_dma_entry_limit<T>(self, v: Option<T>) -> Self
Sets or clears the value of dma_entry_limit.
§Example
let x = NodeVfioConfig::new().set_or_clear_dma_entry_limit(Some(42));
let x = NodeVfioConfig::new().set_or_clear_dma_entry_limit(None::<i32>);Trait Implementations§
Source§impl Clone for NodeVfioConfig
impl Clone for NodeVfioConfig
Source§fn clone(&self) -> NodeVfioConfig
fn clone(&self) -> NodeVfioConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more