eventdev: update event port link and unlink callbacks
authorNipun Gupta <nipun.gupta@nxp.com>
Mon, 6 Feb 2017 19:04:37 +0000 (00:34 +0530)
committerJerin Jacob <jerin.jacob@caviumnetworks.com>
Tue, 4 Apr 2017 17:12:00 +0000 (19:12 +0200)
Added a pointer to the rte_eventdev type in the event port
link and unlink callbacks. This device shall be used by some
of the event drivers to fetch queue related information.

Also, update the skeleton eventdev driver with corresponding changes.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
drivers/event/skeleton/skeleton_eventdev.c
lib/librte_eventdev/rte_eventdev.c
lib/librte_eventdev/rte_eventdev_pmd.h

index 085cb86..9330d74 100644 (file)
@@ -287,13 +287,14 @@ skeleton_eventdev_port_setup(struct rte_eventdev *dev, uint8_t port_id,
 }
 
 static int
-skeleton_eventdev_port_link(void *port,
+skeleton_eventdev_port_link(struct rte_eventdev *dev, void *port,
                        const uint8_t queues[], const uint8_t priorities[],
                        uint16_t nb_links)
 {
        struct skeleton_port *sp = port;
        PMD_DRV_FUNC_TRACE();
 
+       RTE_SET_USED(dev);
        RTE_SET_USED(sp);
        RTE_SET_USED(queues);
        RTE_SET_USED(priorities);
@@ -303,12 +304,13 @@ skeleton_eventdev_port_link(void *port,
 }
 
 static int
-skeleton_eventdev_port_unlink(void *port, uint8_t queues[],
-                                uint16_t nb_unlinks)
+skeleton_eventdev_port_unlink(struct rte_eventdev *dev, void *port,
+                                uint8_t queues[], uint16_t nb_unlinks)
 {
        struct skeleton_port *sp = port;
        PMD_DRV_FUNC_TRACE();
 
+       RTE_SET_USED(dev);
        RTE_SET_USED(sp);
        RTE_SET_USED(queues);
 
index c8f3e94..c7452f0 100644 (file)
@@ -801,8 +801,8 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,
                if (queues[i] >= RTE_EVENT_MAX_QUEUES_PER_DEV)
                        return -EINVAL;
 
-       diag = (*dev->dev_ops->port_link)(dev->data->ports[port_id], queues,
-                                               priorities, nb_links);
+       diag = (*dev->dev_ops->port_link)(dev, dev->data->ports[port_id],
+                                               queues, priorities, nb_links);
        if (diag < 0)
                return diag;
 
@@ -846,8 +846,8 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
                if (queues[i] >= RTE_EVENT_MAX_QUEUES_PER_DEV)
                        return -EINVAL;
 
-       diag = (*dev->dev_ops->port_unlink)(dev->data->ports[port_id], queues,
-                                       nb_unlinks);
+       diag = (*dev->dev_ops->port_unlink)(dev, dev->data->ports[port_id],
+                                       queues, nb_unlinks);
 
        if (diag < 0)
                return diag;
index c84c9a2..2e3e5d3 100644 (file)
@@ -357,6 +357,8 @@ typedef void (*eventdev_port_release_t)(void *port);
 /**
  * Link multiple source event queues to destination event port.
  *
+ * @param dev
+ *   Event device pointer
  * @param port
  *   Event port pointer
  * @param link
@@ -372,13 +374,15 @@ typedef void (*eventdev_port_release_t)(void *port);
  *   Returns 0 on success.
  *
  */
-typedef int (*eventdev_port_link_t)(void *port,
+typedef int (*eventdev_port_link_t)(struct rte_eventdev *dev, void *port,
                const uint8_t queues[], const uint8_t priorities[],
                uint16_t nb_links);
 
 /**
  * Unlink multiple source event queues from destination event port.
  *
+ * @param dev
+ *   Event device pointer
  * @param port
  *   Event port pointer
  * @param queues
@@ -390,7 +394,7 @@ typedef int (*eventdev_port_link_t)(void *port,
  *   Returns 0 on success.
  *
  */
-typedef int (*eventdev_port_unlink_t)(void *port,
+typedef int (*eventdev_port_unlink_t)(struct rte_eventdev *dev, void *port,
                uint8_t queues[], uint16_t nb_unlinks);
 
 /**