From: Nipun Gupta Date: Fri, 3 Mar 2017 15:33:02 +0000 (+0530) Subject: eventdev: use generic device holder X-Git-Tag: spdx-start~3860 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c16321995049fbb6a7cab1f9870e212a2756a77d;p=dpdk.git eventdev: use generic device holder rte_device is a generic device which is available to the applications and EAL. This patch replaces rte_pci_device in 'struct rte_eventdev' and in 'struct rte_event_dev_info' with common rte_device. Signed-off-by: Nipun Gupta Acked-by: Shreyansh Jain --- diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c index dee0faf2fa..770dce3dad 100644 --- a/drivers/event/skeleton/skeleton_eventdev.c +++ b/drivers/event/skeleton/skeleton_eventdev.c @@ -383,7 +383,7 @@ skeleton_eventdev_init(struct rte_eventdev *eventdev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; - pci_dev = eventdev->pci_dev; + pci_dev = RTE_DEV_TO_PCI(eventdev->dev); skel->reg_base = (uintptr_t)pci_dev->mem_resource[0].addr; if (!skel->reg_base) { diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index 68bfc3b65d..b8be5dac90 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -125,7 +125,7 @@ rte_event_dev_info_get(uint8_t dev_id, struct rte_event_dev_info *dev_info) dev_info->dequeue_timeout_ns = dev->data->dev_conf.dequeue_timeout_ns; - dev_info->pci_dev = dev->pci_dev; + dev_info->dev = dev->dev; if (dev->driver) dev_info->driver_name = dev->driver->pci_drv.driver.name; return 0; @@ -1196,7 +1196,7 @@ rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv, "device data"); } - eventdev->pci_dev = pci_dev; + eventdev->dev = &pci_dev->device; eventdev->driver = eventdrv; /* Invoke PMD device initialization function */ @@ -1250,7 +1250,7 @@ rte_event_pmd_pci_remove(struct rte_pci_device *pci_dev) /* Free event device */ rte_event_pmd_release(eventdev); - eventdev->pci_dev = NULL; + eventdev->dev = NULL; eventdev->driver = NULL; return 0; diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h index 4c879220c7..2b30a357db 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -330,7 +330,7 @@ rte_event_dev_socket_id(uint8_t dev_id); */ struct rte_event_dev_info { const char *driver_name; /**< Event driver name */ - struct rte_pci_device *pci_dev; /**< PCI information */ + struct rte_device *dev; /**< Device information */ uint32_t min_dequeue_timeout_ns; /**< Minimum supported global dequeue timeout(ns) by this device */ uint32_t max_dequeue_timeout_ns; @@ -1059,8 +1059,8 @@ struct rte_eventdev { /**< Pointer to device data */ const struct rte_eventdev_ops *dev_ops; /**< Functions exported by PMD */ - struct rte_pci_device *pci_dev; - /**< PCI info. supplied by probing */ + struct rte_device *dev; + /**< Device info. supplied by probing */ const struct rte_eventdev_driver *driver; /**< Driver for this device */