vcl: add api to expose worker message queues epfd 91/17091/2
authorFlorin Coras <fcoras@cisco.com>
Fri, 25 Jan 2019 21:19:56 +0000 (13:19 -0800)
committerDave Barach <openvpp@barachs.net>
Sat, 26 Jan 2019 14:51:55 +0000 (14:51 +0000)
This only works if vcl is configured to do eventd based message queue
notifications, instead of condvars. For that, add "use-mq-eventfd" to
vcl startup conf.

Change-Id: Id0f0288a40ec7d3daef7370f8b88420425867ab6
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vcl/vppcom.c
src/vcl/vppcom.h

index d9012cd..317351d 100644 (file)
@@ -3594,6 +3594,15 @@ vppcom_worker_index (void)
   return vcl_get_worker_index ();
 }
 
+int
+vppcom_worker_mqs_epfd (void)
+{
+  vcl_worker_t *wrk = vcl_worker_get_current ();
+  if (!vcm->cfg.use_mq_eventfd)
+    return -1;
+  return wrk->mqs_epfd;
+}
+
 /*
  * fd.io coding-style-patch-verification: ON
  *
index 4db3d98..053abc9 100644 (file)
@@ -308,6 +308,14 @@ extern int vppcom_worker_register (void);
  */
 extern int vppcom_worker_index (void);
 
+/**
+ * Returns the current worker's message queues epoll fd
+ *
+ * This only works if vcl is configured to do eventfd based message queue
+ * notifications.
+ */
+extern int vppcom_worker_mqs_epfd (void);
+
 /* *INDENT-OFF* */
 #ifdef __cplusplus
 }