aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/acl/hash_lookup_private.h
diff options
context:
space:
mode:
authorAndrew Yourtchenko <ayourtch@gmail.com>2018-06-20 15:28:15 +0200
committerDamjan Marion <dmarion@me.com>2018-06-26 13:35:24 +0000
commit8d2e9bd8d80e7bcc703189f5796733be24c6d0a6 (patch)
tree64a0c1300994df719639e5415c9df2eab3193ba0 /src/plugins/acl/hash_lookup_private.h
parentd16ba6295b666a1b3d92c3b043ea1c008d2722c6 (diff)
acl-plugin: tm: optimize multi-lookups and prepare to add tuplemerge
- instantiate the per-use mask type entry for a given hash ACE this prepares to adding tuplemerge where the applied ACE may have a different mask type due to relaxing of the tuples - store the vector of the colliding rules for linear lookups rather than traversing the linked list. - store the lowest rule index for a given mask type inside the structure. This allows to skip looking up at the later mask types if we already matched an entry that is in front of the very first entry in the new candidate mask type, thus saving a worthless hash table lookup. - use a vector of mask type indices rather than bitmap, in the sorted order (by construction) of ascending lowest rule index - this allows to terminate the lookups early. - adapt the debug cli outputs accordingly to show the data - propagate the is_ip6 into the inner calls Change-Id: I7a67b271e66785c6eab738b632b432d5886a0a8a Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'src/plugins/acl/hash_lookup_private.h')
-rw-r--r--src/plugins/acl/hash_lookup_private.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/acl/hash_lookup_private.h b/src/plugins/acl/hash_lookup_private.h
index bc621416125..0db02ea031f 100644
--- a/src/plugins/acl/hash_lookup_private.h
+++ b/src/plugins/acl/hash_lookup_private.h
@@ -23,7 +23,7 @@
#define DBG_UNIX_LOG(...)
#elif ACL_HASH_LOOKUP_DEBUG == 2
#define DBG0(...) clib_warning(__VA_ARGS__)
-#define DBG(...) clib_warning(__VA_ARGS__)
+#define DBG(...) do { void *prevheap = clib_mem_set_heap (vlib_global_main.heap_base); vlib_cli_output(&vlib_global_main, __VA_ARGS__); clib_mem_set_heap (prevheap); } while (0)
#define DBG_UNIX_LOG(...) clib_unix_warning(__VA_ARGS__)
#else
#define DBG0(...)