From b4723999f8c53a3605deb0a8cff94c9ee14f6884 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Sat, 4 Apr 2026 12:49:53 -0700 Subject: [PATCH] docs: Update the relevant documentation Some of the documentation references PCI segment ID. For those documents add a mention of the new PCI device ID. Signed-off-by: Rob Bradford --- docs/device_model.md | 5 +++-- docs/vdpa.md | 24 ++++++++++++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/docs/device_model.md b/docs/device_model.md index ed4577a2c..e915c47ee 100644 --- a/docs/device_model.md +++ b/docs/device_model.md @@ -90,8 +90,9 @@ feature is enabled by default. For all virtio devices listed below, only `virtio-pci` transport layer is supported. Cloud Hypervisor supports multiple PCI segments, and users can -append `,pci_segment=` to the device flag in the Cloud -Hypervisor command line to assign devices to a specific PCI segment. +append `,pci_segment=` or `,pci_device_id=` to +the device flag in the Cloud Hypervisor command line to assign devices to a specific +PCI segment or into a specific device slot. ### virtio-block diff --git a/docs/vdpa.md b/docs/vdpa.md index c1aa34c57..1e171670a 100644 --- a/docs/vdpa.md +++ b/docs/vdpa.md @@ -32,11 +32,12 @@ struct VdpaConfig { iommu: bool, id: Option, pci_segment: u16, + pci_device_id: Option } ``` ``` ---vdpa vDPA device "path=,num_queues=,iommu=on|off,id=,pci_segment=" +--vdpa vDPA device "path=,num_queues=,iommu=on|off,id=,pci_segment=,pci_device_id=" ``` ### `path` @@ -96,6 +97,21 @@ _Example_ --vdpa path=/dev/vhost-vdpa-0,pci_segment=1 ``` +### `pci_device_id` + +PCI device ID to assign to the vDPA device on its PCI bus. + +This parameter is optional. If not specified, a device ID is automatically +allocated. + +Value is an unsigned integer in the range 1-31. + +_Example_ + +``` +--vdpa path=/dev/vhost-vdpa-0,pci_device_id=5 +``` + ## Example with vDPA block simulator The vDPA framework provides a simulator with both `virtio-block` and @@ -146,10 +162,10 @@ The `virtio-block` device backed by the vDPA simulator can be found as ``` cloud@cloud:~$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT -nullb0 252:0 0 250G 0 disk -vda 254:0 0 2.2G 0 disk +nullb0 252:0 0 250G 0 disk +vda 254:0 0 2.2G 0 disk ├─vda1 254:1 0 2.1G 0 part / -├─vda14 254:14 0 4M 0 part +├─vda14 254:14 0 4M 0 part └─vda15 254:15 0 106M 0 part /boot/efi vdb 254:16 0 128M 0 disk ```