Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
af_packet: fix the broken functionality upon admin down
[vpp.git]
/
src
/
plugins
/
acl
/
hash_lookup_types.h
diff --git
a/src/plugins/acl/hash_lookup_types.h
b/src/plugins/acl/hash_lookup_types.h
index
1a20ebf
..
63b9245
100644
(file)
--- a/
src/plugins/acl/hash_lookup_types.h
+++ b/
src/plugins/acl/hash_lookup_types.h
@@
-18,17
+18,17
@@
#ifndef _ACL_HASH_LOOKUP_TYPES_H_
#define _ACL_HASH_LOOKUP_TYPES_H_
#ifndef _ACL_HASH_LOOKUP_TYPES_H_
#define _ACL_HASH_LOOKUP_TYPES_H_
+#include "types.h"
+
/* The structure representing the single entry with hash representation */
typedef struct {
/* The structure representing the single entry with hash representation */
typedef struct {
+ fa_5tuple_t match;
/* these two entries refer to the original ACL# and rule# within that ACL */
u32 acl_index;
u32 ace_index;
/* these two entries refer to the original ACL# and rule# within that ACL */
u32 acl_index;
u32 ace_index;
- u32 mask_type_index;
- u8 src_portrange_not_powerof2;
- u8 dst_portrange_not_powerof2;
+ u32 base_mask_type_index;
- fa_5tuple_t match;
u8 action;
} hash_ace_info_t;
u8 action;
} hash_ace_info_t;
@@
-36,8
+36,6
@@
typedef struct {
* The structure holding the information necessary for the hash-based ACL operation
*/
typedef struct {
* The structure holding the information necessary for the hash-based ACL operation
*/
typedef struct {
- /* The mask types present in this ACL */
- uword *mask_type_index_bitmap;
/* hash ACL applied on these lookup contexts */
u32 *lc_index_list;
hash_ace_info_t *rules;
/* hash ACL applied on these lookup contexts */
u32 *lc_index_list;
hash_ace_info_t *rules;
@@
-45,26
+43,31
@@
typedef struct {
int hash_acl_exists;
} hash_acl_info_t;
int hash_acl_exists;
} hash_acl_info_t;
+
+typedef struct {
+ acl_rule_t rule;
+ u32 acl_index;
+ u32 ace_index;
+ u32 acl_position;
+ u32 applied_entry_index;
+} collision_match_rule_t;
+
typedef struct {
/* original non-compiled ACL */
u32 acl_index;
u32 ace_index;
/* the index of the hash_ace_info_t */
u32 hash_ace_info_index;
typedef struct {
/* original non-compiled ACL */
u32 acl_index;
u32 ace_index;
/* the index of the hash_ace_info_t */
u32 hash_ace_info_index;
+ /* applied mask type index */
+ u32 mask_type_index;
/*
/*
- * in case of the same key having multiple entries,
- * this holds the index of the next entry.
- */
- u32 next_applied_entry_index;
- /*
- * previous entry in the list of the chained ones,
- * if ~0 then this is entry in the hash.
+ * index of applied entry, which owns the colliding_rules vector
*/
*/
- u32
prev_applied_entry
_index;
+ u32
collision_head_ae
_index;
/*
/*
- *
chain tail, if this is the first
entry
+ *
Collision rule vector for matching - set only on head
entry
*/
*/
-
u32 tail_applied_entry_index
;
+
collision_match_rule_t *colliding_rules
;
/*
* number of hits on this entry
*/
/*
* number of hits on this entry
*/
@@
-80,11
+83,7
@@
typedef struct {
} applied_hash_ace_entry_t;
typedef struct {
} applied_hash_ace_entry_t;
typedef struct {
- /*
- * A logical OR of all the applied_ace_hash_entry_t=>
- * hash_ace_info_t=>mask_type_index bits set
- */
- uword *mask_type_index_bitmap;
+
/* applied ACLs so we can track them independently from main ACL module */
u32 *applied_acls;
} applied_hash_acl_info_t;
/* applied ACLs so we can track them independently from main ACL module */
u32 *applied_acls;
} applied_hash_acl_info_t;
@@
-96,13
+95,21
@@
typedef union {
u32 applied_entry_index;
u16 reserved_u16;
u8 reserved_u8;
u32 applied_entry_index;
u16 reserved_u16;
u8 reserved_u8;
- /* means there is some other entry in front intersecting with this one */
- u8 shadowed:1;
- u8 need_portrange_check:1;
- u8 reserved_flags:6;
+ u8 reserved_flags:8;
};
} hash_acl_lookup_value_t;
};
} hash_acl_lookup_value_t;
+
+typedef struct {
+ u32 mask_type_index;
+ /* first rule # for this mask */
+ u32 first_rule_index;
+ /* Debug Information */
+ u32 num_entries;
+ u32 max_collisions;
+} hash_applied_mask_info_t;
+
+
#define CT_ASSERT_EQUAL(name, x,y) typedef int assert_ ## name ## _compile_time_assertion_failed[((x) == (y))-1]
CT_ASSERT_EQUAL(hash_acl_lookup_value_t_is_u64, sizeof(hash_acl_lookup_value_t), sizeof(u64));
#define CT_ASSERT_EQUAL(name, x,y) typedef int assert_ ## name ## _compile_time_assertion_failed[((x) == (y))-1]
CT_ASSERT_EQUAL(hash_acl_lookup_value_t_is_u64, sizeof(hash_acl_lookup_value_t), sizeof(u64));