mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: add NVIDIA GPUDirect P2P support
On platforms where PCIe P2P is supported, inject a PCI capability into NVIDIA GPU to indicate support. Signed-off-by: Thomas Barrett <tbarrett@crusoeenergy.com>
This commit is contained in:
committed by
Rob Bradford
parent
05ec6190da
commit
b750c332aa
@@ -1746,7 +1746,12 @@ impl DeviceConfig {
|
||||
|
||||
pub fn parse(device: &str) -> Result<Self> {
|
||||
let mut parser = OptionParser::new();
|
||||
parser.add("path").add("id").add("iommu").add("pci_segment");
|
||||
parser
|
||||
.add("path")
|
||||
.add("id")
|
||||
.add("iommu")
|
||||
.add("pci_segment")
|
||||
.add("x_nv_gpudirect_clique");
|
||||
parser.parse(device).map_err(Error::ParseDevice)?;
|
||||
|
||||
let path = parser
|
||||
@@ -1763,12 +1768,15 @@ impl DeviceConfig {
|
||||
.convert::<u16>("pci_segment")
|
||||
.map_err(Error::ParseDevice)?
|
||||
.unwrap_or_default();
|
||||
|
||||
let x_nv_gpudirect_clique = parser
|
||||
.convert::<u8>("x_nv_gpudirect_clique")
|
||||
.map_err(Error::ParseDevice)?;
|
||||
Ok(DeviceConfig {
|
||||
path,
|
||||
iommu,
|
||||
id,
|
||||
pci_segment,
|
||||
x_nv_gpudirect_clique,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3324,6 +3332,7 @@ mod tests {
|
||||
id: None,
|
||||
iommu: false,
|
||||
pci_segment: 0,
|
||||
x_nv_gpudirect_clique: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user