From e2ddd50fde44c99c6afbf0d15f613d8e3aded9b4 Mon Sep 17 00:00:00 2001 From: Younes <younes.khadraoui@eurecom.fr> Date: Thu, 22 Feb 2018 15:54:27 +0100 Subject: [PATCH] Dealing with connection lost case. Now the RRU keeps working but we can't restart it again, a problem with the USRP load --- openair1/PHY/LTE_TRANSPORT/if4_tools.c | 2 +- openair1/PHY/defs.h | 7 +++++++ targets/RT/USER/lte-ru.c | 16 ++++++++++------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/if4_tools.c b/openair1/PHY/LTE_TRANSPORT/if4_tools.c index 27e1e2a6cb4..c3cc6026f9e 100644 --- a/openair1/PHY/LTE_TRANSPORT/if4_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/if4_tools.c @@ -293,7 +293,7 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint db_fulllength, 0) < 0) { perror("ETHERNET read"); - ru->state = RU_IDLE; + ru->cmd = STOP_RU; return; } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 0 ); diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index e244cb7a3aa..50e7102dcb5 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -678,6 +678,11 @@ typedef enum { RU_SYNC = 5 } rru_state_t; +/// Some commamds to RRU. Not sure we should do it like this ! +typedef enum { + STOP_RU = 0 +} rru_cmd_t; + typedef struct RU_t_s{ /// index of this ru uint32_t idx; @@ -796,6 +801,8 @@ typedef struct RU_t_s{ openair0_timestamp ts_offset; /// Current state of the RU rru_state_t state; + /// Command to do + rru_cmd_t cmd; /// process scheduling variables RU_proc_t proc; /// stats thread pthread descriptor diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index d447f114768..f988ba0c6ca 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -681,15 +681,10 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) { symbol_mask_full = ((subframe_select(fp,*subframe) == SF_S) ? (1<<fp->dl_symbols_in_S_subframe) : (1<<fp->symbols_per_tti))-1; do { recv_IF4p5(ru, &frame_tx, &subframe_tx, &packet_type, &symbol_number); - if (ru->state != RU_RUN){ + if (ru->cmd != STOP_RU){ pthread_mutex_lock(&proc->mutex_ru); proc->instance_cnt_ru = -1; pthread_mutex_unlock(&proc->mutex_ru); - if (ru->stop_rf) { - ru->stop_rf(ru); - LOG_I(PHY,"RU %d rf device stopped\n",ru->idx); - } - else LOG_D(PHY,"RU %d no rf device\n",ru->idx); return; } if ((subframe_select(fp,subframe_tx) == SF_DL) && (symbol_number == 0)) start_meas(&ru->rx_fhaul); @@ -1788,6 +1783,14 @@ static void* ru_thread( void* param ) { // synchronization on input FH interface, acquire signals/data and block + if (ru->stop_rf && ru->cmd == STOP_RU) { + ru->stop_rf(ru); + ru->state = RU_IDLE; + LOG_I(PHY,"RU %d rf device stopped\n",ru->idx); + break; + } + + if (ru->fh_south_in && ru->state == RU_RUN) ru->fh_south_in(ru,&frame,&subframe); else AssertFatal(1==0, "No fronthaul interface at south port"); @@ -2273,6 +2276,7 @@ void init_RU(char *rf_config_file, clock_source_t clock_source,clock_source_t ti ru->idx = ru_id; ru->ts_offset = 0; ru->in_synch = (ru->is_slave == 1) ? 0 : 1; + ru->cmd = -1; // use eNB_list[0] as a reference for RU frame parameters // NOTE: multiple CC_id are not handled here yet! ru->openair0_cfg.clock_source = clock_source; -- GitLab