Commit f1f3b8a0 authored by Cedric Roux's avatar Cedric Roux Committed by Haruki NAOI

bugfix: fix issue 285 - connect/disconnect multiple time

As reported by Emad Alizade:

    According to "Issue255 256 257 paging reesta release" that has been
    merged in develop version, we have a question: In rrc_eNB_free_UE()
    function only all ulsch related memory of user has been cleaned, but
    I think not only ulsch memory but also dlsch memory must be cleaned.
    I tested the latest develop version and with repetition UE attach-detach
    procedures we find that the dlsch memory has not been cleaned and after
    repeat this sequence (45 times) assertion with cause UE_id!=-1 (no free
    or exiting dlsch_context, dci_tools.c: fill_dci_and_dlsch() ) occurred
    and no UE will be attached to system.

The fixes in this commit are from Emad Alizade.

(cherry picked from commit 4b5b5564)

# Conflicts:
#	openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
#	openair2/LAYER2/MAC/eNB_scheduler.c
#	openair2/RRC/LITE/rrc_eNB.c
parent 7f03a6e3
...@@ -252,6 +252,7 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch) ...@@ -252,6 +252,7 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch)
#else #else
dlsch->active = 0; dlsch->active = 0;
#endif #endif
dlsch->harq_mask = 0;
for (i=0; i<10; i++) for (i=0; i<10; i++)
dlsch->harq_ids[i] = Mdlharq; dlsch->harq_ids[i] = Mdlharq;
......
...@@ -170,6 +170,7 @@ void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch) ...@@ -170,6 +170,7 @@ void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch)
//ulsch = (LTE_eNB_ULSCH_t *)malloc16(sizeof(LTE_eNB_ULSCH_t)); //ulsch = (LTE_eNB_ULSCH_t *)malloc16(sizeof(LTE_eNB_ULSCH_t));
if (ulsch) { if (ulsch) {
ulsch->rnti = 0; ulsch->rnti = 0;
ulsch->harq_mask = 0;
for (i=0; i<8; i++) { for (i=0; i<8; i++) {
if (ulsch->harq_processes[i]) { if (ulsch->harq_processes[i]) {
......
...@@ -731,12 +731,17 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, ...@@ -731,12 +731,17 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
pdcp_remove_UE(&ctxt); pdcp_remove_UE(&ctxt);
} }
for (int ii=0; ii<NUMBER_OF_UE_MAX; ii++) { for (int ii=0; ii<NUMBER_OF_UE_MAX; ii++) {
LTE_eNB_ULSCH_t *ulsch = NULL; LTE_eNB_ULSCH_t *ulsch = RC.eNB[module_idP][CC_id]->ulsch[ii];
ulsch = RC.eNB[module_idP][CC_id]->ulsch[ii];
if((ulsch != NULL) && (ulsch->rnti == rnti)){ if((ulsch != NULL) && (ulsch->rnti == rnti)){
LOG_I(MAC, "clean_eNb_ulsch UE %x \n", rnti); LOG_I(MAC, "clean_eNb_ulsch UE %x \n", rnti);
clean_eNb_ulsch(ulsch); clean_eNb_ulsch(ulsch);
break; }
}
for (int ii=0; ii<NUMBER_OF_UE_MAX; ii++) {
LTE_eNB_DLSCH_t *dlsch = RC.eNB[module_idP][CC_id]->dlsch[ii][0];
if((dlsch != NULL) && (dlsch->rnti == rnti)){
LOG_I(MAC, "clean_eNb_dlsch UE %x \n", rnti);
clean_eNb_dlsch(dlsch);
} }
} }
......
...@@ -806,6 +806,7 @@ rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s* ...@@ -806,6 +806,7 @@ rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s*
#ifndef UE_EXPANSION #ifndef UE_EXPANSION
int i, j , CC_id, pdu_number; int i, j , CC_id, pdu_number;
LTE_eNB_ULSCH_t *ulsch = NULL; LTE_eNB_ULSCH_t *ulsch = NULL;
LTE_eNB_DLSCH_t *dlsch = NULL;
nfapi_ul_config_request_body_t *ul_req_tmp = NULL; nfapi_ul_config_request_body_t *ul_req_tmp = NULL;
PHY_VARS_eNB *eNB_PHY = NULL; PHY_VARS_eNB *eNB_PHY = NULL;
eNB_MAC_INST *eNB_MAC = RC.mac[enb_mod_idP]; eNB_MAC_INST *eNB_MAC = RC.mac[enb_mod_idP];
...@@ -849,19 +850,15 @@ rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s* ...@@ -849,19 +850,15 @@ rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s*
ulsch = eNB_PHY->ulsch[i]; ulsch = eNB_PHY->ulsch[i];
if((ulsch != NULL) && (ulsch->rnti == rnti)){ if((ulsch != NULL) && (ulsch->rnti == rnti)){
LOG_I(RRC, "clean_eNb_ulsch UE %x \n", rnti); LOG_I(RRC, "clean_eNb_ulsch UE %x \n", rnti);
//clean_eNb_ulsch(ulsch); clean_eNb_ulsch(ulsch);
ulsch->rnti = 0;
} }
if(eNB_PHY->uci_vars[i].rnti == rnti){
LOG_I(MAC, "clean eNb uci_vars[%d] UE %x \n",i, rnti);
memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI));
} }
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
dlsch = eNB_PHY->dlsch[i][0];
if((dlsch != NULL) && (dlsch->rnti == rnti)){
LOG_I(RRC, "clean_eNb_dlsch UE %x \n", rnti);
clean_eNb_dlsch(dlsch);
} }
ulsch = eNB_PHY->ulsch[i];
if((ulsch != NULL) && (ulsch->rnti == rnti)){
LOG_I(RRC, "clean_eNb_ulsch UE %x \n", rnti);
//clean_eNb_ulsch(ulsch);
ulsch->rnti = 0;
} }
for(j = 0; j < 10; j++){ for(j = 0; j < 10; j++){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment