From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============1065121010674433863==" MIME-Version: 1.0 From: oscar.huang at microchip.com Subject: [SPDK] Can I use spdk_pci_hook_device to implement a virtual NVMe device? Date: Fri, 24 Apr 2020 01:28:55 +0000 Message-ID: <20200424012855.2763.8615@ml01.vlan13.01.org> List-ID: To: spdk@lists.01.org --===============1065121010674433863== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable I'd like to create a virtual NVMe device and use SPDK NVMe APIs to operate = it. It looks like spdk_pci_hook_device() can add a virtual PCI device to SP= DK PCI system: void spdk_pci_hook_device(struct spdk_pci_driver *drv, struct spdk_pci_devi= ce *dev); But the struct spdk_pci_device only contains the following callbacks: int (*map_bar)(struct spdk_pci_device *dev, uint32_t bar, = void **mapped_addr, uint64_t *phys_addr, uint64_t *size); int (*unmap_bar)(struct spdk_pci_device *dev, uint32_t bar, = void *addr); int (*cfg_read)(struct spdk_pci_device *dev, void *value, uint32_t len, uint32_t offset); int (*cfg_write)(struct spdk_pci_device *dev, void *value, uint32_t len, uint32_t offset); void (*detach)(struct spdk_pci_device *dev); It does not have mmio callbacks. When applications write a device memory, s= ometimes it needs to trigger some actions on the device. Without mmio callb= acks, how to make a useful virtual device with spdk_pci_hook_device? Pls su= ggest. Much appreciated! --===============1065121010674433863==--