session: reorganize session fields
[vpp.git] / src / vnet / session / application.c
index 03e1eae..f6fcc4f 100644 (file)
@@ -282,10 +282,9 @@ app_listener_cleanup (app_listener_t * al)
   app_listener_free (app, al);
 }
 
-app_worker_t *
-app_listener_select_worker (app_listener_t * al)
+static app_worker_t *
+app_listener_select_worker (application_t * app, app_listener_t * al)
 {
-  application_t *app;
   u32 wrk_index;
 
   app = application_get (al->app_index);
@@ -525,15 +524,17 @@ application_alloc_and_init (app_init_args_t * a)
     }
   else
     {
-      if (options[APP_OPTIONS_FLAGS] & APP_OPTIONS_FLAGS_EVT_MQ_USE_EVENTFD)
-       {
-         clib_warning ("mq eventfds can only be used if socket transport is "
-                       "used for api");
-         return VNET_API_ERROR_APP_UNSUPPORTED_CFG;
-       }
       seg_type = SSVM_SEGMENT_PRIVATE;
     }
 
+  if ((options[APP_OPTIONS_FLAGS] & APP_OPTIONS_FLAGS_EVT_MQ_USE_EVENTFD)
+      && seg_type != SSVM_SEGMENT_MEMFD)
+    {
+      clib_warning ("mq eventfds can only be used if socket transport is "
+                   "used for binary api");
+      return VNET_API_ERROR_APP_UNSUPPORTED_CFG;
+    }
+
   if (!application_verify_cfg (seg_type))
     return VNET_API_ERROR_APP_UNSUPPORTED_CFG;
 
@@ -694,10 +695,12 @@ application_n_workers (application_t * app)
 app_worker_t *
 application_listener_select_worker (session_t * ls)
 {
+  application_t *app;
   app_listener_t *al;
 
-  al = app_listener_get_w_session (ls);
-  return app_listener_select_worker (al);
+  app = application_get (ls->app_index);
+  al = app_listener_get (app, ls->al_index);
+  return app_listener_select_worker (app, al);
 }
 
 int
@@ -1120,8 +1123,7 @@ application_change_listener_owner (session_t * s, app_worker_t * app_wrk)
   hash_unset (old_wrk->listeners_table, listen_session_get_handle (s));
   if (session_transport_service_type (s) == TRANSPORT_SERVICE_CL
       && s->rx_fifo)
-    segment_manager_dealloc_fifos (s->rx_fifo->segment_index, s->rx_fifo,
-                                  s->tx_fifo);
+    segment_manager_dealloc_fifos (s->rx_fifo, s->tx_fifo);
 
   app = application_get (old_wrk->app_index);
   if (!app)