diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index cb76c22292..3afc7d4cde 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -740,7 +740,7 @@ void pf_dl(module_id_t module_id, } /* Loop UE_sched to find max coeff and allocate transmission */ - while (max_num_ue > 0 && n_rb_sched > 0 && UE_sched.head >= 0) { + while (max_num_ue > 0 && n_rb_sched >= MIN_NUM_PRBS_TO_SCHEDULE && UE_sched.head >= 0) { /* Find max coeff from UE_sched*/ int *max = &UE_sched.head; /* assume head is max */ diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 928d14c1aa..cc81a181ef 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -403,7 +403,7 @@ bool nr_find_nb_rb(uint16_t Qm, return true; /* is the minimum enough? */ - *nb_rb = 5; + *nb_rb = MIN_NUM_PRBS_TO_SCHEDULE; *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3; if (bytes <= *tbs) return true; diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index f7735a28b1..80293279f2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -80,6 +80,8 @@ #define NR_NB_RA_PROC_MAX 4 #define MAX_NUM_OF_SSB 64 +#define MIN_NUM_PRBS_TO_SCHEDULE 5 + /*! \brief NR_list_t is a "list" (of users, HARQ processes, slices, ...). * Especially useful in the scheduler and to keep "classes" of users. */ typedef struct {