ipsec: Performance improvement of ipsec4_output_node using flow cache
[vpp.git] / src / svm / message_queue.h
index 1ef773d..bd76eda 100644 (file)
@@ -125,6 +125,11 @@ uword svm_msg_q_size_to_alloc (svm_msg_q_cfg_t *cfg);
 
 void svm_msg_q_attach (svm_msg_q_t *mq, void *smq_base);
 
+/**
+ * Cleanup mq's private data
+ */
+void svm_msg_q_cleanup (svm_msg_q_t *mq);
+
 /**
  * Free message queue
  *
@@ -399,11 +404,19 @@ svm_msg_q_unlock (svm_msg_q_t * mq)
 /**
  * Wait for message queue event
  *
- * Must be called with mutex held. The queue only works non-blocking
- * with eventfds, so handle blocking calls as an exception here.
+ * When eventfds are not configured, the shared memory mutex is locked
+ * before waiting on the condvar. Typically called by consumers.
  */
 int svm_msg_q_wait (svm_msg_q_t *mq, svm_msg_q_wait_type_t type);
 
+/**
+ * Wait for message queue event as producer
+ *
+ * Similar to @ref svm_msg_q_wait but lock (mutex or spinlock) must
+ * be held. Should only be called by producers.
+ */
+int svm_msg_q_wait_prod (svm_msg_q_t *mq);
+
 /**
  * Timed wait for message queue event
  *