From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 0FB372A5D for ; Fri, 17 Feb 2017 15:54:12 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Feb 2017 06:54:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,172,1484035200"; d="scan'208";a="1111097395" Received: from silpixa00398672.ir.intel.com ([10.237.223.128]) by fmsmga001.fm.intel.com with ESMTP; 17 Feb 2017 06:54:11 -0800 From: Harry van Haaren To: dev@dpdk.org Cc: jerin.jacob@caviumnetworks.com, Harry van Haaren Date: Fri, 17 Feb 2017 14:53:56 +0000 Message-Id: <1487343252-16092-2-git-send-email-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487343252-16092-1-git-send-email-harry.van.haaren@intel.com> References: <1485879273-86228-1-git-send-email-harry.van.haaren@intel.com> <1487343252-16092-1-git-send-email-harry.van.haaren@intel.com> Subject: [dpdk-dev] [PATCH v3 01/17] eventdev: fix API docs and test for timeout ticks X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 14:54:13 -0000 This commit improves the documentation of the api return values for rte_event_dequeue_timeout_ticks(), and allows -ENOTSUP to be returned by devices which do not support timeouts. The unit test is modified to accept -ENOTSUP as a pass, as the device doesn't implement the timeout_ticks function. Fixes: 4c9a26e419a7 ("app/test: unit test case for eventdev APIs") Signed-off-by: Harry van Haaren --- app/test/test_eventdev.c | 4 +++- lib/librte_eventdev/rte_eventdev.h | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c index 042a446..756bc32 100644 --- a/app/test/test_eventdev.c +++ b/app/test/test_eventdev.c @@ -519,7 +519,9 @@ test_eventdev_timeout_ticks(void) uint64_t timeout_ticks; ret = rte_event_dequeue_timeout_ticks(TEST_DEV_ID, 100, &timeout_ticks); - TEST_ASSERT_SUCCESS(ret, "Fail to get timeout_ticks"); + /* -ENOTSUP is a valid return if timeout is not supported by device */ + if (ret != -ENOTSUP) + TEST_ASSERT_SUCCESS(ret, "Fail to get timeout_ticks"); return TEST_SUCCESS; } diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h index b619160..b0c7f9c 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -1158,7 +1158,9 @@ rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, * * @return * - 0 on success. - * - <0 on failure. + * - -ENOTSUP if the device doesn't support timeouts. + * - -EINVAL if *dev_id* is invalid or *timeout_ticks* is a null pointer. + * - other values < 0 on failure. * * @see rte_event_dequeue_burst(), RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT * @see rte_event_dev_configure() @@ -1166,7 +1168,7 @@ rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, */ int rte_event_dequeue_timeout_ticks(uint8_t dev_id, uint64_t ns, - uint64_t *timeout_ticks); + uint64_t *timeout_ticks); /** * Dequeue a burst of events objects or an event object from the event port -- 2.7.4