aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vapi/vapi.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2022-01-24 21:37:09 +0000
committerOle Tr�an <otroan@employees.org>2022-01-25 14:35:02 +0000
commit5f0106a76fbc3792781a81dedb5a7e41813430d3 (patch)
tree77191a0d46c5dfc575e923f4ca77f1d7d519ae00 /src/vpp-api/vapi/vapi.c
parent8d4db8bfb4b0d2ecd8bef37fa0650b779f03f1ef (diff)
api: vapi: honor non-blocking setting
Pass correct conditional based on how vapi is configured wrt blocking. Type: fix Fixes: 3fca567ff438145e28dd1318ad5b1734c1091257 Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I47adca19f104d7a758cb2940e93c9fd8c7cc9bfa
Diffstat (limited to 'src/vpp-api/vapi/vapi.c')
-rw-r--r--src/vpp-api/vapi/vapi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vpp-api/vapi/vapi.c b/src/vpp-api/vapi/vapi.c
index fbe04c187f3..ca46f8d3b84 100644
--- a/src/vpp-api/vapi/vapi.c
+++ b/src/vpp-api/vapi/vapi.c
@@ -766,7 +766,9 @@ vapi_dispatch_one (vapi_ctx_t ctx)
VAPI_DBG ("vapi_dispatch_one()");
void *msg;
uword size;
- vapi_error_e rv = vapi_recv (ctx, &msg, &size, SVM_Q_WAIT, 0);
+ svm_q_conditional_wait_t cond =
+ vapi_is_nonblocking (ctx) ? SVM_Q_NOWAIT : SVM_Q_WAIT;
+ vapi_error_e rv = vapi_recv (ctx, &msg, &size, cond, 0);
if (VAPI_OK != rv)
{
VAPI_DBG ("vapi_recv failed with rv=%d", rv);