Commit d270eae4 authored by Ding Yumei's avatar Ding Yumei

fix Assert(NPRB==0) issue

parent 5df8d199
......@@ -48,7 +48,7 @@ extern "C" {
// AssertFatal(leP!=NULL,"");
if (leP != NULL) {
free(leP);
LOG_I(TMR, "intertask_interface free_mem_block is called, after free leP is %p\n", leP);
LOG_D(TMR, "intertask_interface free_mem_block is called, after free leP is %p\n", leP);
leP = NULL; //prevent double free
} else {
LOG_I(TMR, "intertask_interface free_mem_block is called, but before free leP is NULL\n");
......
......@@ -111,6 +111,8 @@ void pre_scd_nb_rbs_required( module_id_t module_idP,
mac_rlc_status_resp_t rlc_status;
uint16_t step_size=2;
N_RB_DL = to_prb(RC.mac[module_idP]->common_channels[CC_id].mib->message.dl_Bandwidth);
int header_length_last;
int header_length_total;
if(N_RB_DL==50) step_size=3;
......@@ -123,6 +125,7 @@ void pre_scd_nb_rbs_required( module_id_t module_idP,
if (pre_scd_activeUE[UE_id] != TRUE)
continue;
header_length_total = 0;
// store dlsch buffer
// clear logical channel interface variables
UE_template.dl_buffer_total = 0;
......@@ -137,8 +140,18 @@ void pre_scd_nb_rbs_required( module_id_t module_idP,
#endif
);
UE_template.dl_buffer_total += rlc_status.bytes_in_buffer; //storing the total dlsch buffer
if(rlc_status.bytes_in_buffer > 0){
header_length_last = 1 + 1 + (rlc_status.bytes_in_buffer >= 128);
header_length_total += header_length_last;
}
}
if (header_length_total) {
header_length_total -= header_length_last;
header_length_total++;
}
UE_template.dl_buffer_total += header_length_total;
// end of store dlsch buffer
// assgin rbs required
// Calculate the number of RBs required by each UE on the basis of logical channel's buffer
......@@ -1834,7 +1847,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
}
} else { /* This is a potentially new SDU opportunity */
// 1st TB
first_TB_pdu_create_flg = 0;
ue_sched_ctl->swap_flag[CC_id][harq_pid] = 0;
rlc_status.bytes_in_buffer = 0;
......@@ -2360,6 +2373,11 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
first_TB_pdu_create_flg = 1;
}//1st TB end
else{
LOG_D(MAC,"[eNB %d][DLSCH] Frame %d Subframe %d UE_id %x/%d sdu_length_total %d header_len_dcch %d header_len_dtch %d TBS %d\n",
module_idP, frameP, subframeP, rnti, UE_id,
sdu_length_total , header_len_dcch , header_len_dtch , TBS );
}
// printf("dl sfn=%d, sf=%d, buffer=%d, TBS=%d\n", frameP, subframeP, UE_list->UE_template[CC_id][UE_id].dl_buffer_total, UE_list->eNB_UE_stats[CC_id][UE_id].TBS[select_tb]);
......
......@@ -1935,7 +1935,6 @@ void *pre_scd_thread( void *param ) {
int CC_id;
int Mod_id;
RU_t *ru = (RU_t *)param;
int ret;
// L2-emulator can work only one eNB
if( NFAPI_MODE==NFAPI_MODE_VNF)
......@@ -1945,20 +1944,15 @@ void *pre_scd_thread( void *param ) {
frame = 0;
subframe = 4;
thread_top_init("pre_scd_thread",0,870000,1000000,1000000);
thread_top_init("pre_scd_thread",1,870000,1000000,1000000);
while (!oai_exit) {
if (wait_on_condition(&ru->proc.mutex_pre_scd,&ru->proc.cond_pre_scd,&ru->proc.instance_pre_scd,"pre_scd_thread") < 0) break;
if(oai_exit) {
break;
}
AssertFatal((ret=pthread_mutex_lock(&ru->proc.mutex_pre_scd ))==0,"mutex_lock returns %d\n",ret);
if (ru->proc.instance_pre_scd < 0) {
pthread_cond_wait(&ru->proc.cond_pre_scd, &ru->proc.mutex_pre_scd);
}
AssertFatal((ret=pthread_mutex_unlock(&ru->proc.mutex_pre_scd))==0,"mutex_unlock returns %d\n",ret);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, Mod_id, ENB_FLAG_YES,
NOT_A_RNTI, frame, subframe,Mod_id);
pdcp_run(&ctxt);
......@@ -1978,9 +1972,7 @@ void *pre_scd_thread( void *param ) {
subframe++;
}
AssertFatal((ret=pthread_mutex_lock(&ru->proc.mutex_pre_scd ))==0,"mutex_lock returns %d\n",ret);
ru->proc.instance_pre_scd--;
AssertFatal((ret=pthread_mutex_unlock(&ru->proc.mutex_pre_scd))==0,"mutex_unlock returns %d\n",ret);
if (release_thread(&ru->proc.mutex_pre_scd,&ru->proc.instance_pre_scd,"pre_scd_thread") < 0) break;
}
eNB_pre_scd_status = 0;
......
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