The primary motivation for this patch is to allow the VMD driver to be notified of when users wants to attach a device under a given BDF and to make it more similar to the regular PCI path. Currently, the way the VMD driver scans for the devices is a little bit different. The initial scan is done during initialization and there's a separate poller for checking hotplugs. Also, there's no device_attach() interface, so with hotplug poller disabled, it isn't possible to attach to a device not present in the initial scan, even if the BDF is known. This causes a few issues. First of all, the VMD library isn't notified when a device is stopped being used (i.e. user calls spdk_pci_device_detach()), so when such a device is hotremoved, it never gets unhooked. But we cannot simply add a spdk_pci_device.detach() callback, as this would break cases when user detaches a device (without hotremove) and then tries to reattach it again (via spdk_pci_device_attach()), as the VMD doesn't get notified about the device_attach() call. So, in order to resolve this, a device_attach() callback is added, which will notify the VMD library that the user wants to attach a device under a specific PCI address. Then, in subsequent patches, a spdk_pci_device_provider.detach_cb() callback is added to make sure that devices are unhooked once they're no longer used. Once that is done, it'll be also possible to get rid of the VMD hotplug poller by adding something like scan_cb() to spdk_pci_device_provider and call it from spdk_pci_enumerate(). Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: I084a27dcd12455f0f841440b7692375e80d07e84 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13883 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tom Nabarro <tom.nabarro@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
124 lines
2.9 KiB
Plaintext
124 lines
2.9 KiB
Plaintext
{
|
|
global:
|
|
|
|
# Public functions in env.h
|
|
spdk_malloc;
|
|
spdk_zmalloc;
|
|
spdk_realloc;
|
|
spdk_free;
|
|
spdk_env_opts_init;
|
|
spdk_env_init;
|
|
spdk_env_fini;
|
|
spdk_dma_malloc;
|
|
spdk_dma_malloc_socket;
|
|
spdk_dma_zmalloc;
|
|
spdk_dma_zmalloc_socket;
|
|
spdk_dma_realloc;
|
|
spdk_dma_free;
|
|
spdk_memzone_reserve;
|
|
spdk_memzone_reserve_aligned;
|
|
spdk_memzone_lookup;
|
|
spdk_memzone_free;
|
|
spdk_memzone_dump;
|
|
spdk_mempool_create;
|
|
spdk_mempool_create_ctor;
|
|
spdk_mempool_get_name;
|
|
spdk_mempool_free;
|
|
spdk_mempool_get;
|
|
spdk_mempool_get_bulk;
|
|
spdk_mempool_put;
|
|
spdk_mempool_put_bulk;
|
|
spdk_mempool_count;
|
|
spdk_mempool_obj_iter;
|
|
spdk_mempool_lookup;
|
|
spdk_env_get_core_count;
|
|
spdk_env_get_current_core;
|
|
spdk_env_get_first_core;
|
|
spdk_env_get_last_core;
|
|
spdk_env_get_next_core;
|
|
spdk_env_get_socket_id;
|
|
spdk_env_thread_launch_pinned;
|
|
spdk_env_thread_wait_all;
|
|
spdk_process_is_primary;
|
|
spdk_get_ticks;
|
|
spdk_get_ticks_hz;
|
|
spdk_delay_us;
|
|
spdk_pause;
|
|
spdk_ring_create;
|
|
spdk_ring_free;
|
|
spdk_ring_count;
|
|
spdk_ring_enqueue;
|
|
spdk_ring_dequeue;
|
|
spdk_iommu_is_enabled;
|
|
spdk_vtophys;
|
|
spdk_pci_get_driver;
|
|
spdk_pci_driver_register;
|
|
spdk_pci_nvme_get_driver;
|
|
spdk_pci_vmd_get_driver;
|
|
spdk_pci_idxd_get_driver;
|
|
spdk_pci_ioat_get_driver;
|
|
spdk_pci_virtio_get_driver;
|
|
spdk_pci_enumerate;
|
|
spdk_pci_for_each_device;
|
|
spdk_pci_device_map_bar;
|
|
spdk_pci_device_unmap_bar;
|
|
spdk_pci_device_enable_interrupt;
|
|
spdk_pci_device_disable_interrupt;
|
|
spdk_pci_device_get_interrupt_efd;
|
|
spdk_pci_device_get_domain;
|
|
spdk_pci_device_get_bus;
|
|
spdk_pci_device_get_dev;
|
|
spdk_pci_device_get_func;
|
|
spdk_pci_device_get_addr;
|
|
spdk_pci_device_get_vendor_id;
|
|
spdk_pci_device_get_device_id;
|
|
spdk_pci_device_get_subvendor_id;
|
|
spdk_pci_device_get_subdevice_id;
|
|
spdk_pci_device_get_id;
|
|
spdk_pci_device_get_socket_id;
|
|
spdk_pci_device_get_serial_number;
|
|
spdk_pci_device_claim;
|
|
spdk_pci_device_unclaim;
|
|
spdk_pci_device_detach;
|
|
spdk_pci_device_attach;
|
|
spdk_pci_device_allow;
|
|
spdk_pci_device_cfg_read;
|
|
spdk_pci_device_cfg_write;
|
|
spdk_pci_device_cfg_read8;
|
|
spdk_pci_device_cfg_write8;
|
|
spdk_pci_device_cfg_read16;
|
|
spdk_pci_device_cfg_write16;
|
|
spdk_pci_device_cfg_read32;
|
|
spdk_pci_device_cfg_write32;
|
|
spdk_pci_device_is_removed;
|
|
spdk_pci_addr_compare;
|
|
spdk_pci_addr_parse;
|
|
spdk_pci_addr_fmt;
|
|
spdk_pci_hook_device;
|
|
spdk_pci_unhook_device;
|
|
spdk_pci_device_get_type;
|
|
spdk_pci_register_device_provider;
|
|
spdk_unaffinitize_thread;
|
|
spdk_call_unaffinitized;
|
|
spdk_mem_map_alloc;
|
|
spdk_mem_map_free;
|
|
spdk_mem_map_set_translation;
|
|
spdk_mem_map_clear_translation;
|
|
spdk_mem_map_translate;
|
|
spdk_mem_register;
|
|
spdk_mem_unregister;
|
|
spdk_mem_get_fd_and_offset;
|
|
spdk_pci_event_listen;
|
|
spdk_pci_get_event;
|
|
spdk_pci_register_error_handler;
|
|
spdk_pci_unregister_error_handler;
|
|
|
|
# Public functions in env_dpdk.h
|
|
spdk_env_dpdk_post_init;
|
|
spdk_env_dpdk_post_fini;
|
|
spdk_env_dpdk_external_init;
|
|
spdk_env_dpdk_dump_mem_stats;
|
|
|
|
local: *;
|
|
};
|