-
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): Modified code to replace state_teid_hash list to protobuf map in spgw task #13843
Conversation
…ap in spgw task Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Thanks for opening a PR! 💯
Howto
More infoPlease take a moment to read through the Magma project's
If this is your first Magma PR, also consider reading
|
@@ -54,7 +48,7 @@ void delete_pending_procedures( | |||
base_proc1 = base_proc2; | |||
} | |||
LIST_INIT(ctx_p->pending_procedures); | |||
free_wrapper((void**)&ctx_p->pending_procedures); | |||
free_cpp_wrapper((void**)&ctx_p->pending_procedures); |
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]
delete_pending_procedures( | ||
&(context_p->sgw_eps_bearer_context_information)); | ||
|
||
free_cpp_wrapper((void**)ptr); |
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]
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.
Please fix lint warning
@@ -1475,7 +1475,7 @@ void sgw_s8_proc_s11_create_bearer_rsp( | |||
if (pgw_ni_cbr_proc && (LIST_EMPTY(pgw_ni_cbr_proc->pending_eps_bearers))) { | |||
pgw_base_proc_t* base_proc1 = LIST_FIRST(sgw_context_p->pending_procedures); | |||
LIST_REMOVE(base_proc1, entries); | |||
free_wrapper((void**)&sgw_context_p->pending_procedures); | |||
free_cpp_wrapper((void**)&sgw_context_p->pending_procedures); |
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]
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.
Please fix lint warning
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.
Left a minor comment
(void (*)(void**))pgw_lite_cm_free_apn, b); | ||
bdestroy_wrapper(&b); | ||
|
||
if (new_bearer_context_information->pgw_eps_bearer_context_information.apns == |
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.
Where is APN collection getting created now?
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.
Hi @pruthvihebbani, this removed code was not used so I cleaned it up. The apn information is available within pdn session, https://github.com/magma/magma/blob/master/lte/gateway/c/core/oai/lib/3gpp/3gpp_23.401.h#L122
…w_teid_hl Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
status_code_e rc = RETURNok; | ||
hash_table_ts_t* hashtblP = NULL; | ||
uint32_t num_elements = 0; | ||
state_teid_map_t* state_teid_map = nullptr; | ||
s_plus_p_gw_eps_bearer_context_information_t* spgw_ctxt_p = NULL; |
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.
s_plus_p_gw_eps_bearer_context_information_t* spgw_ctxt_p = NULL; | |
s_plus_p_gw_eps_bearer_context_information_t* spgw_ctxt_p = nullptr; |
for (auto itr = state_teid_map->map->begin(); | ||
itr != state_teid_map->map->end(); itr++) { | ||
if (!is_lbi_found) { | ||
state_teid_map->get(itr->first, &spgw_ctxt_p); | ||
if (spgw_ctxt_p != NULL) { |
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 (spgw_ctxt_p != NULL) { | |
if (spgw_ctxt_p != nullptr) { |
for (auto itr = state_teid_map->map->begin(); | ||
itr != state_teid_map->map->end(); itr++) { | ||
if (!is_lbi_found) { | ||
state_teid_map->get(itr->first, &spgw_ctxt_p); | ||
if (spgw_ctxt_p != NULL) { |
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 (spgw_ctxt_p != NULL) { | |
if (spgw_ctxt_p != nullptr) { |
delete_pending_procedures( | ||
&(context_p->sgw_eps_bearer_context_information)); | ||
|
||
free_cpp_wrapper((void**)ptr); |
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.
Please fix lint warning
@@ -1475,7 +1475,7 @@ void sgw_s8_proc_s11_create_bearer_rsp( | |||
if (pgw_ni_cbr_proc && (LIST_EMPTY(pgw_ni_cbr_proc->pending_eps_bearers))) { | |||
pgw_base_proc_t* base_proc1 = LIST_FIRST(sgw_context_p->pending_procedures); | |||
LIST_REMOVE(base_proc1, entries); | |||
free_wrapper((void**)&sgw_context_p->pending_procedures); | |||
free_cpp_wrapper((void**)&sgw_context_p->pending_procedures); |
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.
Please fix lint warning
…w_teid_hl Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
e4bf0cd
to
d3bc939
Compare
…w_teid_hl Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
@@ -1635,8 +1635,9 @@ status_code_e sgw_handle_nw_initiated_actv_bearer_rsp( | |||
pgw_base_proc_t* base_proc1 = LIST_FIRST( | |||
spgw_context->sgw_eps_bearer_context_information.pending_procedures); | |||
LIST_REMOVE(base_proc1, entries); | |||
free_wrapper((void**)&spgw_context->sgw_eps_bearer_context_information | |||
.pending_procedures); | |||
delete spgw_context->sgw_eps_bearer_context_information.pending_procedures; |
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.
Can't we use free_cpp_wrapper
here?
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.
It's possible to use free_cpp_wrapper and corrected it now
@@ -1983,7 +1984,8 @@ void handle_failed_create_bearer_response( | |||
pgw_base_proc_t* base_proc1 = | |||
LIST_FIRST(sgw_context_p->pending_procedures); | |||
LIST_REMOVE(base_proc1, entries); | |||
free_wrapper((void**)&sgw_context_p->pending_procedures); | |||
delete sgw_context_p->pending_procedures; |
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.
Use free_cpp_wrapper
free_wrapper((void**)&pgw_ni_cbr_proc->pending_eps_bearers); | ||
free_cpp_wrapper( | ||
reinterpret_cast<void**>(&sgw_context_p->pending_procedures)); | ||
free_wrapper( |
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.
Shouldn't this be free_cpp_wrapper
?
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.
In this PR, for pending_eps_bearers memory is allocated with calloc. But in next PR I have changed to new()
Signed-off-by: Rashmi <rashmi.sarwad@radisys.com>
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
Signed-off-by: Rashmi rashmi.sarwad@radisys.com
Summary
fix(agw): Modified code to replace state_teid_hash list to protobuf map in spgw task
The test case, TestUEContextConversion was failing because in function, proto_to_ue() after fetching ue and bearer details, it inserts bearer contexts to map with unique teid. While simulating this test case, bearer contexts were created with same teid. Due to which test case was failing. Fixed the issue by assigning unique teid to bearer contexts
Test Plan
Executed s1ap sanity test suite and unit test cases.