[dpdk-dev] [PATCH 11/14] lib/ether: extract function rte_device_get_intr_handle
Jan Viktorin
viktorin at rehivetech.com
Mon Jan 4 21:08:23 CET 2016
Signed-off-by: Jan Viktorin <viktorin at rehivetech.com>
---
lib/librte_ether/rte_ethdev.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index a9007e7..b17aa11 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -2606,6 +2606,17 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
rte_spinlock_unlock(&rte_eth_dev_cb_lock);
}
+static struct rte_intr_handle *
+rte_device_get_intr_handle(union rte_device *dev)
+{
+ switch (dev->magic) {
+ case RTE_PCI_DEVICE_MAGIC:
+ return &dev->pci.intr_handle;
+ default:
+ return NULL;
+ }
+}
+
int
rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data)
{
@@ -2621,7 +2632,7 @@ rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data)
}
dev = &rte_eth_devices[port_id];
- intr_handle = &dev->pci_dev->intr_handle;
+ intr_handle = rte_device_get_intr_handle(dev->dev);
if (!intr_handle->intr_vec) {
RTE_PMD_DEBUG_TRACE("RX Intr vector unset\n");
return -EPERM;
@@ -2684,7 +2695,7 @@ rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id,
return -EINVAL;
}
- intr_handle = &dev->pci_dev->intr_handle;
+ intr_handle = rte_device_get_intr_handle(dev->dev);
if (!intr_handle->intr_vec) {
RTE_PMD_DEBUG_TRACE("RX Intr vector unset\n");
return -EPERM;
--
2.6.3
More information about the dev
mailing list