Commit 5aadef2f authored by Ding Yumei's avatar Ding Yumei Committed by Haruki NAOI

Fix: rnti release leaks.

(cherry picked from commit 5a5afee71f77856875a182692e5956b3fa32f10d)

# Conflicts:
#	openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
parent 41b46e5a
......@@ -1814,7 +1814,14 @@ getNp(int dl_Bandwidth,
return(Np[dl_Bandwidth][0+plus1]);
}
//------------------------------------------------------------------------------
void
fill_nfapi_rnti_release(module_id_t module_idP,
uint16_t rntiP){
eNB_MAC_INST *eNB = RC.mac[module_idP];
eNB->UE_release_req.ue_release_request_body.ue_release_request_TLVs_list[eNB->UE_release_req.ue_release_request_body.number_of_TLVs].rnti = rntiP;
eNB->UE_release_req.ue_release_request_body.number_of_TLVs++;
}
//------------------------------------------------------------------------------
void
fill_nfapi_harq_information(module_id_t module_idP,
......@@ -4767,6 +4774,8 @@ extract_harq(module_id_t mod_idP,
}else{
if(sched_ctl->round[CC_idP][harq_pid][TB1] == 8){
cancel_ra_proc(mod_idP, CC_idP, frameP, ra[ra_i].rnti);
fill_nfapi_rnti_release(mod_idP, ra[ra_i].rnti);
LOG_E(MAC,"CRNTI Reconfiguration NACK round reach max release UE %x\n",ra[ra_i].rnti);
}
}
break;
......@@ -4862,6 +4871,8 @@ extract_harq(module_id_t mod_idP,
}else{
if(sched_ctl->round[CC_idP][harq_pid][select_tb] == 8){
cancel_ra_proc(mod_idP, CC_idP, frameP, ra[ra_i].rnti);
fill_nfapi_rnti_release(mod_idP, ra[ra_i].rnti);
LOG_E(MAC,"CRNTI Reconfiguration NACK round reach max release UE %x\n",ra[ra_i].rnti);
}
}
break;
......
......@@ -326,15 +326,17 @@ rx_sdu(const module_id_t enb_mod_idP,
first_rb = ra->msg3_first_rb;
if (sduP == NULL) { // we've got an error on Msg3
LOG_D(MAC, "[eNB %d] CC_id %d, RA %d ULSCH in error in round %d/%d\n",
LOG_D(MAC, "[eNB %d] CC_id %d,frame %d subframe %d RA %d ULSCH in error in round %d/%d rnti %x\n",
enb_mod_idP,
CC_idP,
CC_idP, frameP, subframeP,
RA_id,
ra->msg3_round,
(int) mac->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx);
(int) mac->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx,current_rnti);
if (ra->msg3_round >= mac->common_channels[CC_idP].radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx - 1) {
cancel_ra_proc(enb_mod_idP, CC_idP, frameP, current_rnti);
fill_nfapi_rnti_release(enb_mod_idP, current_rnti);
LOG_E(MAC,"frame %d subframe %d rnti %x : Msg3 max Tx,release UE\n",frameP, subframeP,current_rnti);
nfapi_hi_dci0_request_t *hi_dci0_req = NULL;
uint8_t sf_ahead_dl = ul_subframe2_k_phich(&mac->common_channels[CC_idP], subframeP);
hi_dci0_req = &mac->HI_DCI0_req[CC_idP][(subframeP + sf_ahead_dl) % 10];
......@@ -559,13 +561,16 @@ rx_sdu(const module_id_t enb_mod_idP,
LOG_E(MAC, "mac_rrc_data_ind failed, ret == -2\n");
return;
}else {
LOG_E(MAC, "mac_rrc_data_ind failed, ret %d frame %d subframe %d rnti %d\n",ret,frameP,subframeP,current_rnti);
cancel_ra_proc(enb_mod_idP, CC_idP, frameP, current_rnti);
fill_nfapi_rnti_release(enb_mod_idP, current_rnti);
}
// break;
}
}
} else {
cancel_ra_proc(enb_mod_idP, CC_idP, frameP, current_rnti);
fill_nfapi_rnti_release(enb_mod_idP, current_rnti);
LOG_W(MAC, "[MAC] Can't find old UE_id\n");
}
......@@ -753,6 +758,7 @@ rx_sdu(const module_id_t enb_mod_idP,
)) == -1) {
LOG_E(MAC,"[MAC][eNB] Max user count reached\n");
cancel_ra_proc(enb_mod_idP, CC_idP, frameP, current_rnti); // send Connection Reject ???
fill_nfapi_rnti_release(enb_mod_idP, current_rnti);
break;
// kill RA proc
} else {
......
......@@ -1220,6 +1220,10 @@ void program_dlsch_acknak(module_id_t module_idP, int CC_idP, int UE_idP,
frame_t frameP, sub_frame_t subframeP,
uint8_t cce_idx);
void
fill_nfapi_rnti_release(module_id_t module_idP,
uint16_t rntiP);
void fill_nfapi_dlsch_config(eNB_MAC_INST * eNB,
nfapi_dl_config_request_body_t * dl_req,
uint16_t length, int16_t pdu_index,
......
......@@ -1155,8 +1155,6 @@ void put_UE_in_freelist(module_id_t mod_id, rnti_t rnti, boolean_t removeFlag) {
free_list->UE_free_ctrl[free_list->tail_freelist].rnti = rnti;
free_list->UE_free_ctrl[free_list->tail_freelist].removeContextFlg = removeFlag;
free_list->num_UEs++;
eNB_MAC->UE_release_req.ue_release_request_body.ue_release_request_TLVs_list[eNB_MAC->UE_release_req.ue_release_request_body.number_of_TLVs].rnti = rnti;
eNB_MAC->UE_release_req.ue_release_request_body.number_of_TLVs++;
free_list->tail_freelist = (free_list->tail_freelist + 1) % (NUMBER_OF_UE_MAX+1);
pthread_mutex_unlock(&lock_ue_freelist);
}
......@@ -1196,6 +1194,8 @@ void release_UE_in_freeList(module_id_t mod_id) {
remove_UEContext = eNB_MAC->UE_free_list.UE_free_ctrl[ue_num].removeContextFlg;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, mod_id, ENB_FLAG_YES, rnti, 0, 0,mod_id);
fill_nfapi_rnti_release(mod_id, rnti);
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
eNB_PHY = RC.eNB[mod_id][CC_id];
......
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