From 916455f0279a2189b2580371c1bd51e71d0621eb Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 9 Oct 2025 19:55:06 +0200 Subject: [PATCH] Move update_dlsch_buffer() into pf_dl() This slightly speeds up the scheduler (it e.g., does not need to check for UEs that have retransmissions), and harmonizes with pf_ul(), which evaluates (UL) BSR at a similar place within the scheduler. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 7a52198240..d848cf99c8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -687,6 +687,8 @@ static void pf_dl(gNB_MAC_INST *mac, continue; } + update_dlsch_buffer(pp_pdsch->frame, pp_pdsch->slot, UE); + /* Check DL buffer and skip this UE if no bytes and no TA necessary */ if (sched_ctrl->num_total_bytes == 0 && frame != (sched_ctrl->ta_frame + 100) % 1024) continue; @@ -910,11 +912,6 @@ static void nr_dlsch_preprocessor(gNB_MAC_INST *mac, post_process_pdsch_t *pp_pd for (int i = 0; i < num_beams; i++) n_rb_sched[i] = bw; - /* Retrieve amount of data to send for this UE */ - UE_iterator(mac->UE_info.connected_ue_list, UE) { - update_dlsch_buffer(pp_pdsch->frame, pp_pdsch->slot, UE); - } - int average_agg_level = 4; // TODO find a better estimation int max_sched_ues = bw / (average_agg_level * NR_NB_REG_PER_CCE);