-
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): c++ migration of mme_app files #14211
Conversation
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>
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
|
lte/gateway/c/core/oai/tasks/mme_app/mme_app_edns_emulation.cpp
Outdated
Show resolved
Hide resolved
lte/gateway/c/core/oai/tasks/mme_app/mme_app_edns_emulation.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@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.
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); |
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 this should not be moved within extern C
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.
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 |
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.
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
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.
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
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.
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 |
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.
Space
#include "lte/gateway/c/core/oai/tasks/mme_app/mme_app_sgs_fsm.hpp" | ||
#ifdef __cplusplus | ||
} | ||
#endif |
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.
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" |
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.
This file should not under extern C
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.
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
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.
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, |
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.
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); |
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.
Remove extern from this file because most of the functions would have already defined in cpp files
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.
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++
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.
Could you add comment with mentioning github issue id i.e #13096
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.
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" |
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 file, emm_ctx_clear_ue_nw_cap() is defined under extern C. Now extern C can be removed
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.
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++
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.
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" |
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.
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" |
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.
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>
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.
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>
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.
Bazel changes lgtm!
Signed-off-by: Pruthvi Hebbani <pruthvi.hebbani@radisys.com>
Converted mme_app files
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