From 11e45be9c50bc89cf5d26b6ed2db90e66a4cbce7 Mon Sep 17 00:00:00 2001
From: Robert Schmidt <robert.schmidt@eurecom.fr>
Date: Thu, 17 May 2018 10:27:09 +0200
Subject: [PATCH] fix: resort UE_list after slice multiplexing

- slice multiplexing resorts UE_list for its purposes with restoring the
  original order
- in order to keep the order in UE_list, resort to original order after
  multiplexing
- ideally, this would happen in the multiplexing but currently, the slice_idx
  is not passed to multiplexing (it does not care), so this cannot be done ATM
---
 openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
index 7cc8f93939..350a7ea9f7 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
@@ -744,6 +744,9 @@ schedule_ue_spec(module_id_t module_idP, int slice_idxP,
 
   if (RC.mac[module_idP]->slice_info.interslice_share_active) {
     dlsch_scheduler_interslice_multiplexing(module_idP, frameP, subframeP, eNB->slice_info.rballoc_sub);
+    /* the interslice multiplexing re-sorts the UE_list for the slices it tries
+     * to multiplex, so we need to sort it for the current slice again */
+    sort_UEs(module_idP, slice_idxP, frameP, subframeP);
   }
 
   for (CC_id = 0; CC_id < NFAPI_CC_MAX; CC_id++) {
-- 
GitLab