Commit cc33856b authored by luis_pereira87's avatar luis_pereira87

Reset HARQ processes after RA when Msg3 carries a DCCH or DTCH message.

Reset ul_failure flag only after sending Msg4 otherwise gNB starts scheduling too early
parent 52700349
...@@ -1975,6 +1975,10 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra ...@@ -1975,6 +1975,10 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
sched_ctrl->rrc_processing_timer = (delay_ms << genericParameters->subcarrierSpacing); sched_ctrl->rrc_processing_timer = (delay_ms << genericParameters->subcarrierSpacing);
LOG_I(NR_MAC, "(%d.%d) Activating RRC processing timer for UE %04x with %d ms\n", frameP, slotP, UE->rnti, delay_ms); LOG_I(NR_MAC, "(%d.%d) Activating RRC processing timer for UE %04x with %d ms\n", frameP, slotP, UE->rnti, delay_ms);
// Reset uplink failure flags/counters/timers at MAC so gNB will resume again scheduling resources for this UE
UE->UE_sched_ctrl.pusch_consecutive_dtx_cnt = 0;
UE->UE_sched_ctrl.ul_failure = 0;
} else { } else {
ra->state = WAIT_Msg4_ACK; ra->state = WAIT_Msg4_ACK;
LOG_D(NR_MAC,"[gNB %d][RAPROC] Frame %d, Subframe %d: RA state %d\n", module_idP, frameP, slotP, ra->state); LOG_D(NR_MAC,"[gNB %d][RAPROC] Frame %d, Subframe %d: RA state %d\n", module_idP, frameP, slotP, ra->state);
......
...@@ -2492,6 +2492,40 @@ void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl, ...@@ -2492,6 +2492,40 @@ void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl,
} }
} }
void reset_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl) {
int harq;
while ((harq = sched_ctrl->feedback_dl_harq.head) >= 0) {
remove_front_nr_list(&sched_ctrl->feedback_dl_harq);
add_tail_nr_list(&sched_ctrl->available_dl_harq, harq);
}
while ((harq = sched_ctrl->retrans_dl_harq.head) >= 0) {
remove_front_nr_list(&sched_ctrl->retrans_dl_harq);
add_tail_nr_list(&sched_ctrl->available_dl_harq, harq);
}
for (int i = 0; i < NR_MAX_NB_HARQ_PROCESSES; i++) {
sched_ctrl->harq_processes[i].is_waiting = false;
}
}
void reset_ul_harq_list(NR_UE_sched_ctrl_t *sched_ctrl) {
int harq;
while ((harq = sched_ctrl->feedback_ul_harq.head) >= 0) {
remove_front_nr_list(&sched_ctrl->feedback_ul_harq);
add_tail_nr_list(&sched_ctrl->available_ul_harq, harq);
}
while ((harq = sched_ctrl->retrans_ul_harq.head) >= 0) {
remove_front_nr_list(&sched_ctrl->retrans_ul_harq);
add_tail_nr_list(&sched_ctrl->available_ul_harq, harq);
}
for (int i = 0; i < NR_MAX_NB_HARQ_PROCESSES; i++) {
sched_ctrl->ul_harq_processes[i].is_waiting = false;
}
}
void mac_remove_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rnti) void mac_remove_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rnti)
{ {
NR_UEs_t *UE_info = &nr_mac->UE_info; NR_UEs_t *UE_info = &nr_mac->UE_info;
......
...@@ -710,10 +710,12 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -710,10 +710,12 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
return; return;
} else { } else {
// The UE identified by C-RNTI still exists at the gNB // The UE identified by C-RNTI still exists at the gNB
// Reset uplink failure flags/counters/timers at MAC and at RRC so gNB will resume again scheduling resources for this UE // Reset uplink failure flags/counters/timers at RRC
UE_C->UE_sched_ctrl.pusch_consecutive_dtx_cnt = 0;
UE_C->UE_sched_ctrl.ul_failure = 0;
nr_mac_gNB_rrc_ul_failure_reset(gnb_mod_idP, frameP, slotP, ra->crnti); nr_mac_gNB_rrc_ul_failure_reset(gnb_mod_idP, frameP, slotP, ra->crnti);
// Reset HARQ processes
reset_dl_harq_list(&UE_C->UE_sched_ctrl);
reset_ul_harq_list(&UE_C->UE_sched_ctrl);
} }
} }
LOG_I(NR_MAC, "Scheduling RA-Msg4 for TC_RNTI 0x%04x (state %d, frame %d, slot %d)\n", LOG_I(NR_MAC, "Scheduling RA-Msg4 for TC_RNTI 0x%04x (state %d, frame %d, slot %d)\n",
......
...@@ -472,6 +472,10 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -472,6 +472,10 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl, void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl,
const NR_PDSCH_ServingCellConfig_t *pdsch); const NR_PDSCH_ServingCellConfig_t *pdsch);
void reset_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl);
void reset_ul_harq_list(NR_UE_sched_ctrl_t *sched_ctrl);
void handle_nr_ul_harq(const int CC_idP, void handle_nr_ul_harq(const int CC_idP,
module_id_t mod_id, module_id_t mod_id,
frame_t frame, frame_t frame,
......
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