From a6fb797477b4ca66033494472945799cfeb64864 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Wed, 22 May 2024 11:18:10 +0200 Subject: [PATCH] improve tracking of sched_ul_bytes in nr_rx_sdu() by using sdu_lenP instead of sched_pusch.tb_size sched_ul_bytes tracks the volume of in-flight data. When data is successfully received, sched_ul_bytes is decreased in nr_rx_sdu(). In case of reusing HARQ processes, the tb_size stored there is not correct. Therefore use the actual SDU size instead. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 094d7aafe5..610a58deb3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -749,8 +749,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, LOG_D(NR_MAC, "Received PDU at MAC gNB \n"); UE->UE_sched_ctrl.pusch_consecutive_dtx_cnt = 0; - const uint32_t tb_size = UE_scheduling_control->ul_harq_processes[harq_pid].sched_pusch.tb_size; - UE_scheduling_control->sched_ul_bytes -= tb_size; + UE_scheduling_control->sched_ul_bytes -= sdu_lenP; if (UE_scheduling_control->sched_ul_bytes < 0) UE_scheduling_control->sched_ul_bytes = 0;