acl-plugin: rework the optimization 7383, fortify acl-plugin memory behavior (VPP... 17/7817/26
authorAndrew Yourtchenko <ayourtch@gmail.com>
Thu, 27 Jul 2017 13:39:50 +0000 (15:39 +0200)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Tue, 8 Aug 2017 08:42:19 +0000 (10:42 +0200)
commitbd9c5ffe39e9ce61db95d74d150e07d738f24da1
tree6ca1ef9bee832909f43b5cc28df9b8c46b910efe
parent8e4222fc7e23a478b021930ade3cb7d20938e398
acl-plugin: rework the optimization 7383, fortify acl-plugin memory behavior (VPP-910)

The further prolonged testing from testbed that reported VPP-910
has uncovered a couple of deeper issues with optimization from
7384, and the usage of subscripts rather than vec_elt_at_index()
allowed to hide a couple of further errors in the code.
Also, the current acl-plugin behavior of using the global
heap for its dynamic data is problematic - it makes
the troubleshooting much harder by potentially spreading
the problem around.

Based on this experience, this commits makes a few changes to fix
the issues seen, also improving the serviceability of the acl-plugin
code for the future:

- Use separate mheaps for any ACL-related control plane
operations and separate for the hash lookup datastructures,
to compartmentalize any memory-related issues for the ACL plugin.

- Ensure vec_elt_at_index() usage throughout the hash_lookup.c file.

- Use vectors rather than raw memory for storing the "ordinary" ACL rules.

- Rework the optimization from 7384 to use a separate tail pointer
rather than overloading the "prev" field.

- Make get_session_ptr() more conservative and adjust is_valid_session_ptr
accordingly

Change-Id: Ifda85193f361de5ed3782a4acd39622bd33c5830
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
src/plugins/acl/acl.c
src/plugins/acl/acl.h
src/plugins/acl/fa_node.c
src/plugins/acl/hash_lookup.c
src/plugins/acl/hash_lookup_types.h