From caac4157c730e1af8bf828a14026ee818396b48e Mon Sep 17 00:00:00 2001 From: Bartosz Podrygajlo Date: Fri, 8 Nov 2024 13:09:32 +0100 Subject: [PATCH] Fix a small bug with total_res in gNB PUSCH symbol processing Replaced total_res with res_per_task when deciding whether to start a threadpool task or not. This does not have big impact on the software as the nr_pusch_symbol_processing will recheck ul_valid_re_per_slot anyway but it may reduce the number of thread pool tasks created. --- openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c index 82407980fe..6a57c1eafe 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c @@ -1486,14 +1486,16 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, int total_res = 0; for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < end_symbol; symbol += numSymbols) { + int res_per_task = 0; for (int s = 0; s < numSymbols; s++) { pusch_vars->ul_valid_re_per_slot[symbol+s] = get_nb_re_pusch(frame_parms,rel15_ul,symbol+s); pusch_vars->llr_offset[symbol+s] = ((symbol+s) == rel15_ul->start_symbol_index) ? 0 : pusch_vars->llr_offset[symbol+s-1] + pusch_vars->ul_valid_re_per_slot[symbol+s-1] * rel15_ul->qam_mod_order; - total_res+=pusch_vars->ul_valid_re_per_slot[symbol+s]; + res_per_task += pusch_vars->ul_valid_re_per_slot[symbol + s]; } - if (total_res > 0) { + total_res += res_per_task; + if (res_per_task > 0) { union puschSymbolReqUnion id = {.s={ulsch_id,frame,slot,0}}; id.p=1+symbol; notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(puschSymbolProc_t), id.p, &gNB->respPuschSymb, &nr_pusch_symbol_processing); // create a job for Tpool