diff options
author | Andrew Yourtchenko <ayourtch@gmail.com> | 2018-03-26 18:19:20 +0200 |
---|---|---|
committer | Chris Luke <chris_luke@comcast.com> | 2018-03-27 17:43:37 +0000 |
commit | 82f2e6e50dfedd495f8788f85b0f366f79ae8e1a (patch) | |
tree | c63587ec7cd2fc94ea9e2fddc6679b0182efaf9d /src/plugins/acl/hash_lookup.c | |
parent | f756401ddda1349e024dbf631d5774efb9e7f55a (diff) |
acl-plugin: autosize the ACL plugin heap and fix the heap size types and parsing
- autosize the ACL plugin heap size based on the number of workers
- for manual heap size setting, use the proper types (uword),
and proper format/unformat functions (unformat_memory_size)
Change-Id: I7c46134e949862a0abc9087d7232402fc5a95ad8
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 | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/acl/hash_lookup.c b/src/plugins/acl/hash_lookup.c index ad55054c3e3..f706bad634c 100644 --- a/src/plugins/acl/hash_lookup.c +++ b/src/plugins/acl/hash_lookup.c @@ -154,6 +154,9 @@ hash_acl_set_heap(acl_main_t *am) { if (0 == am->hash_lookup_mheap) { am->hash_lookup_mheap = mheap_alloc (0 /* use VM */ , am->hash_lookup_mheap_size); + if (0 == am->hash_lookup_mheap) { + clib_error("ACL plugin failed to allocate hash lookup heap of %U bytes, abort", format_memory_size, am->hash_lookup_mheap_size); + } mheap_t *h = mheap_header (am->hash_lookup_mheap); h->flags |= MHEAP_FLAG_THREAD_SAFE; } |