summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vapi/vapi.h
diff options
context:
space:
mode:
authorMatthew Smith <mgsmith@netgate.com>2022-12-02 20:46:16 +0000
committerMatthew Smith <mgsmith@netgate.com>2022-12-14 14:07:11 +0000
commit4b9935cd54e5ca31c192cb9113e3056016f0b728 (patch)
tree2f90a20d1aceb4a85a7b1a7eb610c2c53293fa80 /src/vpp-api/vapi/vapi.h
parent051579d0f2bf5a408ed8439cfd28831e846389ab (diff)
vapi: implement vapi_wait() for reads
Type: improvement The function vapi_wait() is intended to allow a caller to block while waiting until the API queue can be read/written. It was a stub that returned VAPI_ENOTSUP. Add code which implements the wait on being able to read an incoming message. Had to touch a few other things in vapi.h to make checkstyle.sh happy after changing the prototype of vapi_wait(). Signed-off-by: Matthew Smith <mgsmith@netgate.com> Change-Id: Ida80c1a1d34fe297ab23268087be65ea53ad7040
Diffstat (limited to 'src/vpp-api/vapi/vapi.h')
-rw-r--r--src/vpp-api/vapi/vapi.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/vpp-api/vapi/vapi.h b/src/vpp-api/vapi/vapi.h
index 46666293e4b..f4e060b0180 100644
--- a/src/vpp-api/vapi/vapi.h
+++ b/src/vpp-api/vapi/vapi.h
@@ -175,7 +175,7 @@ vapi_error_e vapi_send (vapi_ctx_t ctx, void *msg);
*
* @return VAPI_OK on success, other error code on error
*/
- vapi_error_e vapi_send2 (vapi_ctx_t ctx, void *msg1, void *msg2);
+vapi_error_e vapi_send2 (vapi_ctx_t ctx, void *msg1, void *msg2);
/**
* @brief low-level api for reading messages from vpp
@@ -191,18 +191,17 @@ vapi_error_e vapi_send (vapi_ctx_t ctx, void *msg);
*
* @return VAPI_OK on success, other error code on error
*/
- vapi_error_e vapi_recv (vapi_ctx_t ctx, void **msg, size_t * msg_size,
- svm_q_conditional_wait_t cond, u32 time);
+vapi_error_e vapi_recv (vapi_ctx_t ctx, void **msg, size_t *msg_size,
+ svm_q_conditional_wait_t cond, u32 time);
/**
- * @brief wait for connection to become readable or writable
+ * @brief wait for connection to become readable
*
* @param ctx opaque vapi context
- * @param mode type of property to wait for - readability, writability or both
*
* @return VAPI_OK on success, other error code on error
*/
- vapi_error_e vapi_wait (vapi_ctx_t ctx, vapi_wait_mode_e mode);
+vapi_error_e vapi_wait (vapi_ctx_t ctx);
/**
* @brief pick next message sent by vpp and call the appropriate callback