Commit 44235bab authored by Vijay Chadachan's avatar Vijay Chadachan

Fixes to improve the gNB crashes

- Fixed rrcReestablishment process which caused the gNB crash
- Fixed the measeurement report processing when ue_context was null
- Work around solution to avoid the crash for the SCC multiple instances
parent 537605a6
...@@ -452,6 +452,16 @@ void nr_mac_config_scc(gNB_MAC_INST *nrmac, ...@@ -452,6 +452,16 @@ void nr_mac_config_scc(gNB_MAC_INST *nrmac,
NR_ServingCellConfigCommon_t *scc) NR_ServingCellConfigCommon_t *scc)
{ {
DevAssert(nrmac != NULL); DevAssert(nrmac != NULL);
//TODO: Firecell
// Uncomment the below line after providing a proper fix.
//AssertFatal(nrmac->common_channels[0].ServingCellConfigCommon == NULL, "logic error: multiple configurations of SCC\n");
if (nrmac->common_channels[0].ServingCellConfigCommon != NULL) {
free(nrmac->common_channels[0].ServingCellConfigCommon);
nrmac->common_channels[0].ServingCellConfigCommon = NULL;
LOG_I(NR_MAC, "Resetting Serving Cell Config\n");
}
//E.O. TODO
AssertFatal(nrmac->common_channels[0].ServingCellConfigCommon == NULL, "logic error: multiple configurations of SCC\n"); AssertFatal(nrmac->common_channels[0].ServingCellConfigCommon == NULL, "logic error: multiple configurations of SCC\n");
NR_SCHED_LOCK(&nrmac->sched_lock); NR_SCHED_LOCK(&nrmac->sched_lock);
......
...@@ -480,7 +480,7 @@ static void rrc_gNB_generate_RRCSetup(instance_t instance, ...@@ -480,7 +480,7 @@ static void rrc_gNB_generate_RRCSetup(instance_t instance,
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static int rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id_t module_id, rnti_t rnti, const int CC_id) static int rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id_t module_id, rnti_t rnti, const int CC_id, const uint8_t *MCG, int MCG_len)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
LOG_I(NR_RRC, "generate RRCSetup for RRCReestablishmentRequest \n"); LOG_I(NR_RRC, "generate RRCSetup for RRCReestablishmentRequest \n");
...@@ -495,7 +495,7 @@ static int rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id_t m ...@@ -495,7 +495,7 @@ static int rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id_t m
ue_p->xids[xid] = RRC_SETUP_FOR_REESTABLISHMENT; ue_p->xids[xid] = RRC_SETUP_FOR_REESTABLISHMENT;
NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p, true); NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p, true);
int size = do_RRCSetup(ue_context_pP, buf, xid, NULL, 0, &rrc_instance_p->configuration, SRBs); int size = do_RRCSetup(ue_context_pP, buf, xid, MCG, MCG_len, &rrc_instance_p->configuration, SRBs);
AssertFatal(size > 0, "do_RRCSetup failed\n"); AssertFatal(size > 0, "do_RRCSetup failed\n");
AssertFatal(size <= 1024, "memory corruption\n"); AssertFatal(size <= 1024, "memory corruption\n");
...@@ -1600,7 +1600,7 @@ static int nr_rrc_gNB_decode_ccch(module_id_t module_id, rnti_t rnti, const uint ...@@ -1600,7 +1600,7 @@ static int nr_rrc_gNB_decode_ccch(module_id_t module_id, rnti_t rnti, const uint
" NR_RRCReestablishmentRequest ue_Identity.physCellId(%ld) is not equal to current physCellId(%ld), fallback to RRC establishment\n", " NR_RRCReestablishmentRequest ue_Identity.physCellId(%ld) is not equal to current physCellId(%ld), fallback to RRC establishment\n",
physCellId, physCellId,
gnb_rrc_inst->carrier.physCellId); gnb_rrc_inst->carrier.physCellId);
xid = rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, rnti, 0); xid = rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, rnti, 0, du_to_cu_rrc_container, du_to_cu_rrc_container_len );
break; break;
} }
...@@ -1614,7 +1614,7 @@ static int nr_rrc_gNB_decode_ccch(module_id_t module_id, rnti_t rnti, const uint ...@@ -1614,7 +1614,7 @@ static int nr_rrc_gNB_decode_ccch(module_id_t module_id, rnti_t rnti, const uint
if (rrcReestablishmentRequest.ue_Identity.c_RNTI < 0x1 || rrcReestablishmentRequest.ue_Identity.c_RNTI > 0xffef) { if (rrcReestablishmentRequest.ue_Identity.c_RNTI < 0x1 || rrcReestablishmentRequest.ue_Identity.c_RNTI > 0xffef) {
/* c_RNTI range error should not happen */ /* c_RNTI range error should not happen */
LOG_E(NR_RRC, "NR_RRCReestablishmentRequest c_RNTI range error, fallback to RRC establishment\n"); LOG_E(NR_RRC, "NR_RRCReestablishmentRequest c_RNTI range error, fallback to RRC establishment\n");
xid = rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, rnti, 0); xid = rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, rnti, 0, du_to_cu_rrc_container, du_to_cu_rrc_container_len);
break; break;
} }
...@@ -1624,7 +1624,7 @@ static int nr_rrc_gNB_decode_ccch(module_id_t module_id, rnti_t rnti, const uint ...@@ -1624,7 +1624,7 @@ static int nr_rrc_gNB_decode_ccch(module_id_t module_id, rnti_t rnti, const uint
gNB_RRC_UE_t *UE = &ue_context_p->ue_context; gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
if (ue_context_p == NULL) { if (ue_context_p == NULL) {
LOG_E(NR_RRC, "NR_RRCReestablishmentRequest without UE context, fallback to RRC establishment\n"); LOG_E(NR_RRC, "NR_RRCReestablishmentRequest without UE context, fallback to RRC establishment\n");
xid = rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, c_rnti, 0); xid = rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, c_rnti, 0, du_to_cu_rrc_container, du_to_cu_rrc_container_len);
break; break;
} }
// c-plane not end // c-plane not end
...@@ -2029,6 +2029,11 @@ int rrc_gNB_decode_dcch(const protocol_ctxt_t *const ctxt_pP, ...@@ -2029,6 +2029,11 @@ int rrc_gNB_decode_dcch(const protocol_ctxt_t *const ctxt_pP,
break; break;
case NR_UL_DCCH_MessageType__c1_PR_measurementReport: case NR_UL_DCCH_MessageType__c1_PR_measurementReport:
if (!ue_context_p) {
LOG_E(NR_RRC, "Processing NR_measurementReport UE %lx, ue_context_p is NULL\n", ctxt_pP->rntiMaybeUEid);
break;
}
DevAssert(ul_dcch_msg != NULL DevAssert(ul_dcch_msg != NULL
&& ul_dcch_msg->message.present == NR_UL_DCCH_MessageType_PR_c1 && ul_dcch_msg->message.present == NR_UL_DCCH_MessageType_PR_c1
&& ul_dcch_msg->message.choice.c1 && ul_dcch_msg->message.choice.c1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment