aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/acl/hash_lookup_types.h
diff options
context:
space:
mode:
authorAndrew Yourtchenko <ayourtch@gmail.com>2017-07-27 15:39:50 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2017-08-08 09:43:53 +0000
commita5e614f76fda9efb7bd1577ec18f9c0407d95d03 (patch)
tree555bdde2277dc8693ef152caf11c9229330b86bd /src/plugins/acl/hash_lookup_types.h
parent7048ff1e3af7a3979a9134cbbb8157df8e1a8a53 (diff)
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> (cherry picked from commit bd9c5ffe39e9ce61db95d74d150e07d738f24da1)
Diffstat (limited to 'src/plugins/acl/hash_lookup_types.h')
-rw-r--r--src/plugins/acl/hash_lookup_types.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/acl/hash_lookup_types.h b/src/plugins/acl/hash_lookup_types.h
index 1848c5ffc6a..fbc9777b83d 100644
--- a/src/plugins/acl/hash_lookup_types.h
+++ b/src/plugins/acl/hash_lookup_types.h
@@ -53,14 +53,14 @@ typedef struct {
*/
u32 next_applied_entry_index;
/*
- * previous entry in the ring list of the chained ones.
+ * previous entry in the list of the chained ones,
+ * if ~0 then this is entry in the hash.
*/
u32 prev_applied_entry_index;
/*
- * 1 if it is the very first entry in the list,
- * referenced from the hash.
+ * chain tail, if this is the first entry
*/
- u8 is_first_entry;
+ u32 tail_applied_entry_index;
/*
* Action of this applied ACE
*/