From 075a713de9ae1a09245facb0d7274ed499c33f86 Mon Sep 17 00:00:00 2001
From: Cedric Roux <cedric.roux@eurecom.fr>
Date: Thu, 18 Oct 2018 16:42:32 +0200
Subject: [PATCH] hotfix: fix a problem with multiple UEs

The symptom: when two UEs do uplink traffic at the same time, the
eNB fails to decode data sometimes. This has been seen with FDD
and 50 RBs. This generates a cascade of other problems leading to
disconnection/reconnection events seen in the log.

The problem: there are probably many, but one obvious bug was found
while analyzing some logs. Scheduling in the same TTI one UE's uplink
traffic and random access (msg3) was done in the same RB.

This commit fixes this simple case. It is probably not the end of
the story.

This is a hotfix, that does not change the code much.

We need to use vrb_map_UL properly all over the places. Today is
not used, but this is the way to go (most probably).
---
 openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
index 31c11e2c0a9..c5218371424 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
@@ -1029,7 +1029,8 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
     for (i = 0; i < NB_RA_PROC_MAX; i++) {
       if ((cc->ra[i].state == WAITMSG3) &&
 	  (cc->ra[i].Msg3_subframe == sched_subframe)) {
-	first_rb[CC_id]++;
+        if (first_rb[CC_id] < cc->ra[i].msg3_first_rb + cc->ra[i].msg3_nb_rb)
+          first_rb[CC_id] = cc->ra[i].msg3_first_rb + cc->ra[i].msg3_nb_rb;
 	//    cc->ray[i].Msg3_subframe = -1;
 	break;
       }
-- 
GitLab