Skip to content

Commit f433a72

Browse files
committed
Addressed review comments
1 parent 344e450 commit f433a72

File tree

8 files changed

+110
-195
lines changed

8 files changed

+110
-195
lines changed

lte/gateway/c/oai/tasks/mme_app/mme_app_bearer.c

Lines changed: 50 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ void mme_app_handle_initial_ue_message(mme_app_desc_t *mme_app_desc_p,
695695
/*
696696
* Error during ue context malloc
697697
*/
698-
DevMessage("mme_create_new_ue_context");
698+
OAILOG_ERROR(LOG_MME_APP, "Failed to create new ue context \n");
699699
OAILOG_FUNC_OUT(LOG_MME_APP);
700700
}
701701
is_mm_ctx_new = true;
@@ -1628,26 +1628,17 @@ void mme_app_handle_e_rab_setup_rsp(
16281628
void mme_app_handle_mobile_reachability_timer_expiry(void* args)
16291629
{
16301630
OAILOG_FUNC_IN(LOG_MME_APP);
1631-
mme_app_desc_t* mme_app_desc_p = NULL;
16321631
mme_ue_s1ap_id_t mme_ue_s1ap_id = *((mme_ue_s1ap_id_t *) (args));
16331632
struct ue_mm_context_s* ue_context_p = NULL;
16341633

1635-
mme_app_desc_p = get_mme_nas_state(false);
1636-
ue_context_p = mme_ue_context_exists_mme_ue_s1ap_id(
1637-
&mme_app_desc_p->mme_ue_contexts, mme_ue_s1ap_id);
1634+
ue_context_p = mme_app_get_ue_context(
1635+
mme_ue_s1ap_id,
1636+
"Mobile reachability timer");
16381637
if (ue_context_p == NULL) {
1639-
OAILOG_ERROR(
1640-
LOG_MME_APP,
1641-
"Mobile Reachability Timer expired, but no assoicated UE context found"
1642-
" for ue-id " MME_UE_S1AP_ID_FMT "\n",
1643-
mme_ue_s1ap_id);
16441638
OAILOG_FUNC_OUT(LOG_MME_APP);
16451639
}
16461640
ue_context_p->mobile_reachability_timer.id = MME_APP_TIMER_INACTIVE_ID;
1647-
OAILOG_INFO(
1648-
LOG_MME_APP,
1649-
"Expired- Mobile Reachability Timer for ue_id:" MME_UE_S1AP_ID_FMT " \n",
1650-
ue_context_p->mme_ue_s1ap_id);
1641+
16511642
// Start Implicit Detach timer
16521643
nas_itti_timer_arg_t timer_callback_fun = {0};
16531644
timer_callback_fun.nas_timer_callback =
@@ -1685,28 +1676,16 @@ void mme_app_handle_mobile_reachability_timer_expiry(void* args)
16851676
void mme_app_handle_implicit_detach_timer_expiry(void* args)
16861677
{
16871678
OAILOG_FUNC_IN(LOG_MME_APP);
1688-
mme_app_desc_t* mme_app_desc_p = NULL;
16891679
mme_ue_s1ap_id_t mme_ue_s1ap_id = *((mme_ue_s1ap_id_t*) (args));
16901680
struct ue_mm_context_s* ue_context_p = NULL;
16911681

1692-
mme_app_desc_p = get_mme_nas_state(false);
1693-
ue_context_p = mme_ue_context_exists_mme_ue_s1ap_id(
1694-
&mme_app_desc_p->mme_ue_contexts, mme_ue_s1ap_id);
1682+
ue_context_p = mme_app_get_ue_context(
1683+
mme_ue_s1ap_id,
1684+
"Implicit detach timer");
16951685
if (ue_context_p == NULL) {
1696-
OAILOG_ERROR(
1697-
LOG_MME_APP,
1698-
"Implicit Detach Timer expired, but no assoicated UE context for"
1699-
"ue-id " MME_UE_S1AP_ID_FMT "\n",
1700-
mme_ue_s1ap_id);
17011686
OAILOG_FUNC_OUT(LOG_MME_APP);
17021687
}
1703-
1704-
OAILOG_INFO(
1705-
LOG_MME_APP,
1706-
"Implicit Detach timer expired for UE id" MME_UE_S1AP_ID_FMT "\n",
1707-
mme_ue_s1ap_id);
17081688
ue_context_p->implicit_detach_timer.id = MME_APP_TIMER_INACTIVE_ID;
1709-
17101689
// Initiate Implicit Detach for the UE
17111690
nas_proc_implicit_detach_ue_ind(mme_ue_s1ap_id);
17121691
OAILOG_FUNC_OUT(LOG_MME_APP);
@@ -1716,27 +1695,15 @@ void mme_app_handle_implicit_detach_timer_expiry(void* args)
17161695
void mme_app_handle_initial_context_setup_rsp_timer_expiry(void* args)
17171696
{
17181697
OAILOG_FUNC_IN(LOG_MME_APP);
1719-
mme_app_desc_t* mme_app_desc_p = NULL;
17201698
mme_ue_s1ap_id_t mme_ue_s1ap_id = *((mme_ue_s1ap_id_t*) (args));
17211699
struct ue_mm_context_s* ue_context_p = NULL;
17221700

1723-
mme_app_desc_p = get_mme_nas_state(false);
1724-
ue_context_p = mme_ue_context_exists_mme_ue_s1ap_id(
1725-
&mme_app_desc_p->mme_ue_contexts, mme_ue_s1ap_id);
1701+
ue_context_p = mme_app_get_ue_context(
1702+
mme_ue_s1ap_id,
1703+
"Initial context setup response timer");
17261704
if (ue_context_p == NULL) {
1727-
OAILOG_ERROR(
1728-
LOG_MME_APP,
1729-
"Initial context setup rsp Timer expired, but no assoicated UE context found"
1730-
" for ue_id " MME_UE_S1AP_ID_FMT "\n",
1731-
mme_ue_s1ap_id);
17321705
OAILOG_FUNC_OUT(LOG_MME_APP);
17331706
}
1734-
1735-
1736-
OAILOG_ERROR(
1737-
LOG_MME_APP,
1738-
"Expired- Initial context setup rsp timer for UE id %d \n",
1739-
mme_ue_s1ap_id);
17401707
ue_context_p->initial_context_setup_rsp_timer.id = MME_APP_TIMER_INACTIVE_ID;
17411708
/* *********Abort the ongoing procedure*********
17421709
* Check if UE is registered already that implies service request procedure is active. If so then release the S1AP
@@ -2055,27 +2022,13 @@ int mme_app_handle_initial_paging_request(mme_app_desc_t *mme_app_desc_p,
20552022
void mme_app_handle_paging_timer_expiry(void* args)
20562023
{
20572024
OAILOG_FUNC_IN(LOG_MME_APP);
2058-
mme_app_desc_t* mme_app_desc_p = NULL;
20592025
mme_ue_s1ap_id_t mme_ue_s1ap_id = *((mme_ue_s1ap_id_t*) (args));
20602026
struct ue_mm_context_s* ue_context_p = NULL;
2027+
ue_context_p = mme_app_get_ue_context(mme_ue_s1ap_id, "Paging timer");
20612028

2062-
mme_app_desc_p = get_mme_nas_state(false);
2063-
ue_context_p = mme_ue_context_exists_mme_ue_s1ap_id(
2064-
&mme_app_desc_p->mme_ue_contexts, mme_ue_s1ap_id);
20652029
if (ue_context_p == NULL) {
2066-
OAILOG_ERROR(
2067-
LOG_MME_APP,
2068-
"Paging Timer expired, but no assoicated UE context found"
2069-
" for ue_id " MME_UE_S1AP_ID_FMT "\n",
2070-
mme_ue_s1ap_id);
20712030
OAILOG_FUNC_OUT(LOG_MME_APP);
20722031
}
2073-
2074-
OAILOG_ERROR(
2075-
LOG_MME_APP,
2076-
"Paging Timer expired for ue_id " MME_UE_S1AP_ID_FMT "\n",
2077-
mme_ue_s1ap_id);
2078-
20792032
ue_context_p->paging_response_timer.id = MME_APP_TIMER_INACTIVE_ID;
20802033
if ((mme_app_paging_request_helper(
20812034
ue_context_p, false, true /* s-tmsi */, CN_DOMAIN_PS)) != RETURNok) {
@@ -2090,26 +2043,15 @@ void mme_app_handle_paging_timer_expiry(void* args)
20902043
void mme_app_handle_ulr_timer_expiry(void* args)
20912044
{
20922045
OAILOG_FUNC_IN(LOG_MME_APP);
2093-
mme_app_desc_t* mme_app_desc_p = NULL;
20942046
mme_ue_s1ap_id_t mme_ue_s1ap_id = *((mme_ue_s1ap_id_t*) (args));
20952047
struct ue_mm_context_s* ue_context_p = NULL;
20962048

2097-
mme_app_desc_p = get_mme_nas_state(false);
2098-
ue_context_p = mme_ue_context_exists_mme_ue_s1ap_id(
2099-
&mme_app_desc_p->mme_ue_contexts, mme_ue_s1ap_id);
2049+
ue_context_p = mme_app_get_ue_context(
2050+
mme_ue_s1ap_id,
2051+
"Update location timer");
21002052
if (ue_context_p == NULL) {
2101-
OAILOG_ERROR(
2102-
LOG_MME_APP,
2103-
"Update Location Timer expired, but no assoicated UE context found"
2104-
" for ue_id " MME_UE_S1AP_ID_FMT "\n",
2105-
mme_ue_s1ap_id);
21062053
OAILOG_FUNC_OUT(LOG_MME_APP);
21072054
}
2108-
2109-
OAILOG_ERROR(
2110-
LOG_MME_APP,
2111-
"Update Location Timer expired for ue-id" MME_UE_S1AP_ID_FMT "\n",
2112-
mme_ue_s1ap_id);
21132055
ue_context_p->ulr_response_timer.id = MME_APP_TIMER_INACTIVE_ID;
21142056

21152057
// Send PDN CONNECTIVITY FAIL message to NAS layer
@@ -2332,10 +2274,11 @@ int mme_app_handle_nas_extended_service_req(
23322274
* not when SERVICE ABORT request is received from MSC/VLR
23332275
*/
23342276
ue_context_p->sgs_context->mt_call_in_progress = true;
2277+
/* If call_cancelled is set, send Service Reject to UE as MSC/VLR
2278+
* has triggered SGSAP SERVICE ABORT procedure
2279+
*/
23352280
if (ue_context_p->sgs_context->call_cancelled) {
2336-
/* Sending Service Reject to UE as MSC/VLR has triggered
2337-
* SGSAP SERVICE ABORT
2338-
* If UE's ECM state is IDLE send
2281+
/* If UE's ECM state is IDLE send
23392282
* service_reject in Establish cnf else send in DL NAS Transport
23402283
*/
23412284
if (ue_context_p->ecm_state == ECM_IDLE) {
@@ -2418,26 +2361,15 @@ int mme_app_handle_nas_extended_service_req(
24182361
void mme_app_handle_ue_context_modification_timer_expiry(void* args)
24192362
{
24202363
OAILOG_FUNC_IN(LOG_MME_APP);
2421-
mme_app_desc_t* mme_app_desc_p = NULL;
24222364
mme_ue_s1ap_id_t mme_ue_s1ap_id = *((mme_ue_s1ap_id_t *) (args));
24232365
struct ue_mm_context_s* ue_context_p = NULL;
24242366

2425-
mme_app_desc_p = get_mme_nas_state(false);
2426-
ue_context_p = mme_ue_context_exists_mme_ue_s1ap_id(
2427-
&mme_app_desc_p->mme_ue_contexts, mme_ue_s1ap_id);
2367+
ue_context_p = mme_app_get_ue_context(
2368+
mme_ue_s1ap_id,
2369+
"UE context modification timer");
24282370
if (ue_context_p == NULL) {
2429-
OAILOG_ERROR(
2430-
LOG_MME_APP,
2431-
"UE context modification Timer expired, but no assoicated UE context "
2432-
"found for ue-id " MME_UE_S1AP_ID_FMT "\n",
2433-
mme_ue_s1ap_id);
24342371
OAILOG_FUNC_OUT(LOG_MME_APP);
24352372
}
2436-
2437-
OAILOG_ERROR(
2438-
LOG_MME_APP,
2439-
"Expired- UE context modification timer for UE id %d \n",
2440-
mme_ue_s1ap_id);
24412373
ue_context_p->ue_context_modification_timer.id = MME_APP_TIMER_INACTIVE_ID;
24422374

24432375
if (ue_context_p->sgs_context != NULL) {
@@ -3457,3 +3389,31 @@ void mme_app_update_paging_tai_list(
34573389
}
34583390
OAILOG_FUNC_OUT(LOG_MME_APP);
34593391
}
3392+
3393+
// Fetch UE context based on mme_ue_s1ap_id and return pointer to UE context
3394+
ue_mm_context_t* mme_app_get_ue_context(
3395+
mme_ue_s1ap_id_t mme_ue_s1ap_id, char* timer_name)
3396+
{
3397+
OAILOG_FUNC_IN(LOG_MME_APP);
3398+
mme_app_desc_t* mme_app_desc_p = NULL;
3399+
struct ue_mm_context_s* ue_context_p = NULL;
3400+
3401+
OAILOG_ERROR(LOG_MME_APP, "Expired- %s for ue_id " MME_UE_S1AP_ID_FMT
3402+
"\n",
3403+
timer_name,
3404+
mme_ue_s1ap_id);
3405+
3406+
mme_app_desc_p = get_mme_nas_state(false);
3407+
ue_context_p = mme_ue_context_exists_mme_ue_s1ap_id(
3408+
&mme_app_desc_p->mme_ue_contexts, mme_ue_s1ap_id);
3409+
if (ue_context_p == NULL) {
3410+
OAILOG_ERROR(
3411+
LOG_MME_APP,
3412+
"Failed to get ue context while handling %s for ue_id "
3413+
MME_UE_S1AP_ID_FMT "\n",
3414+
timer_name,
3415+
mme_ue_s1ap_id);
3416+
return NULL;
3417+
}
3418+
return ue_context_p;
3419+
}

lte/gateway/c/oai/tasks/mme_app/mme_app_context.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,21 +143,16 @@ ue_mm_context_t* mme_create_new_ue_context(void)
143143
new_p->mobile_reachability_timer.id = MME_APP_TIMER_INACTIVE_ID;
144144
new_p->implicit_detach_timer.id = MME_APP_TIMER_INACTIVE_ID;
145145

146-
new_p->initial_context_setup_rsp_timer.id = MME_APP_TIMER_INACTIVE_ID;
147-
new_p->initial_context_setup_rsp_timer.sec =
148-
MME_APP_INITIAL_CONTEXT_SETUP_RSP_TIMER_VALUE;
149-
new_p->paging_response_timer.id = MME_APP_TIMER_INACTIVE_ID;
150-
new_p->paging_response_timer.sec = MME_APP_PAGING_RESPONSE_TIMER_VALUE;
151-
new_p->ulr_response_timer.id = MME_APP_TIMER_INACTIVE_ID;
152-
new_p->ulr_response_timer.sec = MME_APP_ULR_RESPONSE_TIMER_VALUE;
153-
new_p->ue_context_modification_timer.id = MME_APP_TIMER_INACTIVE_ID;
154-
new_p->ue_context_modification_timer.sec =
155-
MME_APP_UE_CONTEXT_MODIFICATION_TIMER_VALUE;
146+
new_p->initial_context_setup_rsp_timer = (struct mme_app_timer_t) {
147+
MME_APP_TIMER_INACTIVE_ID, MME_APP_INITIAL_CONTEXT_SETUP_RSP_TIMER_VALUE};
148+
new_p->paging_response_timer = (struct mme_app_timer_t) {
149+
MME_APP_TIMER_INACTIVE_ID, MME_APP_PAGING_RESPONSE_TIMER_VALUE};
150+
new_p->ulr_response_timer = (struct mme_app_timer_t) {
151+
MME_APP_TIMER_INACTIVE_ID, MME_APP_ULR_RESPONSE_TIMER_VALUE};
152+
new_p->ue_context_modification_timer = (struct mme_app_timer_t) {
153+
MME_APP_TIMER_INACTIVE_ID, MME_APP_UE_CONTEXT_MODIFICATION_TIMER_VALUE};
156154

157155
new_p->ue_context_rel_cause = S1AP_INVALID_CAUSE;
158-
new_p->send_ue_purge_request = false;
159-
new_p->hss_initiated_detach = false;
160-
new_p->location_info_confirmed_in_hss = false;
161156
new_p->sgs_context = NULL;
162157
return new_p;
163158
}

lte/gateway/c/oai/tasks/mme_app/mme_app_defs.h

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -146,30 +146,27 @@ void mme_ue_context_update_ue_sig_connection_state(
146146
struct ue_mm_context_s *ue_context_p,
147147
ecm_state_t new_ecm_state);
148148

149-
void mme_app_handle_mobile_reachability_timer_expiry(
150-
void *args);
149+
void mme_app_handle_mobile_reachability_timer_expiry(void* args);
151150

152-
void mme_app_handle_implicit_detach_timer_expiry(
153-
void *args);
151+
void mme_app_handle_implicit_detach_timer_expiry(void* args);
154152

155-
void mme_app_handle_initial_context_setup_rsp_timer_expiry(
156-
void *args);
153+
void mme_app_handle_initial_context_setup_rsp_timer_expiry(void* args);
157154

158-
void mme_app_handle_ue_context_modification_timer_expiry(void *args);
155+
void mme_app_handle_ue_context_modification_timer_expiry(void* args);
159156

160157
void mme_app_handle_enb_reset_req(
161158
const itti_s1ap_enb_initiated_reset_req_t const *enb_reset_req);
162159

163160
int mme_app_handle_initial_paging_request(mme_app_desc_t *mme_app_desc_p,
164161
const char *imsi);
165162

166-
void mme_app_handle_paging_timer_expiry(void *args);
167-
void mme_app_handle_ulr_timer_expiry(void *args);
163+
void mme_app_handle_paging_timer_expiry(void* args);
164+
void mme_app_handle_ulr_timer_expiry(void* args);
168165

169-
void mme_app_handle_sgs_eps_detach_timer_expiry(void *args);
170-
void mme_app_handle_sgs_imsi_detach_timer_expiry(void *args);
171-
void mme_app_handle_sgs_implicit_imsi_detach_timer_expiry(void *args);
172-
void mme_app_handle_sgs_implicit_eps_detach_timer_expiry(void *args);
166+
void mme_app_handle_sgs_eps_detach_timer_expiry(void* args);
167+
void mme_app_handle_sgs_imsi_detach_timer_expiry(void* args);
168+
void mme_app_handle_sgs_implicit_imsi_detach_timer_expiry(void* args);
169+
void mme_app_handle_sgs_implicit_eps_detach_timer_expiry(void* args);
173170

174171
int mme_app_send_s6a_cancel_location_ans(
175172
int cla_result,
@@ -213,7 +210,7 @@ int send_itti_sgsap_location_update_req(ue_mm_context_t *ue_context);
213210
int mme_app_handle_sgsap_location_update_rej(mme_app_desc_t *mme_app_desc_p,
214211
itti_sgsap_location_update_rej_t *const itti_sgsap_location_update_rej);
215212

216-
void mme_app_handle_ts6_1_timer_expiry(void * args);
213+
void mme_app_handle_ts6_1_timer_expiry(void* args);
217214

218215
int mme_app_handle_sgsap_reset_indication(mme_app_desc_t *mme_app_desc_p,
219216
itti_sgsap_vlr_reset_indication_t *const reset_indication_pP);
@@ -316,6 +313,10 @@ int mme_app_create_sgs_context(ue_mm_context_t* ue_context_p);
316313

317314
int map_sgs_emm_cause(SgsRejectCause_t sgs_cause);
318315

316+
ue_mm_context_t* mme_app_get_ue_context(
317+
mme_ue_s1ap_id_t mme_ue_s1ap_id,
318+
char* timer_name);
319+
319320
#define ATTACH_REQ (1 << 0)
320321
#define TAU_REQUEST (1 << 1)
321322
#define INTIAL_CONTEXT_SETUP_PROCEDURE_FAILED 0x00

0 commit comments

Comments
 (0)