diff mbox

[API-NEXT,1/3] api: queue: add odp_queue_info() function to retrieve queue information

Message ID 1447055757-8654-2-git-send-email-carl.wallen@nokia.com
State Accepted
Commit e9a90131ac28820d110297751654b8da93fb77f3
Headers show

Commit Message

Wallen, Carl (Nokia - FI/Espoo) Nov. 9, 2015, 7:55 a.m. UTC
Add odp_queue_info() along with odp_queue_info_t to retrieve queue name,
type and parameters.

Signed-off-by: Carl Wallen <carl.wallen@nokia.com>
---
 include/odp/api/queue.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

--
2.1.4
diff mbox

Patch

diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h
index df2a4c9..3ee69fc 100644
--- a/include/odp/api/queue.h
+++ b/include/odp/api/queue.h
@@ -280,6 +280,30 @@  uint64_t odp_queue_to_u64(odp_queue_t hdl);
 void odp_queue_param_init(odp_queue_param_t *param);

 /**
+ * Queue information
+ * Retrieve information about a queue with odp_queue_info()
+ */
+typedef struct odp_queue_info_t {
+	const char *name;         /**< queue name */
+	odp_queue_type_t type;    /**< queue type */
+	odp_queue_param_t param;  /**< queue parameters */
+} odp_queue_info_t;
+
+/**
+ * Retrieve information about a queue
+ *
+ * Invalid queue handles or handles to free/destroyed queues leads to
+ * undefined behaviour. Not intended for fast path use.
+ *
+ * @param      queue   Queue handle
+ * @param[out] info    Queue info pointer for output
+ *
+ * @retval 0 Success
+ * @retval <0 Failure.  Info could not be retrieved.
+ */
+int odp_queue_info(odp_queue_t queue, odp_queue_info_t *info);
+
+/**
  * @}
  */