eventdev: return code in dequeue timeout conversion
authorJerin Jacob <jerin.jacob@caviumnetworks.com>
Fri, 3 Mar 2017 17:27:43 +0000 (22:57 +0530)
committerJerin Jacob <jerin.jacob@caviumnetworks.com>
Tue, 4 Apr 2017 17:17:39 +0000 (19:17 +0200)
eventdev driver may return error on dequeue timeout tick conversion.
Change the pmd callback interface to address the same.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
drivers/event/skeleton/skeleton_eventdev.c
lib/librte_eventdev/rte_eventdev.c
lib/librte_eventdev/rte_eventdev_pmd.h

index 770dce3..8de0568 100644 (file)
@@ -319,7 +319,7 @@ skeleton_eventdev_port_unlink(struct rte_eventdev *dev, void *port,
 
 }
 
-static void
+static int
 skeleton_eventdev_timeout_ticks(struct rte_eventdev *dev, uint64_t ns,
                                 uint64_t *timeout_ticks)
 {
@@ -330,6 +330,8 @@ skeleton_eventdev_timeout_ticks(struct rte_eventdev *dev, uint64_t ns,
 
        RTE_SET_USED(skel);
        *timeout_ticks = ns * scale;
+
+       return 0;
 }
 
 static void
index 89f98cd..5d8614a 100644 (file)
@@ -909,8 +909,7 @@ rte_event_dequeue_timeout_ticks(uint8_t dev_id, uint64_t ns,
        if (timeout_ticks == NULL)
                return -EINVAL;
 
-       (*dev->dev_ops->timeout_ticks)(dev, ns, timeout_ticks);
-       return 0;
+       return (*dev->dev_ops->timeout_ticks)(dev, ns, timeout_ticks);
 }
 
 int
index 828dfce..45ac8ea 100644 (file)
@@ -406,8 +406,11 @@ typedef int (*eventdev_port_unlink_t)(struct rte_eventdev *dev, void *port,
  * @param[out] timeout_ticks
  *   Value for the *timeout_ticks* parameter in rte_event_dequeue() function
  *
+ * @return
+ *   Returns 0 on success.
+ *
  */
-typedef void (*eventdev_dequeue_timeout_ticks_t)(struct rte_eventdev *dev,
+typedef int (*eventdev_dequeue_timeout_ticks_t)(struct rte_eventdev *dev,
                uint64_t ns, uint64_t *timeout_ticks);
 
 /**