From a319cbfb19da524deb9be61b5c608104181cb1bf Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 14 Nov 2024 14:38:22 +0100 Subject: [PATCH 1/4] Prevent segfault when trying to schedule MAX_MOBILES_PER_GNB UEs When the UE list is full, the iterator will run through all MAX_MOBILES_PER_GNB UEs. It expects that eventually the pointer is NULL, which is not the case if we have MAX_MOBILES_PER_GNB (or it simply depends on the following memory). So give one array entry more, to ensure that the last one is NULL. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 82106d0ef2..4022476ac6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -613,7 +613,7 @@ static void pf_dl(module_id_t module_id, gNB_MAC_INST *mac = RC.nrmac[module_id]; NR_ServingCellConfigCommon_t *scc=mac->common_channels[0].ServingCellConfigCommon; // UEs that could be scheduled - UEsched_t UE_sched[MAX_MOBILES_PER_GNB] = {0}; + UEsched_t UE_sched[MAX_MOBILES_PER_GNB + 1] = {0}; int remainUEs = max_num_ue; int curUE = 0; int CC_id = 0; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 4c0d40d24f..8a38c6e66d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1790,7 +1790,7 @@ static void pf_ul(module_id_t module_id, const int min_rb = nrmac->min_grant_prb; // UEs that could be scheduled - UEsched_t UE_sched[MAX_MOBILES_PER_GNB] = {0}; + UEsched_t UE_sched[MAX_MOBILES_PER_GNB + 1] = {0}; int remainUEs = max_num_ue; int curUE = 0; From 268d409b5b823ddb59ac5998502c563d83ca8d53 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 14 Nov 2024 14:28:16 +0100 Subject: [PATCH 2/4] Prevent segfault in nr_mac_clean_cellgroup() In some runs of a multi-UE deployment, we see segfaults because cell_group->spCellConfig is NULL. We should not segfault in that case, so check for spCellConfig. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index dc442bedd0..7e66a0e2ac 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2962,8 +2962,9 @@ void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slo static void nr_mac_clean_cellgroup(NR_CellGroupConfig_t *cell_group) { + DevAssert(cell_group != NULL); /* remove a reconfigurationWithSync, we don't need it anymore */ - if (cell_group->spCellConfig->reconfigurationWithSync != NULL) { + if (cell_group->spCellConfig && cell_group->spCellConfig->reconfigurationWithSync != NULL) { ASN_STRUCT_FREE(asn_DEF_NR_ReconfigurationWithSync, cell_group->spCellConfig->reconfigurationWithSync); cell_group->spCellConfig->reconfigurationWithSync = NULL; } From 7d2b7c2ba31cad234c52e5bf75c72b0d80c54373 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 14 Nov 2024 17:23:40 +0100 Subject: [PATCH 3/4] Prevent segfault in RRC Similar to the previous commit, prevent the same segfault in RRC. --- openair2/RRC/NR/rrc_gNB.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index c018b8030a..881a6d7fee 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -915,7 +915,7 @@ static void rrc_gNB_process_RRCReestablishmentComplete(gNB_RRC_INST *rrc, gNB_RR * reestablishment, instead of re-requesting the CellGroupConfig from the DU. * Hence, add below hack; the solution would be to request the * CellGroupConfig from the DU when doing reestablishment. */ - if (cellGroupConfig->spCellConfig->reconfigurationWithSync != NULL) { + if (cellGroupConfig->spCellConfig && cellGroupConfig->spCellConfig->reconfigurationWithSync) { ASN_STRUCT_FREE(asn_DEF_NR_ReconfigurationWithSync, cellGroupConfig->spCellConfig->reconfigurationWithSync); cellGroupConfig->spCellConfig->reconfigurationWithSync = NULL; } From 7e3df5f1735fc0ab59cf5b71a3de27d03edf00cb Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sun, 17 Nov 2024 10:09:31 +0100 Subject: [PATCH 4/4] Adjust TCP threshold MIMO for AW2S 2x2 pipeline --- ci-scripts/xml_files/container_sa_aw2s_asue_2x2.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/xml_files/container_sa_aw2s_asue_2x2.xml b/ci-scripts/xml_files/container_sa_aw2s_asue_2x2.xml index 5d43c89c3c..514672df66 100644 --- a/ci-scripts/xml_files/container_sa_aw2s_asue_2x2.xml +++ b/ci-scripts/xml_files/container_sa_aw2s_asue_2x2.xml @@ -192,7 +192,7 @@ iperf (DL/TCP)(30 sec)(multi-ue profile) -t 30 -R amarisoft_ue_1 amarisoft_ue_2 amarisoft_ue_3 amarisoft_ue_4 amarisoft_ue_5 amarisoft_ue_6 amarisoft_ue_7 amarisoft_ue_8 amarisoft_ue_9 amarisoft_ue_10 amarisoft_ue_11 amarisoft_ue_12 amarisoft_ue_13 amarisoft_ue_14 amarisoft_ue_15 - 4 + 3.9 oc-cn5g