summaryrefslogtreecommitdiffstats
path: root/src/svm/queue.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-08-02 10:45:44 -0700
committerDave Barach <openvpp@barachs.net>2018-08-10 20:26:24 +0000
commit993683150202254c6ba8dd43e087a7229edd5d4c (patch)
tree141ce2cdfe546bfe2ad46e66ac9569a33a895072 /src/svm/queue.h
parentf46663c65b0238311af93fcfa3030eefdb56e299 (diff)
vcl: support for eventfd mq signaling
- support eventfd based mq signaling. Based on configuration, vcl epoll/select can use either condvars or epoll on mq eventfds. - add vcl support for memfd segments - vpp explicitly registers cut-through segments with apps/vcl - if using eventfd, make ldp allow one call to libc_epoll_create. Needed for the message queue epfd - update svm_queue_t to allow blocking calls with eventfd signaling. Change-Id: I064151ac370bbe29bb16c968bf4e3659c8286bea Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/svm/queue.h')
-rw-r--r--src/svm/queue.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/svm/queue.h b/src/svm/queue.h
index 75e63a49319..3e8031e897b 100644
--- a/src/svm/queue.h
+++ b/src/svm/queue.h
@@ -82,6 +82,24 @@ int svm_queue_add_nolock (svm_queue_t * q, u8 * elem);
int svm_queue_sub_raw (svm_queue_t * q, u8 * elem);
/**
+ * Wait for queue event
+ *
+ * Must be called with mutex held.
+ */
+void svm_queue_wait (svm_queue_t * q);
+
+/**
+ * Timed wait for queue event
+ *
+ * Must be called with mutex held.
+ *
+ * @param q svm queue
+ * @param timeout time in seconds
+ * @return 0 on success, ETIMEDOUT on timeout or an error
+ */
+int svm_queue_timedwait (svm_queue_t * q, double timeout);
+
+/**
* Add element to queue with mutex held
* @param q queue
* @param elem pointer element data to add