Commit 34ff0cb6 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

env_dpdk: add dpdk_pci_device interrupt functions



Signed-off-by: default avatarJim 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: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent 44caf7fd
Loading
Loading
Loading
Loading
+36 −18
Original line number Diff line number Diff line
@@ -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 (*probe_fn)(struct rte_pci_driver *driver, 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_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
spdk_pci_device_enable_interrupt(struct spdk_pci_device *dev)
{
	struct rte_pci_device *rte_dev = 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
	return dpdk_pci_device_enable_interrupt(dev->dev_handle);
}

int
spdk_pci_device_disable_interrupt(struct spdk_pci_device *dev)
{
	struct rte_pci_device *rte_dev = 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
	return dpdk_pci_device_disable_interrupt(dev->dev_handle);
}

int
spdk_pci_device_get_interrupt_efd(struct spdk_pci_device *dev)
{
	struct rte_pci_device *rte_dev = 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
	return dpdk_pci_device_get_interrupt_efd(dev->dev_handle);
}

uint32_t
@@ -1322,3 +1310,33 @@ dpdk_pci_driver_register(struct spdk_pci_driver *driver,
	rte_pci_register(driver->driver);
	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
}