From 497a3275c62d397e8659961b64bc34081c2806ed Mon Sep 17 00:00:00 2001
From: naoi <naoi.haruki@jp.fujitsu.com>
Date: Thu, 22 Feb 2018 10:17:34 +0900
Subject: [PATCH] fix: drop reestablishment request after UL failure is
 detected in layer2.

eNB should be keep UE context longer than T311 timer after UL failure is detected in layer2.
Configuration file(GENERIC-LTE-EPC) sets T311 to 10s, so eNB keep UE context up to 20s.
---
 openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 +-
 openair2/RRC/LITE/rrc_common.c            | 6 +++---
 openair2/RRC/LITE/rrc_eNB.c               | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
index 6612fb25b9..0e4bbb84f1 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
@@ -302,7 +302,7 @@ rx_sdu(const module_id_t enb_mod_idP,
                 // prepare transmission of Msg4(RRCConnectionReconfiguration)
                 ra->state = MSGCRNTI;
                 LOG_I(MAC,
-                     "[eNB %d] Frame %d, Subframe %d CC_id %d : (rnti %x UE_id %d) RRCConnectionReconfiguration(Msg4)",
+                     "[eNB %d] Frame %d, Subframe %d CC_id %d : (rnti %x UE_id %d) RRCConnectionReconfiguration(Msg4)\n",
                      enb_mod_idP, frameP, subframeP, CC_idP, old_rnti, old_UE_id);
                 //
                 UE_id = old_UE_id;
diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c
index aad423418a..8bd3638f5a 100644
--- a/openair2/RRC/LITE/rrc_common.c
+++ b/openair2/RRC/LITE/rrc_common.c
@@ -350,7 +350,7 @@ rrc_rx_tx(
       }
       if (ue_context_p->ue_context.ul_failure_timer>0) {
 	ue_context_p->ue_context.ul_failure_timer++;
-	if (ue_context_p->ue_context.ul_failure_timer >= 8) {
+	if (ue_context_p->ue_context.ul_failure_timer >= 20000) {
 	  // remove UE after 20 seconds after MAC has indicated UL failure
 	  LOG_I(RRC,"Removing UE %x instance\n",ue_context_p->ue_context.rnti);
 	  ue_to_be_removed = ue_context_p;
@@ -515,14 +515,14 @@ rrc_rx_tx(
       }
     }
     if (ue_to_be_removed) {
-      if(ue_to_be_removed->ue_context.ul_failure_timer >= 8) {
+      if(ue_to_be_removed->ue_context.ul_failure_timer >= 20000) {
           ue_to_be_removed->ue_context.ue_release_timer_s1 = 1;
           ue_to_be_removed->ue_context.ue_release_timer_thres_s1 = 200;
           ue_to_be_removed->ue_context.ue_release_timer = 0;
           ue_to_be_removed->ue_context.ue_reestablishment_timer = 0;
       }
       rrc_eNB_free_UE(ctxt_pP->module_id,ue_to_be_removed);
-      if(ue_to_be_removed->ue_context.ul_failure_timer >= 8){
+      if(ue_to_be_removed->ue_context.ul_failure_timer >= 20000){
         ue_to_be_removed->ue_context.ul_failure_timer = 0;
       }
     }
diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c
index 94e4c71986..0772e76b74 100644
--- a/openair2/RRC/LITE/rrc_eNB.c
+++ b/openair2/RRC/LITE/rrc_eNB.c
@@ -822,7 +822,7 @@ rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s*
     LOG_W(RRC, "[eNB %d] Removing UE RNTI %x\n", enb_mod_idP, rnti);
 
 #if defined(ENABLE_USE_MME)
-   if( ue_context_pP->ue_context.ul_failure_timer >= 8 ) {
+   if( ue_context_pP->ue_context.ul_failure_timer >= 20000 ) {
     LOG_I(RRC, "[eNB %d] S1AP_UE_CONTEXT_RELEASE_REQ RNTI %x\n", enb_mod_idP, rnti);
     rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ(enb_mod_idP, ue_context_pP, S1AP_CAUSE_RADIO_NETWORK, 21); // send cause 21: connection with ue lost
     /* From 3GPP 36300v10 p129 : 19.2.2.2.2 S1 UE Context Release Request (eNB triggered)
-- 
GitLab