From 0360175042ca020e0475d4ecceed398ea86c8f1e Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 24 Nov 2025 13:04:02 +0100 Subject: [PATCH] Use UL functions for Qm/R determination During refactoring, the wrong functions and correspondingly tables have been used to calculate UL TB size. Fix through correct functions. This should fix these error messages: 3624774.778195 [MAC] E (nr_get_Qm_dl:2034) Invalid MCS table index 3 (expected in range [0,2]) 3624774.778207 [MAC] E (nr_get_code_rate_dl:2066) Invalid MCS table index 3 (expected in range [0,2]) 3624774.778211 [NR_MAC] E (nr_compute_tbs:63) Error in compute TBS with a NULL input, returning NULL TBS Fixes: 9449f777ccd2 ("Remove TBS table and recompute on demand") --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 4 ++-- 1 file changed, 2 insertions(+), 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 3f546d41b4..a9b68b4dab 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -2081,8 +2081,8 @@ static int pf_ul(gNB_MAC_INST *nrmac, /* Create UE_sched for UEs eligibale for new data transmission*/ /* Calculate coefficient*/ - const uint8_t Qm = nr_get_Qm_dl(selected_mcs, current_BWP->mcs_table); - const uint16_t R = nr_get_code_rate_dl(selected_mcs, current_BWP->mcs_table); + const uint8_t Qm = nr_get_Qm_ul(selected_mcs, current_BWP->mcs_table); + const uint16_t R = nr_get_code_rate_ul(selected_mcs, current_BWP->mcs_table); const uint32_t tbs = nr_compute_tbs(Qm, R, 1, /* rbSize */