From 187ddfb653aa24246f30851715b9439972a1c3ba Mon Sep 17 00:00:00 2001 From: Andrew Yourtchenko Date: Wed, 20 Mar 2019 17:44:14 +0100 Subject: acl-plugin: tuplemerge: fix a crash during soak test with split partition Reload the hash-ready ACE vector pointer during the partition split with each iteration, since the ACL# may change. Change-Id: I1b001e06b52ff02ef59ca1d890f8462ca99e6634 Signed-off-by: Andrew Yourtchenko (cherry picked from commit 9f3d3ceb0130aba2eb11a5cbd2fcef3384864fe8) --- src/plugins/acl/hash_lookup.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/plugins/acl/hash_lookup.c b/src/plugins/acl/hash_lookup.c index ff671d1c092..2d77a826e45 100644 --- a/src/plugins/acl/hash_lookup.c +++ b/src/plugins/acl/hash_lookup.c @@ -1511,9 +1511,11 @@ split_partition(acl_main_t *am, u32 first_index, clib_memset(&the_max_tuple, 0, sizeof(the_max_tuple)); int i=0; + collision_match_rule_t *colliding_rules = pae->colliding_rules; u64 collisions = vec_len(pae->colliding_rules); for(i=0; ihash_acl_infos, pae->acl_index); DBG( "TM-collision: base_ace:%d (ace_mask:%d, first_collision_mask:%d)", @@ -1563,8 +1565,6 @@ split_partition(acl_main_t *am, u32 first_index, if(mask->pkt.as_u64 > max_tuple->pkt.as_u64) max_tuple->pkt.as_u64 = mask->pkt.as_u64; } - - pae = pae->next_applied_entry_index == ~0 ? 0 : vec_elt_at_index((*applied_hash_aces), pae->next_applied_entry_index); } /* Computing field with max difference between (min/max)_mask */ @@ -1691,15 +1691,19 @@ split_partition(acl_main_t *am, u32 first_index, u32 r_ace_index = first_index; int repopulate_count = 0; -// for(i=0; ihash_acl_infos, pop_pae->acl_index); DBG( "TM-Population-collision: base_ace:%d (ace_mask:%d, first_collision_mask:%d)", pop_pae->ace_index, pop_pae->mask_type_index, coll_mask_type_index); - if(pop_pae->mask_type_index != coll_mask_type_index) continue; - u32 next_index = pop_pae->next_applied_entry_index; + ASSERT(pop_pae->mask_type_index == coll_mask_type_index); ace_info = vec_elt_at_index(ha->rules, pop_pae->hash_ace_info_index); mte = vec_elt_at_index(am->ace_mask_type_pool, ace_info->base_mask_type_index); @@ -1721,8 +1725,8 @@ split_partition(acl_main_t *am, u32 first_index, activate_applied_ace_hash_entry(am, lc_index, applied_hash_aces, r_ace_index); - r_ace_index = next_index; } + vec_free(temp_colliding_rules); DBG( "TM-Populate new partition-END"); DBG( "TM-split_partition - END"); -- cgit 1.2.3-korg