diff options
author | Andrew Yourtchenko <ayourtch@gmail.com> | 2017-09-11 17:22:03 +0200 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2017-09-12 09:20:04 +0000 |
commit | cada5a92faaf1dd2887df5ca200195011d2a0b8d (patch) | |
tree | 4a6be48083c2084cfce6ba00bcc00da5c6046781 /src/plugins/acl/hash_lookup.c | |
parent | e8efd7d16fb3b6e7da752657220f3ed9807d4118 (diff) |
acl-plugin: add startup-config section "acl-plugin" and heap/hash parameters
This adds the ability to tweak the memory allocation parameters of the ACL plugin
from the startup config. It may be useful in the cases involving higher limit
of the connections than the default 1M, or the high number of cores.
Change-Id: I2b6fb3f61126ff3ee998424b762b6aefe8fb1b8e
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'src/plugins/acl/hash_lookup.c')
-rw-r--r-- | src/plugins/acl/hash_lookup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/acl/hash_lookup.c b/src/plugins/acl/hash_lookup.c index 13bc6b4643f..7869027b301 100644 --- a/src/plugins/acl/hash_lookup.c +++ b/src/plugins/acl/hash_lookup.c @@ -264,7 +264,7 @@ static void * hash_acl_set_heap(acl_main_t *am) { if (0 == am->hash_lookup_mheap) { - am->hash_lookup_mheap = mheap_alloc (0 /* use VM */ , 2 << 25); + am->hash_lookup_mheap = mheap_alloc (0 /* use VM */ , am->hash_lookup_mheap_size); mheap_t *h = mheap_header (am->hash_lookup_mheap); h->flags |= MHEAP_FLAG_THREAD_SAFE; } @@ -307,7 +307,7 @@ hash_acl_apply(acl_main_t *am, u32 sw_if_index, u8 is_input, int acl_index) DBG0("HASH ACL apply: sw_if_index %d is_input %d acl %d", sw_if_index, is_input, acl_index); if (!am->acl_lookup_hash_initialized) { BV (clib_bihash_init) (&am->acl_lookup_hash, "ACL plugin rule lookup bihash", - 65536, 2 << 25); + am->hash_lookup_hash_buckets, am->hash_lookup_hash_memory); am->acl_lookup_hash_initialized = 1; } |