env_dpdk: add dpdk_pci_device interrupt functions
Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Ia707870591b1e82e25bb3294b176f47d7e46483f Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14547 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
parent
44caf7fdfb
commit
34ff0cb6aa
@ -68,6 +68,9 @@ int dpdk_pci_device_write_config(struct rte_pci_device *dev, void *value, uint32
|
|||||||
int dpdk_pci_driver_register(struct spdk_pci_driver *driver,
|
int dpdk_pci_driver_register(struct spdk_pci_driver *driver,
|
||||||
int (*probe_fn)(struct rte_pci_driver *driver, struct rte_pci_device *device),
|
int (*probe_fn)(struct rte_pci_driver *driver, struct rte_pci_device *device),
|
||||||
int (*remove_fn)(struct rte_pci_device *device));
|
int (*remove_fn)(struct rte_pci_device *device));
|
||||||
|
int dpdk_pci_device_enable_interrupt(struct rte_pci_device *rte_dev);
|
||||||
|
int dpdk_pci_device_disable_interrupt(struct rte_pci_device *rte_dev);
|
||||||
|
int dpdk_pci_device_get_interrupt_efd(struct rte_pci_device *rte_dev);
|
||||||
|
|
||||||
int pci_device_init(struct rte_pci_driver *driver, struct rte_pci_device *device);
|
int pci_device_init(struct rte_pci_driver *driver, struct rte_pci_device *device);
|
||||||
int pci_device_fini(struct rte_pci_device *device);
|
int pci_device_fini(struct rte_pci_device *device);
|
||||||
@ -747,34 +750,19 @@ spdk_pci_device_unmap_bar(struct spdk_pci_device *dev, uint32_t bar, void *addr)
|
|||||||
int
|
int
|
||||||
spdk_pci_device_enable_interrupt(struct spdk_pci_device *dev)
|
spdk_pci_device_enable_interrupt(struct spdk_pci_device *dev)
|
||||||
{
|
{
|
||||||
struct rte_pci_device *rte_dev = dev->dev_handle;
|
return dpdk_pci_device_enable_interrupt(dev->dev_handle);
|
||||||
#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0)
|
|
||||||
return rte_intr_enable(&rte_dev->intr_handle);
|
|
||||||
#else
|
|
||||||
return rte_intr_enable(rte_dev->intr_handle);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
spdk_pci_device_disable_interrupt(struct spdk_pci_device *dev)
|
spdk_pci_device_disable_interrupt(struct spdk_pci_device *dev)
|
||||||
{
|
{
|
||||||
struct rte_pci_device *rte_dev = dev->dev_handle;
|
return dpdk_pci_device_disable_interrupt(dev->dev_handle);
|
||||||
#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0)
|
|
||||||
return rte_intr_disable(&rte_dev->intr_handle);
|
|
||||||
#else
|
|
||||||
return rte_intr_disable(rte_dev->intr_handle);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
spdk_pci_device_get_interrupt_efd(struct spdk_pci_device *dev)
|
spdk_pci_device_get_interrupt_efd(struct spdk_pci_device *dev)
|
||||||
{
|
{
|
||||||
struct rte_pci_device *rte_dev = dev->dev_handle;
|
return dpdk_pci_device_get_interrupt_efd(dev->dev_handle);
|
||||||
#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0)
|
|
||||||
return rte_dev->intr_handle.fd;
|
|
||||||
#else
|
|
||||||
return rte_intr_fd_get(rte_dev->intr_handle);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
@ -1322,3 +1310,33 @@ dpdk_pci_driver_register(struct spdk_pci_driver *driver,
|
|||||||
rte_pci_register(driver->driver);
|
rte_pci_register(driver->driver);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
dpdk_pci_device_enable_interrupt(struct rte_pci_device *rte_dev)
|
||||||
|
{
|
||||||
|
#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0)
|
||||||
|
return rte_intr_enable(&rte_dev->intr_handle);
|
||||||
|
#else
|
||||||
|
return rte_intr_enable(rte_dev->intr_handle);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
dpdk_pci_device_disable_interrupt(struct rte_pci_device *rte_dev)
|
||||||
|
{
|
||||||
|
#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0)
|
||||||
|
return rte_intr_disable(&rte_dev->intr_handle);
|
||||||
|
#else
|
||||||
|
return rte_intr_disable(rte_dev->intr_handle);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
dpdk_pci_device_get_interrupt_efd(struct rte_pci_device *rte_dev)
|
||||||
|
{
|
||||||
|
#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0)
|
||||||
|
return rte_dev->intr_handle.fd;
|
||||||
|
#else
|
||||||
|
return rte_intr_fd_get(rte_dev->intr_handle);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user