acl: perform the ACL-as-a-service user registrations in global heap
[vpp.git] / src / plugins / acl / acl.c
index 396fe1f..9ebb349 100644 (file)
@@ -92,7 +92,7 @@ _(ACL_PLUGIN_GET_CONN_TABLE_MAX_ENTRIES,acl_plugin_get_conn_table_max_entries)
 /* *INDENT-OFF* */
 VLIB_PLUGIN_REGISTER () = {
     .version = VPP_BUILD_VER,
-    .description = "Access Control Lists",
+    .description = "Access Control Lists (ACL)",
 };
 /* *INDENT-ON* */
 
@@ -305,13 +305,11 @@ static void
   acl_main_t *am = &acl_main;
   vl_api_acl_plugin_get_conn_table_max_entries_reply_t *rmp;
   int msg_size = sizeof (*rmp);
-  unix_shared_memory_queue_t *q;
+  vl_api_registration_t *rp;
 
-  q = vl_api_client_index_to_input_queue (mp->client_index);
-  if (q == 0)
-    {
-      return;
-    }
+  rp = vl_api_client_index_to_registration (mp->client_index);
+  if (rp == 0)
+    return;
 
   rmp = vl_msg_api_alloc (msg_size);
   memset (rmp, 0, msg_size);
@@ -321,7 +319,7 @@ static void
   rmp->context = mp->context;
   rmp->conn_table_max_entries = __bswap_64 (am->fa_conn_table_max_entries);
 
-  vl_msg_api_send_shmem (q, (u8 *) & rmp);
+  vl_api_send_msg (rp, (u8 *) rmp);
 }
 
 static void
@@ -791,10 +789,6 @@ acl_interface_set_inout_acl_list (acl_main_t * am, u32 sw_if_index,
       u32 lc_index = (*pinout_lc_index_by_sw_if_index)[sw_if_index];
       if (~0 == lc_index)
        {
-         if (~0 == am->interface_acl_user_id)
-           am->interface_acl_user_id =
-             acl_plugin.register_user_module ("interface ACL", "sw_if_index",
-                                              "is_input");
          lc_index =
            acl_plugin.get_lookup_context_index (am->interface_acl_user_id,
                                                 sw_if_index, is_input);
@@ -3661,7 +3655,9 @@ acl_init (vlib_main_t * vm)
   /* Set the default threshold */
   am->tuple_merge_split_threshold = TM_SPLIT_THRESHOLD;
 
-  am->interface_acl_user_id = ~0;      /* defer till the first use */
+  am->interface_acl_user_id =
+    acl_plugin.register_user_module ("interface ACL", "sw_if_index",
+                                    "is_input");
 
   return error;
 }