lib/env: Added parent field to spdk_pci_device
VMD introduce parent/child relationship between pci devices. Parent filed allow to associate NVMe disk with VMD device. Change-Id: Ie363dbe83fefbe05e3347888dc6bd361a235da4a Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459637 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
7bfbc388d7
commit
fe73e3072c
@ -658,6 +658,7 @@ struct spdk_pci_id {
|
||||
};
|
||||
|
||||
struct spdk_pci_device {
|
||||
struct spdk_pci_device *parent;
|
||||
void *dev_handle;
|
||||
struct spdk_pci_addr addr;
|
||||
struct spdk_pci_id id;
|
||||
|
@ -669,6 +669,7 @@ vmd_dev_init(struct vmd_pci_device *dev)
|
||||
if (vmd_is_supported_device(dev)) {
|
||||
spdk_pci_addr_fmt(bdf, sizeof(bdf), &dev->pci.addr);
|
||||
SPDK_DEBUGLOG(SPDK_LOG_VMD, "Initalizing NVMe device at %s\n", bdf);
|
||||
dev->pci.parent = &dev->bus->vmd->pci;
|
||||
spdk_pci_hook_device(spdk_pci_nvme_get_driver(), &dev->pci);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user