From 836a9ddc3f8b2cdb1c6aedae9a6356abdba83437 Mon Sep 17 00:00:00 2001 From: Jerin Jacob Date: Fri, 3 Mar 2017 22:57:43 +0530 Subject: [PATCH] eventdev: return code in dequeue timeout conversion eventdev driver may return error on dequeue timeout tick conversion. Change the pmd callback interface to address the same. Signed-off-by: Jerin Jacob Acked-by: Harry van Haaren --- drivers/event/skeleton/skeleton_eventdev.c | 4 +++- lib/librte_eventdev/rte_eventdev.c | 3 +-- lib/librte_eventdev/rte_eventdev_pmd.h | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c index 770dce3dad..8de05688f7 100644 --- a/drivers/event/skeleton/skeleton_eventdev.c +++ b/drivers/event/skeleton/skeleton_eventdev.c @@ -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 diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index 89f98cd3fd..5d8614ad05 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -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 diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h index 828dfce01a..45ac8ea411 100644 --- a/lib/librte_eventdev/rte_eventdev_pmd.h +++ b/lib/librte_eventdev/rte_eventdev_pmd.h @@ -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); /** -- 2.20.1