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

fix(agw): c++ migration of mme_app files #14211

Merged
merged 38 commits into from
Nov 3, 2022

Conversation

pruthvihebbani
Copy link
Contributor

fix(agw): c++ migration of mme_app files

Summary

Migrated all the mme_app files to cpp/hpp and fixed all the compilation errors and warnings

Test Plan

Executed s1ap integ_tests, bazel build and mme unit test

Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
@pruthvihebbani pruthvihebbani requested a review from a team October 18, 2022 06:32
@pull-request-size pull-request-size bot added the size/XXL Denotes a Pull Request that changes 1000+ lines. label Oct 18, 2022
@github-actions github-actions bot added the component: agw Access gateway-related issue label Oct 18, 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
Copy link
Contributor

github-actions bot commented Oct 18, 2022

feg-workflow

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

Results for commit 3149868.

♻️ This comment has been updated with latest results.

Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
@github-actions
Copy link
Contributor

github-actions bot commented Oct 18, 2022

dp-workflow

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

Results for commit 3149868.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 18, 2022

agw-workflow

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

Results for commit 1fb9b3c.

♻️ This comment has been updated with latest results.

@LKreutzer LKreutzer requested review from LKreutzer and removed request for electronjoe October 19, 2022 11:08
Copy link
Contributor

@LKreutzer LKreutzer left a comment

Choose a reason for hiding this comment

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

Bazel changes lgtm!

Please rebase and resolve conflicts

Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
void update_mme_app_stats_s1u_bearer_add(void);
#ifdef __cplusplus
extern "C" {
#endif
void update_mme_app_stats_connected_ue_sub(void);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should not be moved within extern C

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This gives undefined reference if not under extern C as it is declared in .h file and used in cpp files

@@ -21,11 +21,11 @@
/*********************************** Utility Functions to update
* Statistics**************************************/
void update_mme_app_stats_connected_ue_add(void);
void update_mme_app_stats_connected_ue_sub(void);
void update_mme_app_stats_s1u_bearer_add(void);
#ifdef __cplusplus
extern "C" {
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

mme_app_statistics.h, mme_app_ue_context.h and mme_config.h are part of mme_app module, so move these files to hpp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Migration of files under include folder will be taken up as a separate activity as these files will be included in many .c/.cpp files

Copy link
Contributor

Choose a reason for hiding this comment

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

Separate PR is fine, but it will good if we could do before porting hash table to protobuf map. Because on inclusion of c++ provided features we get lot of errors as some piece of code is in 'C'

@@ -41,10 +41,16 @@
#include "lte/gateway/c/core/oai/include/s6a_messages_types.h"
#include "lte/gateway/c/core/oai/include/sgw_ie_defs.h"
#include "lte/gateway/c/core/oai/lib/bstr/bstrlib.h"
#ifdef __cplusplus
Copy link
Contributor

Choose a reason for hiding this comment

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

Space

#include "lte/gateway/c/core/oai/tasks/mme_app/mme_app_sgs_fsm.hpp"
#ifdef __cplusplus
}
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Space

#include "lte/gateway/c/core/oai/lib/hashtable/hashtable.h"
#include "lte/gateway/c/core/oai/lib/hashtable/obj_hashtable.h"
#include "lte/gateway/c/core/oai/tasks/mme_app/mme_app_sgs_fsm.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

This file should not under extern C

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mme_app_ue_context.h is included in many other .hpp/.cpp files which is causing undefined reference to many functions in mme_app_sgs_fsm.hpp. Instead of tracing all the files in which mme_app_ue_context.h is included and then wrapping it under extern C, I have added mme_app_sgs_fsm.hpp under extern C

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add comment with mentioning github issue id i.e #13096

#include "lte/gateway/c/core/oai/tasks/nas/util/nas_timer.hpp"

#define MME_APP_TIMER_INACTIVE_ID (-1)

#ifdef __cplusplus
extern "C" {
#endif
int mme_app_start_timer_arg(size_t msec, timer_repeat_t repeat,
Copy link
Contributor

Choose a reason for hiding this comment

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

Below funs() need not be under extern C

@@ -169,7 +169,11 @@ status_code_e mme_api_notify_new_guti(const mme_ue_s1ap_id_t ueid,
status_code_e mme_api_new_guti(const imsi_t* const imsi,
const guti_t* const old_guti, guti_t* const guti,
const tai_t* const originating_tai,
tai_list_t* const tai_list);*/
tai_list_t* const tai_list);
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove extern from this file because most of the functions would have already defined in cpp files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not under extern, it is temporarily moved to emm_headers.hpp file as some functions were throwing undefined reference even though they are declared/defined and used in hpp/cpp files. emm_headers.hpp file will be removed after all the files are moved to c++

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add comment with mentioning github issue id i.e #13096

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment with issue id is already added

@@ -48,7 +48,7 @@ extern "C" {
#include "lte/gateway/c/core/oai/lib/3gpp/3gpp_33.401.h"
#include "lte/gateway/c/core/oai/lib/3gpp/3gpp_36.401.h"
#include "lte/gateway/c/core/oai/lib/secu/secu_defs.h"
#include "lte/gateway/c/core/oai/tasks/mme_app/mme_app_timer.h"
#include "lte/gateway/c/core/oai/tasks/mme_app/mme_app_timer.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

In this file, emm_ctx_clear_ue_nw_cap() is defined under extern C. Now extern C can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not under extern, it is temporarily moved to emm_headers.hpp file as some functions were throwing undefined reference even though they are declared/defined and used in hpp/cpp files. emm_headers.hpp file will be removed after all the files are moved to c++

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add comment with mentioning github issue id i.e #13096

#include "lte/gateway/c/core/oai/tasks/mme_app/mme_app_apn_selection.hpp"
#include "lte/gateway/c/core/oai/tasks/mme_app/mme_app_defs.hpp"
#include "lte/gateway/c/core/oai/tasks/mme_app/mme_app_itti_messaging.hpp"
#include "lte/gateway/c/core/oai/tasks/mme_app/mme_app_sgs_fsm.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove extern C from this file

#include "lte/gateway/c/core/oai/tasks/mme_app/mme_app_defs.h"
#include "lte/gateway/c/core/oai/tasks/mme_app/mme_app_timer.h"
#include "lte/gateway/c/core/oai/tasks/mme_app/mme_app_defs.hpp"
#include "lte/gateway/c/core/oai/tasks/mme_app/mme_app_timer.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove extern C from this file.
General comment, if function calling and function definitions are in cpp files, then remove from extern C

Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Copy link
Contributor

@LKreutzer LKreutzer left a comment

Choose a reason for hiding this comment

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

Could it be that you forgot to rename mme_app_authentication.cpp? Bazel build is failing since it is not finding the file.

Answer:
I removed this file. I will update Bazel.build

Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Copy link
Contributor

@LKreutzer LKreutzer left a comment

Choose a reason for hiding this comment

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

Bazel changes lgtm!

@rsarwad rsarwad merged commit 2debe31 into magma:master Nov 3, 2022
lucasgonze pushed a commit to lucasgonze/magma that referenced this pull request Feb 29, 2024
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/XXL Denotes a Pull Request that changes 1000+ lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants