From 2b37edaa3c99c9316f6f37167699a6cd05f17f8e Mon Sep 17 00:00:00 2001 From: vijay chadachan Date: Mon, 18 Mar 2024 12:47:30 +0100 Subject: [PATCH 1/3] Additional memory allocation for MAC stats logging to enable 32 UE support The memory allocation is increased to enable the periodic mac stats logging to enable increased number of UEs data. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 2 +- openair2/LAYER2/NR_MAC_gNB/main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index af8b077dea..2c3ca94393 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -241,7 +241,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_ } if ((slot == 0) && (frame & 127) == 0) { - char stats_output[16000] = {0}; + char stats_output[32656] = {0}; dump_mac_stats(gNB, stats_output, sizeof(stats_output), true); LOG_I(NR_MAC, "Frame.Slot %d.%d\n%s\n", frame, slot, stats_output); } diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 72689dd90d..320aa273b7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -45,7 +45,7 @@ extern RAN_CONTEXT_t RC; -#define MACSTATSSTRLEN 16000 +#define MACSTATSSTRLEN 36256 void *nrmac_stats_thread(void *arg) { From 740bec4ac0dcea02f67fe206176094ae5f98c97f Mon Sep 17 00:00:00 2001 From: vijay chadachan Date: Mon, 18 Mar 2024 12:51:02 +0100 Subject: [PATCH 2/3] Fix max_sched_ues in DL/UL Scheduler to match MAX_DCI_CORESET - Added the limit as MAX_DCI_CORESET for max_sched_ues in DL/UL scheduler. This is needed because gNB crashes when tested with 100MHz cell as the scheduler tries to schedule 11 UEs in a slot and the DCI informaiton is corrupted due to the limitation in NFAPI interface because of MAX_DCI_CORESET size. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 +++ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index caef6d8822..20e8a6d624 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -875,6 +875,9 @@ static void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_ int average_agg_level = 4; // TODO find a better estimation int max_sched_ues = bw / (average_agg_level * NR_NB_REG_PER_CCE); + // FAPI cannot handle more than MAX_DCI_CORESET DCIs + max_sched_ues = min(max_sched_ues, MAX_DCI_CORESET); + /* proportional fair scheduling algorithm */ pf_dl(module_id, frame, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 1aee6f613e..beb31fca8e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -2028,6 +2028,9 @@ static bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_ int average_agg_level = 4; // TODO find a better estimation int max_sched_ues = bw / (average_agg_level * NR_NB_REG_PER_CCE); + // FAPI cannot handle more than MAX_DCI_CORESET DCIs + max_sched_ues = min(max_sched_ues, MAX_DCI_CORESET); + /* proportional fair scheduling algorithm */ pf_ul(module_id, frame, From 5697f396f65531a6f02db494152d366b24166f82 Mon Sep 17 00:00:00 2001 From: vijay chadachan Date: Mon, 18 Mar 2024 12:55:06 +0100 Subject: [PATCH 3/3] Adjusted the num_dl_sched > 3 while adapting DL MCS for DL grants - The DL MCS adapted based on the BLER for the minimum number of DL(numd_sched) grants for the UE in the pre_configured number of frames. The current threshold value is set to be >9 for 16 UE capacity. - With increased number of UE to 32 and when all the UEs are DL data active the num_dl_sched is not meeting the threshold value. Due to whcih the MCS of all the UEs are stuck with MCS 10-12 in good channel condition. - The threshold value is adjusted to support 32 UE capacity increase. --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 932e11035b..46bd086d3f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -678,24 +678,24 @@ int get_mcs_from_bler(const NR_bler_options_t *bler_options, return old_mcs; // no update // last update is longer than x frames ago - const int dtx = (int)(stats->rounds[0] - bler_stats->rounds[0]); - const int dretx = (int)(stats->rounds[1] - bler_stats->rounds[1]); - const float bler_window = dtx > 0 ? (float) dretx / dtx : bler_stats->bler; + const int num_dl_sched = (int)(stats->rounds[0] - bler_stats->rounds[0]); + const int num_dl_retx = (int)(stats->rounds[1] - bler_stats->rounds[1]); + const float bler_window = num_dl_sched > 0 ? (float) num_dl_retx / num_dl_sched : bler_stats->bler; bler_stats->bler = BLER_FILTER * bler_stats->bler + (1 - BLER_FILTER) * bler_window; int new_mcs = old_mcs; - if (bler_stats->bler < bler_options->lower && old_mcs < max_mcs && dtx > 9) + if (bler_stats->bler < bler_options->lower && old_mcs < max_mcs && num_dl_sched > 3) new_mcs += 1; else if ((bler_stats->bler > bler_options->upper && old_mcs > 6) // above threshold - || (dtx <= 3 && old_mcs > 9)) // no activity + || (num_dl_sched <= 3 && old_mcs > 9)) // no activity new_mcs -= 1; // else we are within threshold boundaries bler_stats->last_frame = frame; bler_stats->mcs = new_mcs; memcpy(bler_stats->rounds, stats->rounds, sizeof(stats->rounds)); - LOG_D(MAC, "frame %4d MCS %d -> %d (dtx %d, dretx %d, BLER wnd %.3f avg %.6f)\n", - frame, old_mcs, new_mcs, dtx, dretx, bler_window, bler_stats->bler); + LOG_D(MAC, "frame %4d MCS %d -> %d (num_dl_sched %d, num_dl_retx %d, BLER wnd %.3f avg %.6f)\n", + frame, old_mcs, new_mcs, num_dl_sched, num_dl_retx, bler_window, bler_stats->bler); return new_mcs; }