Commit 89ebbb41 authored by Robert Schmidt's avatar Robert Schmidt Committed by rmagueta

Do not trigger ul failure in measgap scheduling and standardize the...

Do not trigger ul failure in measgap scheduling and standardize the verification if MAC is active in other scheduling functions
parent 7e6826ec
...@@ -628,7 +628,7 @@ static void pf_dl(module_id_t module_id, ...@@ -628,7 +628,7 @@ static void pf_dl(module_id_t module_id,
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
NR_UE_DL_BWP_t *current_BWP = &UE->current_DL_BWP; NR_UE_DL_BWP_t *current_BWP = &UE->current_DL_BWP;
if (sched_ctrl->ul_failure) if (!nr_mac_ue_is_active(UE))
continue; continue;
const NR_mac_dir_stats_t *stats = &UE->mac_stats.dl; const NR_mac_dir_stats_t *stats = &UE->mac_stats.dl;
...@@ -1037,7 +1037,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1037,7 +1037,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
NR_UE_DL_BWP_t *current_BWP = &UE->current_DL_BWP; NR_UE_DL_BWP_t *current_BWP = &UE->current_DL_BWP;
if (sched_ctrl->ul_failure && !get_softmodem_params()->phy_test) if (!nr_mac_ue_is_active(UE) && !get_softmodem_params()->phy_test)
continue; continue;
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
......
...@@ -3432,10 +3432,7 @@ void nr_measgap_scheduling(gNB_MAC_INST *nr_mac, frame_t frame, sub_frame_t slot ...@@ -3432,10 +3432,7 @@ void nr_measgap_scheduling(gNB_MAC_INST *nr_mac, frame_t frame, sub_frame_t slot
interrupt_followup_action_t a = nr_timer_is_active(t) ? UE->interrupt_action : FOLLOW_INSYNC; interrupt_followup_action_t a = nr_timer_is_active(t) ? UE->interrupt_action : FOLLOW_INSYNC;
// start a timer to stop scheduling UE during MeasGap, or extend timer for // start a timer to stop scheduling UE during MeasGap, or extend timer for
// duration of measGap with existing follow-up action // duration of measGap with existing follow-up action
// TODO: if the timer is running, it might be to stop scheduling of the UE afterwards, but then it does not make sense to stop
// scheduling the UE now, we should maybe just skip it?
if (!nr_timer_is_active(t) || nr_timer_remaining_time(t) < mgc->mgl_slots) { if (!nr_timer_is_active(t) || nr_timer_remaining_time(t) < mgc->mgl_slots) {
nr_mac_trigger_ul_failure(&UE->UE_sched_ctrl, UE->current_DL_BWP.scs); /* set the UE to "not active" */
nr_mac_interrupt_ue_transmission(nr_mac, UE, a, mgc->mgl_slots); nr_mac_interrupt_ue_transmission(nr_mac, UE, a, mgc->mgl_slots);
} }
} }
...@@ -3564,12 +3561,9 @@ void nr_mac_update_timers(module_id_t module_id, frame_t frame, slot_t slot) ...@@ -3564,12 +3561,9 @@ void nr_mac_update_timers(module_id_t module_id, frame_t frame, slot_t slot)
if (nr_timer_tick(&sched_ctrl->transm_interrupt)) { if (nr_timer_tick(&sched_ctrl->transm_interrupt)) {
/* expired */ /* expired */
nr_timer_stop(&sched_ctrl->transm_interrupt); nr_timer_stop(&sched_ctrl->transm_interrupt);
if (UE->interrupt_action == FOLLOW_OUTOFSYNC) { if (UE->interrupt_action == FOLLOW_OUTOFSYNC)
nr_mac_trigger_ul_failure(sched_ctrl, UE->current_DL_BWP.scs); nr_mac_trigger_ul_failure(sched_ctrl, UE->current_DL_BWP.scs);
} else { /* else: default FOLLOW_INSYNC: nothing to do (UE is now active again) */
DevAssert(UE->interrupt_action == FOLLOW_INSYNC);
nr_mac_reset_ul_failure(sched_ctrl);
}
} }
} }
} }
...@@ -3777,6 +3771,17 @@ bool nr_mac_check_release(NR_UE_sched_ctrl_t *sched_ctrl, int rnti) ...@@ -3777,6 +3771,17 @@ bool nr_mac_check_release(NR_UE_sched_ctrl_t *sched_ctrl, int rnti)
return sched_ctrl->release_timer == 0; return sched_ctrl->release_timer == 0;
} }
bool nr_mac_ue_is_active(const NR_UE_info_t *ue)
{
/* pass NR_UE_info_t, so that later we could adapt, e.g., for DRX */
const NR_UE_sched_ctrl_t *sched_ctrl = &ue->UE_sched_ctrl;
if (sched_ctrl->ul_failure)
return false;
if (nr_timer_is_active(&sched_ctrl->transm_interrupt))
return false;
return true;
}
#define UL_FAILURE_REQ_GRACE 10000 #define UL_FAILURE_REQ_GRACE 10000
#define UL_FAILURE_TIMEOUT 30000 #define UL_FAILURE_TIMEOUT 30000
void nr_mac_trigger_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierSpacing_t subcarrier_spacing) void nr_mac_trigger_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierSpacing_t subcarrier_spacing)
......
...@@ -527,10 +527,9 @@ void nr_schedule_srs(int module_id, frame_t frame, int slot) ...@@ -527,10 +527,9 @@ void nr_schedule_srs(int module_id, frame_t frame, int slot)
UE_iterator(UE_info->connected_ue_list, UE) { UE_iterator(UE_info->connected_ue_list, UE) {
const int CC_id = 0; const int CC_id = 0;
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
NR_UE_UL_BWP_t *current_BWP = &UE->current_UL_BWP; NR_UE_UL_BWP_t *current_BWP = &UE->current_UL_BWP;
if ((sched_ctrl->ul_failure && !get_softmodem_params()->phy_test) || nr_timer_is_active(&sched_ctrl->transm_interrupt)) { if (!nr_mac_ue_is_active(UE) && !get_softmodem_params()->phy_test) {
continue; continue;
} }
......
...@@ -236,7 +236,7 @@ void nr_csi_meas_reporting(int Mod_idP,frame_t frame, slot_t slot) ...@@ -236,7 +236,7 @@ void nr_csi_meas_reporting(int Mod_idP,frame_t frame, slot_t slot)
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP; NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP;
const int n_slots_frame = nrmac->frame_structure.numb_slots_frame; const int n_slots_frame = nrmac->frame_structure.numb_slots_frame;
if (nr_timer_is_active(&sched_ctrl->transm_interrupt) || (sched_ctrl->ul_failure && !get_softmodem_params()->phy_test)) { if (!nr_mac_ue_is_active(UE) && !get_softmodem_params()->phy_test) {
continue; continue;
} }
const NR_CSI_MeasConfig_t *csi_measconfig = UE->sc_info.csi_MeasConfig; const NR_CSI_MeasConfig_t *csi_measconfig = UE->sc_info.csi_MeasConfig;
...@@ -1250,7 +1250,7 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, slot_t slot) ...@@ -1250,7 +1250,7 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, slot_t slot)
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP; NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP;
const int n_slots_frame = nrmac->frame_structure.numb_slots_frame; const int n_slots_frame = nrmac->frame_structure.numb_slots_frame;
if (sched_ctrl->ul_failure || nr_timer_is_active(&sched_ctrl->transm_interrupt)) if (!nr_mac_ue_is_active(UE))
continue; continue;
NR_PUCCH_Config_t *pucch_Config = ul_bwp->pucch_Config; NR_PUCCH_Config_t *pucch_Config = ul_bwp->pucch_Config;
......
...@@ -1963,7 +1963,7 @@ static int pf_ul(gNB_MAC_INST *nrmac, ...@@ -1963,7 +1963,7 @@ static int pf_ul(gNB_MAC_INST *nrmac,
UE_iterator(UE_list, UE) { UE_iterator(UE_list, UE) {
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
if (sched_ctrl->ul_failure) if (!nr_mac_ue_is_active(UE))
continue; continue;
LOG_D(NR_MAC,"pf_ul: preparing UL scheduling for UE %04x\n",UE->rnti); LOG_D(NR_MAC,"pf_ul: preparing UL scheduling for UE %04x\n",UE->rnti);
......
...@@ -478,6 +478,8 @@ void nr_mac_trigger_release_complete(gNB_MAC_INST *mac, int rnti); ...@@ -478,6 +478,8 @@ void nr_mac_trigger_release_complete(gNB_MAC_INST *mac, int rnti);
void nr_mac_release_ue(gNB_MAC_INST *mac, int rnti); void nr_mac_release_ue(gNB_MAC_INST *mac, int rnti);
bool nr_mac_request_release_ue(const gNB_MAC_INST *nrmac, int rnti); bool nr_mac_request_release_ue(const gNB_MAC_INST *nrmac, int rnti);
bool nr_mac_ue_is_active(const NR_UE_info_t *ue);
void nr_mac_trigger_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierSpacing_t subcarrier_spacing); void nr_mac_trigger_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierSpacing_t subcarrier_spacing);
void nr_mac_reset_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl); void nr_mac_reset_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl);
bool nr_mac_check_ul_failure(gNB_MAC_INST *nrmac, int rnti, NR_UE_sched_ctrl_t *sched_ctrl); bool nr_mac_check_ul_failure(gNB_MAC_INST *nrmac, int rnti, NR_UE_sched_ctrl_t *sched_ctrl);
......
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