-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(agw): Migrate hash list of state_ue to protobuf_map #13508
fix(agw): Migrate hash list of state_ue to protobuf_map #13508
Conversation
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…tion_10869 Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…_c_to_cpp Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…tion_10869 Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…_c_to_cpp Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…ad/magma into rsarwad_s1ap_integrate_proto_map Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…ad/magma into rsarwad_s1ap_integrate_proto_map
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…ad/magma into rsarwad_s1ap_integrate_proto_map Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…_c_to_cpp Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…ad/magma into rsarwad_s1ap_integrate_proto_map
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…tion_10869 Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…tion_10869 Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…odule Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…tion_10869 Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
hashtable_rc_code2string(hashrc)); | ||
free_wrapper((void**)&ue_ref); | ||
magma::map_rc_code2string(rc)); | ||
free_cpp_wrapper((void**)&ue_ref); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<void**>(...) instead [readability/casting] [4]
90f5518
to
4d2837d
Compare
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
4d2837d
to
68afe56
Compare
…tate_ue_ht_s1ap Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
@@ -152,23 +152,23 @@ status_code_e S1apStateManager::read_ue_state_from_db() { | |||
for (const auto& key : keys) { | |||
OAILOG_DEBUG(log_task, "Reading UE state from db for %s", key.c_str()); | |||
UeDescription ue_proto = UeDescription(); | |||
auto* ue_context = (ue_description_t*)calloc(1, sizeof(ue_description_t)); | |||
auto* ue_context = new ue_description_t(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add NULL check for ue_context
ue_description_t* final_ue = | ||
(ue_description_t*)calloc(1, sizeof(ue_description_t)); | ||
ue_description_t* ue = new ue_description_t(); | ||
ue_description_t* final_ue = new ue_description_t(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add NULL check
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…tate_ue_ht_s1ap Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…tate_ue_ht_s1ap Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
@@ -458,8 +459,8 @@ void s1ap_remove_ue(s1ap_state_t* state, ue_description_t* ue_ref) { | |||
ue_ref->s1ap_ue_context_rel_timer.id = S1AP_TIMER_INACTIVE_ID; | |||
} | |||
|
|||
hash_table_ts_t* state_ue_ht = get_s1ap_ue_state(); | |||
hashtable_ts_free(state_ue_ht, ue_ref->comp_s1ap_id); | |||
map_uint64_ue_description_t* s1ap_ue_state = get_s1ap_ue_state(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add NULL check for s1ap_ue_state
@@ -3550,8 +3535,8 @@ static bool s1ap_send_enb_deregistered_ind(__attribute__((unused)) | |||
ue_description_t* ue_ref_p = NULL; | |||
|
|||
// Ask for the release of each UE context associated to the eNB | |||
hash_table_ts_t* s1ap_ue_state = get_s1ap_ue_state(); | |||
hashtable_ts_get(s1ap_ue_state, (const hash_key_t)dataP, (void**)&ue_ref_p); | |||
map_uint64_ue_description_t* s1ap_ue_state = get_s1ap_ue_state(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add NULL check
@@ -3618,8 +3603,8 @@ bool construct_s1ap_mme_full_reset_req(uint32_t keyP, const uint64_t dataP, | |||
reinterpret_cast<arg_s1ap_construct_enb_reset_req_t*>(argP); | |||
ue_description_t* ue_ref = reinterpret_cast<ue_description_t*>(dataP); | |||
|
|||
hash_table_ts_t* s1ap_ue_state = get_s1ap_ue_state(); | |||
hashtable_ts_get(s1ap_ue_state, (const hash_key_t)dataP, (void**)&ue_ref); | |||
map_uint64_ue_description_t* s1ap_ue_state = get_s1ap_ue_state(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comment: Add NULL check for s1ap_ue_state after get_s1ap_ue_state()
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
1964ed9
to
a895d5d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…tate_ue_ht_s1ap Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
…tate_ue_ht_s1ap Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
ue_description_t* final_ue = | ||
(ue_description_t*)calloc(1, sizeof(ue_description_t)); | ||
ue_description_t* ue = new ue_description_t(); | ||
EXPECT_TRUE(ue != nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, the nullptr check here is not required when using new ...
since C++ returns an instance or throws a std::bad_alloc exception.
|
||
if (HASH_TABLE_OK != hashrc) { | ||
if (magma::PROTO_MAP_OK != rc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (magma::PROTO_MAP_OK != rc) { | |
if (rc != magma::PROTO_MAP_OK) { |
if (HASH_TABLE_OK != h_rc) { | ||
proto_map_rc_t rc = | ||
state_ue_map.insert(ue_context->comp_s1ap_id, ue_context); | ||
if (PROTO_MAP_OK != rc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (PROTO_MAP_OK != rc) { | |
if (rc != PROTO_MAP_OK) { |
|
||
if (HASH_TABLE_OK != h_rc) { | ||
if (magma::PROTO_MAP_OK != rc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (magma::PROTO_MAP_OK != rc) { | |
if (rc != magma::PROTO_MAP_OK) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, please address the nit comments
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
891923f
to
6c6175c
Compare
…tate_ue_ht_s1ap Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Modified code to replace hashtable with protobuf map for state_ue hash table in s1ap module
Summary
Modified code to replace hashtable with protobuf map for state_ue hash table in s1ap module
The PR partially addresses the issue, #11190
Test Plan
Executed s1ap sanity test suite and unit test case.
Verified manually with test_attact_detach_with_mme_restart.py test case, to check whether contents of map, state ue map is correctly formed after mme recovery