Skip to content
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

Merged
merged 3 commits into from
Jul 11, 2022

Conversation

vikramgreddy
Copy link
Contributor

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

Signed-off-by: Vikram G <vikram.gurrappagaru@radisys.com>
@vikramgreddy vikramgreddy requested review from a team and rsarwad June 13, 2022 13:32
@pull-request-size pull-request-size bot added the size/L Denotes a Pull Request that changes 100-499 lines. label Jun 13, 2022
@github-actions
Copy link
Contributor

Thanks for opening a PR! 💯

A couple initial guidelines

Howto

  • Reviews. The "Reviewers" listed for this PR are the Magma maintainers who will shepherd it.
  • Checks. All required CI checks must pass before merge.
  • Merge. Once approved and passing CI checks, use the ready2merge label to indicate the maintainers can merge your PR.

More info

Please take a moment to read through the Magma project's

If this is your first Magma PR, also consider reading

@github-actions github-actions bot added the component: agw Access gateway-related issue label Jun 13, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 13, 2022

feg-workflow

    2 files  203 suites   39s ⏱️
374 tests 374 ✔️ 0 💤 0
388 runs  388 ✔️ 0 💤 0

Results for commit 0d474d8.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 13, 2022

dp-workflow

14 tests   14 ✔️  3m 33s ⏱️
  1 suites    0 💤
  1 files      0

Results for commit 0d474d8.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 13, 2022

agw-workflow

615 tests   611 ✔️  3m 37s ⏱️
    2 suites      4 💤
    2 files        0

Results for commit 0d474d8.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@rsarwad rsarwad left a 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;
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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));

Copy link
Contributor

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.

Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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,
Copy link
Contributor

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 ?

Copy link
Contributor Author

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) {
Copy link
Contributor

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>
@@ -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);
Copy link
Collaborator

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.

Copy link
Contributor Author

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.?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracked in #13134

Copy link
Collaborator

@ssanadhya ssanadhya left a 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>
Copy link
Contributor

@rsarwad rsarwad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rsarwad rsarwad merged commit 98725b7 into magma:master Jul 11, 2022
talesmota pushed a commit to talesmota/magma that referenced this pull request Jul 11, 2022
* 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>
emakeev pushed a commit to emakeev/magma that referenced this pull request Aug 5, 2022
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: agw Access gateway-related issue size/L Denotes a Pull Request that changes 100-499 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants