From 508798299751c41235f6885a3d9901d00b3ff26d Mon Sep 17 00:00:00 2001 From: Laurent Thomas <lts@open-cells.com> Date: Fri, 16 Sep 2022 11:28:00 +0200 Subject: [PATCH] fix encoding error in mbms by regrouping the missing barrier at a single level tmp --- openair1/PHY/LTE_TRANSPORT/dlsch_coding.c | 97 ++++++---------- openair1/PHY/LTE_TRANSPORT/transport_proto.h | 37 ------ openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 7 +- openair1/PHY/defs_eNB.h | 9 +- openair1/SCHED/phy_procedures_lte_eNb.c | 26 +---- openair1/SIMULATION/LTE_PHY/dlsim.c | 4 +- openair1/SIMULATION/LTE_PHY/ulsim.c | 6 +- openair2/LAYER2/MAC/eNB_scheduler_mch.c | 113 ++++++++++--------- targets/RT/USER/lte-enb.c | 6 - targets/RT/USER/lte-softmodem.c | 10 +- 10 files changed, 104 insertions(+), 211 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index a5aff0974eb..b658dc10437 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -245,43 +245,6 @@ void *te_thread(void *param) { return(NULL); } -int dlsch_encoding_all(PHY_VARS_eNB *eNB, - L1_rxtx_proc_t *proc, - unsigned char *a, - uint8_t num_pdcch_symbols, - LTE_eNB_DLSCH_t *dlsch, - int frame, - uint8_t subframe, - time_stats_t *rm_stats, - time_stats_t *te_stats, - time_stats_t *te_wait_stats, - time_stats_t *te_main_stats, - time_stats_t *te_wakeup_stats0, - time_stats_t *te_wakeup_stats1, - time_stats_t *i_stats) { - uint8_t harq_pid = dlsch->harq_ids[frame%2][subframe]; - if(harq_pid >= dlsch->Mdlharq) { - LOG_E(PHY,"dlsch_encoding_all illegal harq_pid %d\n", harq_pid); - return(-1); - } - - LOG_D(PHY,"B %d, harq_pid %d\n", - dlsch->harq_processes[harq_pid]->B, - dlsch->harq_ids[frame%2][subframe]); - - return dlsch_encoding(eNB, - proc, - a, - num_pdcch_symbols, - dlsch, - frame, - subframe, - rm_stats, - te_stats, - i_stats); - -} - static void TPencode(void * arg) { turboEncode_t * rdata=(turboEncode_t *) arg; unsigned char harq_pid = rdata->harq_pid; @@ -358,8 +321,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, num_pdcch_symbols, frame,subframe,beamforming_mode); - proc->nbEncode=0; - + int nbEncode = 0; // if (hadlsch->Ndi == 1) { // this is a new packet if (hadlsch->round == 0) { // this is a new packet @@ -386,11 +348,13 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, &hadlsch->F)<0) return(-1); } - + + notifiedFIFO_t respEncode; + initNotifiedFIFO(&respEncode); for (int r=0, r_offset=0; r<hadlsch->C; r++) { union turboReqUnion id= {.s={dlsch->rnti,frame,subframe,r,0}}; - notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(turboEncode_t), id.p, proc->respEncode, TPencode); + notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(turboEncode_t), id.p, &respEncode, TPencode); turboEncode_t * rdata=(turboEncode_t *) NotifiedFifoData(req); rdata->input=hadlsch->c[r]; rdata->Kr_bytes= ( r<hadlsch->Cminus ? hadlsch->Kminus : hadlsch->Kplus) >>3; @@ -404,15 +368,10 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, rdata->round=hadlsch->round; rdata->r_offset=r_offset; rdata->G=G; - - if ( proc->threadPool->activated ) { - pushTpool(proc->threadPool,req); - proc->nbEncode++; - } else { - TPencode(rdata); - delNotifiedFIFO_elt(req); - } - + + pushTpool(proc->threadPool, req); + nbEncode++; + int Qm=hadlsch->Qm; int C=hadlsch->C; int Nl=hadlsch->Nl; @@ -423,6 +382,14 @@ int dlsch_encoding(PHY_VARS_eNB *eNB, else r_offset += Nl*Qm * ((GpmodC==0?0:1) + (Gp/C)); } + // Wait all other threads finish to process + while (nbEncode) { + notifiedFIFO_elt_t *res = pullTpool(&respEncode, proc->threadPool); + if (res == NULL) + break; // Tpool has been stopped + delNotifiedFIFO_elt(res); + nbEncode--; + } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_OUT); return(0); } @@ -462,8 +429,6 @@ int dlsch_encoding_fembms_pmch(PHY_VARS_eNB *eNB, num_pdcch_symbols, frame,subframe,beamforming_mode); - proc->nbEncode=0; - // if (hadlsch->Ndi == 1) { // this is a new packet if (hadlsch->round == 0) { // this is a new packet // Add 24-bit crc (polynomial A) to payload @@ -489,11 +454,13 @@ int dlsch_encoding_fembms_pmch(PHY_VARS_eNB *eNB, &hadlsch->F)<0) return(-1); } - + int nbEncode = 0; + notifiedFIFO_t respEncode; + initNotifiedFIFO(&respEncode); for (int r=0, r_offset=0; r<hadlsch->C; r++) { union turboReqUnion id= {.s={dlsch->rnti,frame,subframe,r,0}}; - notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(turboEncode_t), id.p, proc->respEncode, TPencode); + notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(turboEncode_t), id.p, &respEncode, TPencode); turboEncode_t * rdata=(turboEncode_t *) NotifiedFifoData(req); rdata->input=hadlsch->c[r]; rdata->Kr_bytes= ( r<hadlsch->Cminus ? hadlsch->Kminus : hadlsch->Kplus) >>3; @@ -507,15 +474,10 @@ int dlsch_encoding_fembms_pmch(PHY_VARS_eNB *eNB, rdata->round=hadlsch->round; rdata->r_offset=r_offset; rdata->G=G; - - if ( proc->threadPool->activated ) { - pushTpool(proc->threadPool,req); - proc->nbEncode++; - } else { - TPencode(rdata); - delNotifiedFIFO_elt(req); - } - + + pushTpool(proc->threadPool, req); + nbEncode++; + int Qm=hadlsch->Qm; int C=hadlsch->C; int Nl=hadlsch->Nl; @@ -526,7 +488,14 @@ int dlsch_encoding_fembms_pmch(PHY_VARS_eNB *eNB, else r_offset += Nl*Qm * ((GpmodC==0?0:1) + (Gp/C)); } - + // Wait all other threads finish to process + while (nbEncode) { + notifiedFIFO_elt_t *res = pullTpool(&respEncode, proc->threadPool); + if (res == NULL) + break; // Tpool has been stopped + delNotifiedFIFO_elt(res); + nbEncode--; + } return(0); } diff --git a/openair1/PHY/LTE_TRANSPORT/transport_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_proto.h index 1fbd1266d76..c4f49823dff 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_proto.h @@ -72,21 +72,6 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch); LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag); -int dlsch_encoding_all(PHY_VARS_eNB *eNB, - L1_rxtx_proc_t *proc, - unsigned char *a, - uint8_t num_pdcch_symbols, - LTE_eNB_DLSCH_t *dlsch, - int frame, - uint8_t subframe, - time_stats_t *rm_stats, - time_stats_t *te_stats, - time_stats_t *te_wait_stats, - time_stats_t *te_main_stats, - time_stats_t *te_wakeup_stats0, - time_stats_t *te_wakeup_stats1, - time_stats_t *i_stats); - /** \fn dlsch_encoding(PHY_VARS_eNB *eNB, uint8_t *input_buffer, LTE_DL_FRAME_PARMS *frame_parms, @@ -543,15 +528,6 @@ void rx_ulsch(PHY_VARS_eNB *eNB, L1_rxtx_proc_t *proc, uint8_t UE_id); - -int ulsch_decoding_data_all(PHY_VARS_eNB *eNB, - - L1_rxtx_proc_t *proc, - int UE_id, - int harq_pid, - int llr8_flag); - - /*! \brief Decoding of PUSCH/ACK/RI/ACK from 36-212. @param phy_vars_eNB Pointer to eNB top-level descriptor @@ -570,19 +546,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, uint8_t Nbundled, uint8_t llr8_flag); -/*! - \brief Decoding of ULSCH data component from 36-212. This one spawns 1 worker thread in parallel,half of the segments in each thread. - @param phy_vars_eNB Pointer to eNB top-level descriptor - @param UE_id ID of UE transmitting this PUSCH - @param harq_pid HARQ process ID - @param llr8_flag If 1, indicate that the 8-bit turbo decoder should be used - @returns 0 on success -*/ -int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB, - int UE_id, - int harq_pid, - int llr8_flag); - /*! \brief Decoding of ULSCH data component from 36-212. This one is single thread. @param phy_vars_eNB Pointer to eNB top-level descriptor diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index f71ca76b714..5a203ab3316 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -367,11 +367,6 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB, L1_rxtx_proc_t *proc, return(ret); } -int ulsch_decoding_data_all(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, - int UE_id,int harq_pid,int llr8_flag) { - return ulsch_decoding_data(eNB,proc,UE_id,harq_pid,llr8_flag); -} - static inline unsigned int lte_gold_unscram(unsigned int *x1, unsigned int *x2, unsigned char reset) __attribute__((always_inline)); static inline unsigned int lte_gold_unscram(unsigned int *x1, unsigned int *x2, unsigned char reset) { int n; @@ -1116,7 +1111,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB, LOG_D(PHY,"frame %d subframe %d O_ACK:%d o_ACK[]=%d:%d:%d:%d\n",frame,subframe,ulsch_harq->O_ACK,ulsch_harq->o_ACK[0],ulsch_harq->o_ACK[1],ulsch_harq->o_ACK[2],ulsch_harq->o_ACK[3]); // Do ULSCH Decoding for data portion - ret = ulsch_decoding_data_all(eNB,proc, UE_id,harq_pid,llr8_flag); + ret = ulsch_decoding_data(eNB, proc, UE_id, harq_pid, llr8_flag); return(ret); } diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h index d5ad705f4e0..b7d9cd4473e 100644 --- a/openair1/PHY/defs_eNB.h +++ b/openair1/PHY/defs_eNB.h @@ -253,11 +253,9 @@ typedef struct { /// mutex for RXn-TXnp4 processing thread pthread_mutex_t mutex_RUs; tpool_t *threadPool; - int nbEncode; int nbDecode; - notifiedFIFO_t *respEncode; notifiedFIFO_t *respDecode; - pthread_mutex_t mutex_emulateRF; + pthread_mutex_t mutex_emulateRF; int instance_cnt_emulateRF; pthread_t pthread_emulateRF; pthread_attr_t attr_emulateRF; @@ -731,11 +729,6 @@ typedef struct PHY_VARS_eNB_s { time_stats_t dlsch_turbo_encoding_preperation_stats; time_stats_t dlsch_turbo_encoding_segmentation_stats; time_stats_t dlsch_turbo_encoding_stats; - time_stats_t dlsch_turbo_encoding_waiting_stats; - time_stats_t dlsch_turbo_encoding_signal_stats; - time_stats_t dlsch_turbo_encoding_main_stats; - time_stats_t dlsch_turbo_encoding_wakeup_stats0; - time_stats_t dlsch_turbo_encoding_wakeup_stats1; time_stats_t dlsch_interleaving_stats; time_stats_t rx_dft_stats; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index db03a9dc437..759162eda4f 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -413,33 +413,9 @@ bool dlsch_procedures(PHY_VARS_eNB *eNB, } start_meas(&eNB->dlsch_encoding_stats); - dlsch_encoding_all(eNB, - proc, - dlsch_harq->pdu, - dlsch_harq->pdsch_start, - dlsch, - frame, - subframe, - &eNB->dlsch_rate_matching_stats, - &eNB->dlsch_turbo_encoding_stats, - &eNB->dlsch_turbo_encoding_waiting_stats, - &eNB->dlsch_turbo_encoding_main_stats, - &eNB->dlsch_turbo_encoding_wakeup_stats0, - &eNB->dlsch_turbo_encoding_wakeup_stats1, - &eNB->dlsch_interleaving_stats); + dlsch_encoding(eNB, proc, dlsch_harq->pdu, dlsch_harq->pdsch_start, dlsch, frame, subframe, &eNB->dlsch_rate_matching_stats, &eNB->dlsch_turbo_encoding_stats, &eNB->dlsch_interleaving_stats); stop_meas(&eNB->dlsch_encoding_stats); - if ( proc->threadPool->activated ) { - // Wait all other threads finish to process - while (proc->nbEncode) { - notifiedFIFO_elt_t *res = pullTpool(proc->respEncode, proc->threadPool); - if (res == NULL) - break; // Tpool has been stopped - delNotifiedFIFO_elt(res); - proc->nbEncode--; - } - } - if(eNB->dlsch_encoding_stats.p_time>500*3000 && opp_enabled == 1) { print_meas_now(&eNB->dlsch_encoding_stats,"total coding",stderr); } diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 8aff47c86b8..fef67c3b920 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -1306,11 +1306,9 @@ int main(int argc, char **argv) { } L1_rxtx_proc_t *proc_eNB = &eNB->proc.L1_proc; - proc_eNB->threadPool=(tpool_t*)malloc(sizeof(tpool_t)); - proc_eNB->respEncode=(notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + proc_eNB->threadPool = (tpool_t *)malloc(sizeof(tpool_t)); proc_eNB->respDecode=(notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); initTpool("n", proc_eNB->threadPool, true); - initNotifiedFIFO(proc_eNB->respEncode); initNotifiedFIFO(proc_eNB->respDecode); proc_eNB->frame_tx=0; diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 0f98eb337a6..c8b4d0197d7 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -814,11 +814,9 @@ int main(int argc, char **argv) { proc_rxtx_ue->frame_rx = (subframe<4)?(proc_rxtx->frame_tx-1):(proc_rxtx->frame_tx); proc_rxtx_ue->subframe_tx = proc_rxtx->subframe_rx; proc_rxtx_ue->subframe_rx = (proc_rxtx->subframe_tx+6)%10; - proc_rxtx->threadPool=(tpool_t*)malloc(sizeof(tpool_t)); - proc_rxtx->respEncode=(notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + proc_rxtx->threadPool = (tpool_t *)malloc(sizeof(tpool_t)); proc_rxtx->respDecode=(notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); - initTpool("n",proc_rxtx->threadPool, true); - initNotifiedFIFO(proc_rxtx->respEncode); + initTpool("n", proc_rxtx->threadPool, true); initNotifiedFIFO(proc_rxtx->respDecode); printf("Init UL hopping UE\n"); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_mch.c b/openair2/LAYER2/MAC/eNB_scheduler_mch.c index 1272b16ec06..6567500ac52 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_mch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_mch.c @@ -708,12 +708,12 @@ schedule_MBMS_NFAPI(module_id_t module_idP, uint8_t CC_id, frame_t frameP, uint16_t msi_control_element[29], *msi_ptr; // MSI buffer pointer char *buffer_pointer=NULL; - if (msi_flag == 1) { - // Create MSI here - msi_ptr = &msi_control_element[0]; + if (msi_flag == 1 && cc->mbms_SessionList) { + // Create MSI here + msi_ptr = &msi_control_element[0]; - //Header for MTCHs - num_mtch = cc->mbms_SessionList[mbms_mch_i]->list.count; + // Header for MTCHs + num_mtch = cc->mbms_SessionList[mbms_mch_i]->list.count; TBS = get_TBS_DL(cc->MCH_pdu.mcs, to_prb(cc->mib->message.dl_Bandwidth)); @@ -867,52 +867,63 @@ schedule_MBMS_NFAPI(module_id_t module_idP, uint8_t CC_id, frame_t frameP, //if ((i == 0) && ((RC.mac[module_idP]->MBMS_flag != multicast_relay) || (RC.mac[module_idP]->mcch_active==0))) { // there is MTCHs, loop if there are more than 1 - if (mtch_flag == 1 ) { - // Calculate TBS - // get MTCH data from RLC (like for DTCH) - LOG_D(MAC,"[eNB %d] CC_id %d Frame %d subframeP %d: Schedule MTCH (area %d, sfAlloc %d)\n", - module_idP, CC_id, frameP, subframeP, i, j); - - header_len_mtch = 3; - LOG_D(MAC,"[eNB %d], CC_id %d, Frame %d, MTCH->MCH, Checking RLC status (rab %d, tbs %d, len %d)\n", - module_idP, CC_id, frameP, MTCH, TBS, - TBS - header_len_mcch - header_len_msi - sdu_length_total - - header_len_mtch); - - //TODO - mbms_rab_id = cc->mbms_SessionList[0/*mbms_mch_i*/]->list.array[0]->logicalChannelIdentity_r9; - - rlc_status = - mac_rlc_status_ind(module_idP, 0xfffd, frameP, subframeP, - module_idP, ENB_FLAG_YES, MBMS_FLAG_YES, - cc->mbms_SessionList[mbms_mch_i]->list.array[0]->logicalChannelIdentity_r9, - //MTCH, - 0, 0 - ); - - bytes_in_buffer = rlc_status.bytes_in_buffer; - - //TOCHECK is this really neede? - if( !(mcch_flag==1 || msi_flag==1) ) - msi_sfs = rlc_status.bytes_in_buffer/(TBS- header_len_mcch - header_len_msi -sdu_length_total - header_len_mtch)+(rlc_status.bytes_in_buffer%(TBS- header_len_mcch - header_len_msi -sdu_length_total - header_len_mtch)?1:0); - - uint16_t TBS_MTCH = - get_TBS_DL(cc->pmch_Config[mbms_mch_i]->dataMCS_r9, to_prb(cc->mib->message.dl_Bandwidth)); - - if(msi_flag==1 && buffer_pointer!=NULL){ - // msi_ptr = &msi_control_element[0]; - - msi_pmch_stop = (rlc_status.bytes_in_buffer - header_len_mcch - header_len_msi -sdu_length_total - header_len_mtch)/(TBS_MTCH/*- header_len_mcch - header_len_msi -sdu_length_total*/ - header_len_mtch)+((rlc_status.bytes_in_buffer-TBS-header_len_mcch - header_len_msi -sdu_length_total)%(TBS_MTCH/*- header_len_mcch - header_len_msi -sdu_length_total*/ - header_len_mtch)?0:0); - - for (k = 0; k < num_mtch; k++) { // loop for all session in this MCH (MCH[0]) at this moment - msi_ptr = &msi_control_element[k]; - - ((MSI_ELEMENT *) msi_ptr)->lcid = cc->mbms_SessionList[mbms_mch_i]->list.array[k]->logicalChannelIdentity_r9; //mtch_lcid; - - if( msi_pmch_stop > cc->pmch_Config[mbms_mch_i]->sf_AllocEnd_r9) - LOG_E(MAC,"e-MBMS Buffer Overflow\n"); - - if(msi_pmch_stop>=num_sf_alloc /*&& msi_pmch_stop <=cc->pmch_Config[0]->sf_AllocEnd_r9*/) { + // BAd race condition: all this struct is filled by another thread, no mutex or any code to make it coherent + if (mtch_flag == 1 && cc->mbms_SessionList && cc->mbms_SessionList[0] && cc->mbms_SessionList[0]->list.array[0]) { + // Calculate TBS + // get MTCH data from RLC (like for DTCH) + LOG_D(MAC, "[eNB %d] CC_id %d Frame %d subframeP %d: Schedule MTCH (area %d, sfAlloc %d)\n", module_idP, CC_id, frameP, subframeP, i, j); + + header_len_mtch = 3; + LOG_D(MAC, + "[eNB %d], CC_id %d, Frame %d, MTCH->MCH, Checking RLC status (rab %d, tbs %d, len %d)\n", + module_idP, + CC_id, + frameP, + MTCH, + TBS, + TBS - header_len_mcch - header_len_msi - sdu_length_total - header_len_mtch); + + // TODO + mbms_rab_id = cc->mbms_SessionList[0 /*mbms_mch_i*/]->list.array[0]->logicalChannelIdentity_r9; + + rlc_status = mac_rlc_status_ind(module_idP, + 0xfffd, + frameP, + subframeP, + module_idP, + ENB_FLAG_YES, + MBMS_FLAG_YES, + cc->mbms_SessionList[mbms_mch_i]->list.array[0]->logicalChannelIdentity_r9, + // MTCH, + 0, + 0); + + bytes_in_buffer = rlc_status.bytes_in_buffer; + + // TOCHECK is this really neede? + if (!(mcch_flag == 1 || msi_flag == 1)) + msi_sfs = rlc_status.bytes_in_buffer / (TBS - header_len_mcch - header_len_msi - sdu_length_total - header_len_mtch) + + (rlc_status.bytes_in_buffer % (TBS - header_len_mcch - header_len_msi - sdu_length_total - header_len_mtch) ? 1 : 0); + + uint16_t TBS_MTCH = get_TBS_DL(cc->pmch_Config[mbms_mch_i]->dataMCS_r9, to_prb(cc->mib->message.dl_Bandwidth)); + + if (msi_flag == 1 && buffer_pointer != NULL) { + // msi_ptr = &msi_control_element[0]; + + msi_pmch_stop = + (rlc_status.bytes_in_buffer - header_len_mcch - header_len_msi - sdu_length_total - header_len_mtch) / (TBS_MTCH /*- header_len_mcch - header_len_msi -sdu_length_total*/ - header_len_mtch) + + ((rlc_status.bytes_in_buffer - TBS - header_len_mcch - header_len_msi - sdu_length_total) % (TBS_MTCH /*- header_len_mcch - header_len_msi -sdu_length_total*/ - header_len_mtch) ? 0 + : 0); + + for (k = 0; k < num_mtch; k++) { // loop for all session in this MCH (MCH[0]) at this moment + msi_ptr = &msi_control_element[k]; + + ((MSI_ELEMENT *)msi_ptr)->lcid = cc->mbms_SessionList[mbms_mch_i]->list.array[k]->logicalChannelIdentity_r9; // mtch_lcid; + + if (msi_pmch_stop > cc->pmch_Config[mbms_mch_i]->sf_AllocEnd_r9) + LOG_E(MAC, "e-MBMS Buffer Overflow\n"); + + if (msi_pmch_stop >= num_sf_alloc /*&& msi_pmch_stop <=cc->pmch_Config[0]->sf_AllocEnd_r9*/) { ((MSI_ELEMENT *) msi_ptr)->stop_sf_MSB = (((msi_pmch_stop <=cc->pmch_Config[mbms_mch_i]->sf_AllocEnd_r9 ? msi_pmch_stop: cc->pmch_Config[mbms_mch_i]->sf_AllocEnd_r9) >> 8) & 0x7f); ((MSI_ELEMENT *) msi_ptr)->stop_sf_LSB = ((msi_pmch_stop <=cc->pmch_Config[mbms_mch_i]->sf_AllocEnd_r9 ? msi_pmch_stop: cc->pmch_Config[mbms_mch_i]->sf_AllocEnd_r9) & 0xff); msi_pmch_stop = (msi_pmch_stop <=cc->pmch_Config[mbms_mch_i]->sf_AllocEnd_r9 ? msi_pmch_stop: cc->pmch_Config[mbms_mch_i]->sf_AllocEnd_r9); diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index b99d97a1806..76715b669f2 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -326,7 +326,6 @@ static void *L1_thread_tx(void *param) { //wait_sync("tx_thread"); - proc->respEncode = eNB->proc.L1_proc.respEncode; while (!oai_exit) { LOG_D(PHY,"Waiting for TX (IC %d)\n",proc->instance_cnt); @@ -835,14 +834,9 @@ static void *process_stats_thread(void *param) { print_meas(&eNB->dlsch_turbo_encoding_preperation_stats,"dlsch_coding_crc",NULL,NULL); print_meas(&eNB->dlsch_turbo_encoding_segmentation_stats,"dlsch_segmentation",NULL,NULL); print_meas(&eNB->dlsch_encoding_stats,"dlsch_encoding",NULL,NULL); - print_meas(&eNB->dlsch_turbo_encoding_signal_stats,"coding_signal",NULL,NULL); - print_meas(&eNB->dlsch_turbo_encoding_main_stats,"coding_main",NULL,NULL); print_meas(&eNB->dlsch_turbo_encoding_stats,"turbo_encoding",NULL,NULL); print_meas(&eNB->dlsch_interleaving_stats,"turbo_interleaving",NULL,NULL); print_meas(&eNB->dlsch_rate_matching_stats,"turbo_rate_matching",NULL,NULL); - print_meas(&eNB->dlsch_turbo_encoding_waiting_stats,"coding_wait",NULL,NULL); - print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats0,"coding_worker_0",NULL,NULL); - print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats1,"coding_worker_1",NULL,NULL); } print_meas(&eNB->dlsch_modulation_stats,"dlsch_modulation",NULL,NULL); diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index b1275e5dd5b..0b826555317 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -645,18 +645,14 @@ int main ( int argc, char **argv ) for (int CC_id=0; CC_id<RC.nb_L1_CC[x]; CC_id++) { L1_rxtx_proc_t *L1proc= &RC.eNB[x][CC_id]->proc.L1_proc; L1_rxtx_proc_t *L1proctx= &RC.eNB[x][CC_id]->proc.L1_proc_tx; - L1proc->threadPool=(tpool_t*)malloc(sizeof(tpool_t)); - L1proc->respEncode=(notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + L1proc->threadPool = (tpool_t *)malloc(sizeof(tpool_t)); L1proc->respDecode=(notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); if ( strlen(get_softmodem_params()->threadPoolConfig) > 0 ) initTpool(get_softmodem_params()->threadPoolConfig, L1proc->threadPool, true); else - initTpool("n", L1proc->threadPool, true); - initNotifiedFIFO(L1proc->respEncode); + initTpool("n", L1proc->threadPool, true); initNotifiedFIFO(L1proc->respDecode); - L1proctx->threadPool=L1proc->threadPool; - L1proctx->respEncode=L1proc->respEncode; - L1proctx->nbEncode=L1proc->nbEncode; + L1proctx->threadPool = L1proc->threadPool; } -- GitLab