From b0d505d2e8492bbee330ba8205758089d07da624 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 27 Nov 2017 11:19:12 +0100 Subject: [PATCH 1/2] bugfix: always cancel Random Access Process Even if the old UE is not found, we have to cancel the random access. --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 343d391538..421eab7cd7 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -268,6 +268,9 @@ rx_sdu(const module_id_t enb_mod_idP, "[eNB %d] Frame %d, Subframe %d CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n", enb_mod_idP, frameP, subframeP, CC_idP, rx_ces[i], i, num_ce, old_rnti, old_UE_id); + /* receiving CRNTI means that the current rnti has to go away */ + cancel_ra_proc(enb_mod_idP, CC_idP, frameP, + current_rnti); if (old_UE_id != -1) { /* TODO: if the UE did random access (followed by a MAC uplink with * CRNTI) because none of its scheduling request was granted, then @@ -288,9 +291,6 @@ rx_sdu(const module_id_t enb_mod_idP, mac_eNB_rrc_ul_in_sync(enb_mod_idP, CC_idP, frameP, subframeP, old_rnti); } - /* receiving CRNTI means that the current rnti has to go away */ - cancel_ra_proc(enb_mod_idP, CC_idP, frameP, - current_rnti); current_rnti = old_rnti; } crnti_rx = 1; From 4526622b3627a5441ab98352c0de226271daa515 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 27 Nov 2017 16:45:01 +0100 Subject: [PATCH 2/2] bugfix: don't check for physicalConfigDedicated at the wrong places physicalConfigDedicated may be legitimately NULL at some places with the current code. A cleaner solution is needed (we should always have a dedicated config, initialized with values from the 3GPP specs, not have a NULL as we do now). --- openair2/LAYER2/MAC/eNB_scheduler.c | 10 +++++----- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 13 ++++++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index f7c3f5829d..2c3b88306a 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -352,17 +352,17 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; + // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet + if (mac_eNB_get_rrc_status + (module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) + continue; + AssertFatal(UE_list-> UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n", UE_id); - // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet - if (mac_eNB_get_rrc_status - (module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) - continue; - if ((SRconfig = UE_list-> UE_template[CC_id][UE_id].physicalConfigDedicated-> diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 42c50d8063..afbb85425e 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1349,9 +1349,14 @@ fill_nfapi_harq_information(module_id_t module_idP, AssertFatal(UE_id >= 0, "UE_id cannot be found, impossible\n"); AssertFatal(UE_list != NULL, "UE_list is null\n"); +#if 0 + /* TODO: revisit, don't use Assert, it's perfectly possible to + * have physicalConfigDedicated NULL here + */ AssertFatal(UE_list->UE_template[CC_idP][UE_id]. physicalConfigDedicated != NULL, "physicalConfigDedicated for rnti %x is null\n", rntiP); +#endif harq_information->harq_information_rel11.num_ant_ports = 1; @@ -3585,11 +3590,9 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id, uint8_t *pdu; #ifdef Rel14 - AssertFatal(UE_list-> - UE_template[pCCid][UE_id].physicalConfigDedicated-> - pucch_ConfigDedicated != NULL, - "pucch_ConfigDedicated is null!\n"); - if ((UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7) + if (UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated != NULL && + UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->pucch_ConfigDedicated != NULL && + (UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7) && (UE_list->UE_template[pCCid][UE_id]. physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13) &&