From c02908453a1c69592e550aac26b40cc97a164c96 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Fri, 26 Apr 2024 10:22:23 +0200 Subject: [PATCH] fix order error in ru.common.rxdataF filling lock, use consistently #define for buffer size --- executables/nr-ru.c | 11 +++++------ openair1/PHY/INIT/nr_init_ru.c | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 9777c956f6..71c9c5fd73 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1258,13 +1258,12 @@ void *ru_thread( void *param ) { // We should make a VNF main loop with proper tasks calls in case of VNF slot_start = timespec_add(slot_start,slot_duration); struct timespec curr_time; - clock_gettime(CLOCK_MONOTONIC, &curr_time); - + clock_gettime(CLOCK_MONOTONIC, &curr_time); struct timespec sleep_time; - if((slot_start.tv_sec > curr_time.tv_sec) || (slot_start.tv_sec == curr_time.tv_sec && slot_start.tv_nsec > curr_time.tv_nsec)){ + if((slot_start.tv_sec > curr_time.tv_sec) || + (slot_start.tv_sec == curr_time.tv_sec && slot_start.tv_nsec > curr_time.tv_nsec)){ sleep_time = timespec_sub(slot_start,curr_time); - usleep(sleep_time.tv_nsec * 1e-3); } } @@ -1346,10 +1345,10 @@ void *ru_thread( void *param ) { if (!res) break; } - ru->feprx(ru,proc->tti_rx); // set the tti that was generated to busy - LOG_D(NR_PHY, "Setting %d.%d (%d) to busy\n", proc->frame_rx, proc->tti_rx, proc->tti_rx % RU_RX_SLOT_DEPTH); rx_tti_busy[proc->tti_rx % RU_RX_SLOT_DEPTH] = true; + ru->feprx(ru,proc->tti_rx); + LOG_D(NR_PHY, "Setting %d.%d (%d) to busy\n", proc->frame_rx, proc->tti_rx, proc->tti_rx % RU_RX_SLOT_DEPTH); clock_gettime(CLOCK_MONOTONIC,&ru->rt_ru_profiling.return_RU_feprx[rt_prof_idx]); //LOG_M("rxdata.m","rxs",ru->common.rxdata[0],1228800,1,1); LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx); diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c index 0a1a0322c5..a9f630198d 100644 --- a/openair1/PHY/INIT/nr_init_ru.c +++ b/openair1/PHY/INIT/nr_init_ru.c @@ -98,7 +98,7 @@ int nr_phy_init_RU(RU_t *ru) { ru->common.rxdataF = (int32_t**)malloc16(ru->nb_rx*sizeof(int32_t*) ); for (i=0; inb_rx; i++) { // allocate 4 slots of I/Q signal data (frequency) - ru->common.rxdataF[i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(4*fp->symbols_per_slot*fp->ofdm_symbol_size) ); + ru->common.rxdataF[i] = (int32_t*)malloc16_clear(sizeof(**ru->common.rxdataF)*(RU_RX_SLOT_DEPTH*fp->symbols_per_slot*fp->ofdm_symbol_size) ); LOG_I(PHY,"rxdataF[%d] %p for RU %d\n",i,ru->common.rxdataF[i],ru->idx); }