From 0ce0282238e617bb3758275723b21503f7bf7adb Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Tue, 7 May 2024 18:13:34 +0200 Subject: [PATCH] gNB: make checks for missed feedbacks more robust w.r.t. frame number warp-around in find_harq() --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index af657a399f..b2a6827d04 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -977,7 +977,7 @@ static NR_UE_harq_t *find_harq(frame_t frame, sub_frame_t slot, NR_UE_info_t * U return NULL; NR_UE_harq_t *harq = &sched_ctrl->harq_processes[pid]; /* old feedbacks we missed: mark for retransmission */ - while (harq->feedback_frame != frame + while ((harq->feedback_frame - frame + 1024 ) % 1024 > 512 // harq->feedback_frame < frame, distance of 512 is boundary to decide if feedback_frame is in the past or future || (harq->feedback_frame == frame && harq->feedback_slot < slot)) { LOG_W(NR_MAC, "UE %04x expected HARQ pid %d feedback at %4d.%2d, but is at %4d.%2d instead (HARQ feedback is in the past)\n", @@ -995,7 +995,9 @@ static NR_UE_harq_t *find_harq(frame_t frame, sub_frame_t slot, NR_UE_info_t * U harq = &sched_ctrl->harq_processes[pid]; } /* feedbacks that we wait for in the future: don't do anything */ - if (harq->feedback_slot > slot) { + if ((frame - harq->feedback_frame + 1024 ) % 1024 > 512 // harq->feedback_frame > frame, distance of 512 is boundary to decide if feedback_frame is in the past or future + || (harq->feedback_frame == frame && harq->feedback_slot > slot)) { + LOG_W(NR_MAC, "UE %04x expected HARQ pid %d feedback at %4d.%2d, but is at %4d.%2d instead (HARQ feedback is in the future)\n", UE->rnti,