-
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
chore(agw): MME retun type fix in nas #12973
Conversation
Signed-off-by: Vikram G <vikram.gurrappagaru@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
|
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 some minor comments
@@ -307,7 +307,7 @@ status_code_e emm_proc_detach_request(mme_ue_s1ap_id_t ue_id, | |||
|
|||
{ | |||
OAILOG_FUNC_IN(LOG_NAS_EMM); | |||
int 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.
Generic comment to initialize rc with appropriate value, wherever it is not initialized
@@ -99,7 +99,7 @@ | |||
***************************************************************************/ | |||
status_code_e emm_proc_uplink_nas_transport(mme_ue_s1ap_id_t ue_id, | |||
bstring nas_msg_pP) { | |||
int rc = RETURNok; |
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.
rc is used at the time of initializing and returning. You can collect the return value of of fun, emm_proc_nw_initiated_detach_request
@@ -70,7 +70,7 @@ static int check_paging_received_without_lai(mme_ue_s1ap_id_t ue_id); | |||
/****************************************************************************/ | |||
status_code_e emm_proc_service_reject(const mme_ue_s1ap_id_t ue_id, | |||
const uint8_t emm_cause) { | |||
int rc = RETURNok; | |||
status_code_e rc = RETURNok; |
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.
rc is not required here, we can return as OAILOG_FUNC_RETURN(LOG_NAS_EMM, emm_service_reject(ue_id, emm_cause));
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.
@ssanadhya, With addressing this comment, make_testoai was failing because OAILOG_FUNC_RETURN is defined as below
#define OAILOG_FUNC_RETURN(pRoTo, rEtUrNcOdE)
do {
log_func_return(pRoTo, FILE, LINE, FUNCTION,
(long)rEtUrNcOdE);
return rEtUrNcOdE;
} while (0) /*!< \brief informational */
#endif
So the second argument gets replaced twice and if it's function then it gets called twice. So we should always have variable for second argument.
So shall raise new issue to replace function call with variable wherever we are using macro, OAILOG_FUNC_RETURN.
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.
Tracked in issue, #13255
@@ -141,7 +141,7 @@ static int emm_service_reject(mme_ue_s1ap_id_t ue_id, uint8_t emm_cause) | |||
status_code_e emm_proc_extended_service_request( | |||
const mme_ue_s1ap_id_t ue_id, const extended_service_request_msg* msg) { | |||
OAILOG_FUNC_IN(LOG_NAS_EMM); | |||
int rc = RETURNok; | |||
status_code_e rc = RETURNok; |
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.
Above logic can be followed here as well
@@ -550,7 +550,7 @@ status_code_e emm_proc_tracking_area_update_request( | |||
***************************************************************************/ | |||
status_code_e emm_proc_tracking_area_update_reject(const mme_ue_s1ap_id_t ue_id, | |||
const int emm_cause) { | |||
int rc = RETURNerror; | |||
status_code_e rc = RETURNerror; |
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.
rc not required here. We can directly return the status of function
@@ -538,7 +538,7 @@ status_code_e nas_proc_implicit_detach_ue_ind(mme_ue_s1ap_id_t ue_id) { | |||
//------------------------------------------------------------------------------ | |||
status_code_e nas_proc_nw_initiated_detach_ue_request( | |||
emm_cn_nw_initiated_detach_ue_t* const nw_initiated_detach_p) { | |||
int rc = RETURNerror; | |||
status_code_e rc = RETURNerror; |
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.
rc can be removed and handle as mentioned earlier
@@ -882,7 +882,7 @@ status_code_e nas_proc_cs_domain_mm_information_request( | |||
status_code_e nas_proc_pdn_disconnect_rsp( | |||
emm_cn_pdn_disconnect_rsp_t* emm_cn_pdn_disconnect_rsp) { | |||
OAILOG_FUNC_IN(LOG_NAS_EMM); | |||
int rc = RETURNerror; | |||
status_code_e rc = RETURNerror; |
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.
rc can be removed as mentioned earlier
@@ -856,7 +856,7 @@ static nas_cause_t s6a_error_2_nas_cause(uint32_t s6a_error, int experimental) { | |||
|
|||
status_code_e nas_proc_cs_domain_mm_information_request( | |||
itti_sgsap_mm_information_req_t* const mm_information_req_pP) { | |||
int rc = RETURNerror; | |||
status_code_e rc = RETURNerror; |
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.
same comment as below
@@ -130,8 +129,8 @@ status_code_e emm_send_status(const emm_as_status_t* msg, | |||
** Others: None ** | |||
** ** | |||
***************************************************************************/ | |||
status_code_e emm_send_detach_accept(const emm_as_data_t* msg, | |||
detach_accept_msg* emm_msg) { | |||
int emm_send_detach_accept(const emm_as_data_t* msg, |
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.
we could return something like ssize_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.
Calling function is expecting int. We need to change in so many places. Can be taken as a part of separate PR
@@ -112,7 +112,7 @@ void esm_ebr_initialize(void) { | |||
** Others: _esm_ebr_data ** | |||
** ** | |||
***************************************************************************/ | |||
status_code_e esm_ebr_assign(emm_context_t* emm_context) { | |||
int esm_ebr_assign(emm_context_t* emm_context) { |
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.
return type could be ebi_t
Signed-off-by: Vikram G <vikram.gurrappagaru@radisys.com>
bb004a3
to
dce2513
Compare
@@ -70,10 +70,8 @@ static int check_paging_received_without_lai(mme_ue_s1ap_id_t ue_id); | |||
/****************************************************************************/ | |||
status_code_e emm_proc_service_reject(const mme_ue_s1ap_id_t ue_id, | |||
const uint8_t emm_cause) { | |||
status_code_e rc = RETURNok; | |||
OAILOG_FUNC_IN(LOG_NAS_EMM); |
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.
The emm_proc_service_reject
function is just a wrapper around emm_service_reject
. Better to rename emm_service_reject
to emm_proc_service_reject
and get rid of this 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.
I will raise as a part of separate PR.?
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.
Tracked in #13134
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, can be merged once @rsarwad approves
Signed-off-by: Vikram G <vikram.gurrappagaru@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
* chore(agw): MME retun type fix in nas Signed-off-by: Vikram G <vikram.gurrappagaru@radisys.com> * chore(agw): Review comments Signed-off-by: Vikram G <vikram.gurrappagaru@radisys.com>
* chore(agw): MME retun type fix in nas Signed-off-by: Vikram G <vikram.gurrappagaru@radisys.com> * chore(agw): Review comments Signed-off-by: Vikram G <vikram.gurrappagaru@radisys.com>
Fixes for #11199
Signed-off-by: Vikram G vikram.gurrappagaru@radisys.com
Summary
In order to use the protobuf map, it's required to migrate all c files to cpp. Doing so will result in huge changes. So we planned to commit a small chunk of changes. This PR returns the value as expected by the function prototype.
Test Plan
make test_oai
Additional Information