Skip to content

Commit 1f568cf

Browse files
committed
Merge branch '11191_move_enb_context' of https://github.com/rsarwad/magma into rsarwad_move_s1ap_state_ctx
2 parents 0cd18bb + 3844c8b commit 1f568cf

File tree

7 files changed

+37
-245
lines changed

7 files changed

+37
-245
lines changed

lte/cloud/go/protos/oai/s1ap_state.pb.go

Lines changed: 16 additions & 230 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lte/gateway/c/core/oai/common/itti_free_defined_msg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ void itti_free_msg_content(MessageDef* const message_p) {
226226
e_rab_admitted_list_t e_rab_admitted_list = {};
227227
e_rab_admitted_list =
228228
message_p->ittiMsg.s1ap_handover_notify.e_rab_admitted_list;
229-
for (int idx = 0; idx < e_rab_admitted_list.no_of_items; idx++) {
229+
for (uint8_t idx = 0; idx < e_rab_admitted_list.no_of_items; idx++) {
230230
bdestroy_wrapper(
231231
&e_rab_admitted_list.item[idx].transport_layer_address);
232232
}

lte/gateway/c/core/oai/tasks/ha/ha_service_handler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ bool trigger_agw_offload_for_ue(const hash_key_t keyP, void* const elementP,
103103
EnbDescription* enb_ref_p = magma::lte::s1ap_state_get_enb(
104104
s1ap_state, ue_context_p->sctp_assoc_id_key);
105105

106+
if (!enb_ref_p) {
107+
OAILOG_ERROR_UE(LOG_UTIL, imsi64,
108+
"Failed to find enb_ref_p for assoc_id :%u",
109+
ue_context_p->sctp_assoc_id_key);
110+
return false;
111+
}
106112
// Return if this UE does not satisfy any of the filtering criteria
107113
if ((imsi64 != ue_context_p->emm_context._imsi64) &&
108114
(offload_request->eNB_id != enb_ref_p->enb_id())) {

lte/gateway/c/core/oai/tasks/s1ap/s1ap_mme_handlers.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ status_code_e s1ap_mme_generate_ue_context_release_command(
14181418
}
14191419
if (rc == RETURNok) {
14201420
// Start timer to track UE context release complete from eNB
1421-
ue_ref_p->set_s1ap_ue_state(oai::S1AP_UE_WAITING_CRR);
1421+
ue_ref_p->set_s1ap_ue_state(oai::S1AP_UE_WAITING_CRC);
14221422
ue_ref_p->mutable_s1ap_ue_context_rel_timer()->set_id(s1ap_start_timer(
14231423
ue_ref_p->s1ap_ue_context_rel_timer().msec(), TIMER_REPEAT_ONCE,
14241424
handle_ue_context_rel_timer_expiry, mme_ue_s1ap_id));
@@ -1665,7 +1665,7 @@ status_code_e s1ap_mme_handle_ue_context_release_complete(
16651665
s1ap_imsi_map_t* imsi_map = get_s1ap_imsi_map();
16661666
imsi_map->mme_ueid2imsi_map.get(mme_ue_s1ap_id, &imsi64);
16671667

1668-
ue_ref_p->set_s1ap_ue_state(oai::S1AP_UE_WAITING_CRR);
1668+
ue_ref_p->set_s1ap_ue_state(oai::S1AP_UE_WAITING_CRC);
16691669
// We can safely remove UE context now and stop timer
16701670
s1ap_mme_release_ue_context(state, ue_ref_p, imsi64);
16711671

@@ -2201,7 +2201,7 @@ status_code_e s1ap_mme_handle_handover_request_ack(
22012201
ue_ref_p->mutable_s1ap_handover_state();
22022202
handover_state->mutable_e_rab_admitted_list()->set_no_of_items(
22032203
e_rab_list.no_of_items);
2204-
for (int idx = 0; idx < e_rab_list.no_of_items; idx++) {
2204+
for (uint8_t idx = 0; idx < e_rab_list.no_of_items; idx++) {
22052205
oai::ERabAdmittedItem* e_rab_admitted_item =
22062206
handover_state->mutable_e_rab_admitted_list()->add_item();
22072207
e_rab_admitted_item->set_e_rab_id(e_rab_list.item[idx].e_rab_id);
@@ -3868,7 +3868,7 @@ void s1ap_mme_release_ue_context(s1ap_state_t* state,
38683868
message_p->ittiMsgHeader.imsi = imsi64;
38693869
send_msg_to_task(&s1ap_task_zmq_ctx, TASK_MME_APP, message_p);
38703870

3871-
if (!(ue_ref_p->s1ap_ue_state() == oai::S1AP_UE_WAITING_CRR)) {
3871+
if (!(ue_ref_p->s1ap_ue_state() == oai::S1AP_UE_WAITING_CRC)) {
38723872
OAILOG_ERROR(LOG_S1AP, "Incorrect S1AP UE state\n");
38733873
}
38743874
OAILOG_DEBUG_UE(LOG_S1AP, imsi64, "Removed S1AP UE " MME_UE_S1AP_ID_FMT "\n",
@@ -4653,7 +4653,7 @@ status_code_e s1ap_mme_handle_erab_modification_indication(
46534653

46544654
if ((ue_ref_p = s1ap_state_get_ue_mmeid((uint32_t)mme_ue_s1ap_id)) ==
46554655
nullptr) {
4656-
OAILOG_DEBUG(LOG_S1AP,
4656+
OAILOG_ERROR(LOG_S1AP,
46574657
"No UE is attached to this mme UE s1ap id: " MME_UE_S1AP_ID_FMT
46584658
" %u(10)\n",
46594659
(uint32_t)mme_ue_s1ap_id, (uint32_t)mme_ue_s1ap_id);
@@ -5063,7 +5063,7 @@ status_code_e s1ap_handle_path_switch_req_ack(
50635063

50645064
if ((ue_ref_p = s1ap_state_get_ue_mmeid(
50655065
path_switch_req_ack_p->mme_ue_s1ap_id)) == nullptr) {
5066-
OAILOG_DEBUG_UE(
5066+
OAILOG_ERROR_UE(
50675067
LOG_S1AP, imsi64,
50685068
"could not get ue context for mme_ue_s1ap_id " MME_UE_S1AP_ID_FMT "\n",
50695069
(uint32_t)path_switch_req_ack_p->mme_ue_s1ap_id);
@@ -5156,7 +5156,7 @@ status_code_e s1ap_handle_path_switch_req_failure(
51565156
mme_ue_s1ap_id = path_switch_req_failure_p->mme_ue_s1ap_id;
51575157
ue_ref_p = s1ap_state_get_ue_mmeid(mme_ue_s1ap_id);
51585158
if (ue_ref_p == nullptr) {
5159-
OAILOG_DEBUG_UE(
5159+
OAILOG_ERROR_UE(
51605160
LOG_S1AP, imsi64,
51615161
"could not get ue context for mme_ue_s1ap_id " MME_UE_S1AP_ID_FMT "\n",
51625162
mme_ue_s1ap_id);

lte/gateway/c/core/oai/tasks/s1ap/s1ap_mme_itti_messaging.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ status_code_e s1ap_mme_itti_s1ap_handover_notify(
392392
&S1AP_HANDOVER_NOTIFY(message_p).e_rab_admitted_list;
393393
e_rab_admitted_list->no_of_items =
394394
handover_state.e_rab_admitted_list().no_of_items();
395-
for (int idx = 0; idx < e_rab_admitted_list->no_of_items; idx++) {
395+
for (uint8_t idx = 0; idx < e_rab_admitted_list->no_of_items; idx++) {
396396
const oai::ERabAdmittedItem& proto_e_rab_item =
397397
handover_state.e_rab_admitted_list().item(idx);
398398
e_rab_admitted_list->item[idx].e_rab_id = proto_e_rab_item.e_rab_id();

lte/gateway/c/core/oai/tasks/s1ap/s1ap_mme_nas_procedures.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ status_code_e s1ap_mme_handle_initial_ue_message(s1ap_state_t* state,
162162

163163
OAILOG_DEBUG(LOG_S1AP, "Creating new UE Ref on S1ap");
164164

165-
ue_ref->set_s1ap_ue_state(oai::S1AP_UE_WAITING_CSR);
165+
ue_ref->set_s1ap_ue_state(oai::S1AP_UE_WAITING_ICSR);
166166

167167
ue_ref->set_enb_ue_s1ap_id(enb_ue_s1ap_id);
168168
// Will be allocated by NAS
@@ -539,11 +539,11 @@ status_code_e s1ap_generate_downlink_nas_transport(
539539

540540
out = &pdu.choice.initiatingMessage.value.choice.DownlinkNASTransport;
541541

542-
if (ue_ref->s1ap_ue_state() == oai::S1AP_UE_WAITING_CRR) {
542+
if (ue_ref->s1ap_ue_state() == oai::S1AP_UE_WAITING_CRC) {
543543
OAILOG_ERROR_UE(
544544
LOG_S1AP, imsi64,
545545
"Already triggered UE Context Release Command and UE is"
546-
"in S1AP_UE_WAITING_CRR, so dropping the DownlinkNASTransport \n");
546+
"in S1AP_UE_WAITING_CRC, so dropping the DownlinkNASTransport \n");
547547
OAILOG_FUNC_RETURN(LOG_S1AP, RETURNerror);
548548
} else {
549549
ue_ref->set_s1ap_ue_state(oai::S1AP_UE_CONNECTED);

lte/protos/oai/s1ap_state.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ message EnbDescription {
6464

6565
enum S1apUeState {
6666
S1AP_UE_INVALID_STATE = 0;
67-
S1AP_UE_WAITING_CSR = 1; ///< Waiting for Initial Context Setup Response
67+
S1AP_UE_WAITING_ICSR = 1; ///< Waiting for Initial Context Setup Response
6868
S1AP_UE_HANDOVER = 2; ///< Handover procedure triggered
6969
S1AP_UE_CONNECTED = 3; ///< UE context ready
70-
S1AP_UE_WAITING_CRR = 4; /// UE Context release Procedure initiated , waiting for
71-
/// UE context Release Complete
70+
S1AP_UE_WAITING_CRC = 4; /// UE Context release Procedure initiated , waiting for
71+
/// UE Context Release Complete
7272
}
7373

7474
message UeDescription {

0 commit comments

Comments
 (0)