summaryrefslogtreecommitdiffstats
path: root/src/vlibmemory/api.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-01-10 08:17:03 -0800
committerDave Barach <openvpp@barachs.net>2018-01-11 22:06:14 +0000
commitaf0ff5af0cd471033169e63c6111d23cd801928c (patch)
tree26abdbe9637ec38416ea819bc8d0ad1e0a19dfe1 /src/vlibmemory/api.h
parentee7e1f50726490990b593b850857b3877c9a687f (diff)
api: fix handlers that explicitly depend on svm queue
Fixes the remainig apis that explicitly check svm queue length. Change-Id: I6055c7c50050affee3098e162e15fb12c205e5db Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vlibmemory/api.h')
-rw-r--r--src/vlibmemory/api.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vlibmemory/api.h b/src/vlibmemory/api.h
index 4f869a64be3..e86b88cdf9e 100644
--- a/src/vlibmemory/api.h
+++ b/src/vlibmemory/api.h
@@ -43,6 +43,15 @@ vl_api_send_msg (vl_api_registration_t * rp, u8 * elem)
}
}
+always_inline int
+vl_api_can_send_msg (vl_api_registration_t * rp)
+{
+ if (PREDICT_FALSE (rp->registration_type > REGISTRATION_TYPE_SHMEM))
+ return 1;
+ else
+ return vl_mem_api_can_send (rp->vl_input_queue);
+}
+
always_inline vl_api_registration_t *
vl_api_client_index_to_registration (u32 index)
{