From 48d19391e2fdb74cc4d6625d22648011d75ec4a9 Mon Sep 17 00:00:00 2001 From: francescomani <email@francescomani.it> Date: Thu, 26 Jan 2023 11:22:32 +0100 Subject: [PATCH] fix for PHY structure disactivation --- executables/nr-gnb.c | 10 ++++++++-- openair1/PHY/NR_TRANSPORT/nr_ulsch.c | 3 --- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index b2f88aca399..83f0a05e695 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -175,12 +175,18 @@ void rx_func(void *param) T(T_GNB_PHY_DL_TICK, T_INT(gNB->Mod_id), T_INT(frame_tx), T_INT(slot_tx)); - // disactivate PHY stats if UE is inactive for more than 10 frames + // disactivate PHY stats if UE is inactive for a given number of frames for (int i = 0; i < MAX_MOBILES_PER_GNB; i++) { NR_gNB_PHY_STATS_t *stats = &gNB->phy_stats[i]; - if(stats->active && (frame_rx > (stats->frame + NUMBER_FRAMES_PHY_UE_INACTIVE) % 1024)) + if(stats->active && (((frame_rx - stats->frame + 1024) % 1024) > NUMBER_FRAMES_PHY_UE_INACTIVE)) stats->active = false; } + // disactivate ULSCH structure if it is inactive for a given number of frames + for (int i = 0; i < NUMBER_OF_NR_ULSCH_MAX; i++) { + NR_gNB_ULSCH_t *ulsch = gNB->ulsch[i]; + if (ulsch->active && (((frame_rx - ulsch->harq_process->frame + 1024) % 1024) > NUMBER_FRAMES_PHY_UE_INACTIVE)) + ulsch->active = false; + } // RX processing int rx_slot_type = nr_slot_select(cfg,frame_rx,slot_rx); diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c index aae638e4ad8..2430b6e2fa2 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c @@ -51,9 +51,6 @@ int16_t find_nr_ulsch(PHY_VARS_gNB *gNB, uint16_t rnti, int pid, int frame) // if there is already an active ULSCH for this RNTI and HARQ_PID if ((ulsch->harq_pid == pid) && (ulsch->rnti == rnti)) return i; - // remove inactive ULSCH (from disconnected UEs) - else if ((frame > (ulsch->harq_process->frame + NUMBER_FRAMES_PHY_UE_INACTIVE) % 1024)) - ulsch->active = false; } } return first_free_index; -- GitLab