From fc79bb1c916a4a564f75a5391be9ab1a18766fd7 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 30 Jun 2021 11:23:48 -0700 Subject: [PATCH] Updating dropping of PUSCH if repeated sfn/slot The previous two commits did not correctly check the gNB sfn and slot. The code now correctly sets the slot in which the PUSCH is SCHEDULED, not the slot the rx is expected. Also, the sfn/slot is only updated if we do in fact schedule a PUSCH. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 3 +-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 10 ++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 637fd15048..3eb4b27cab 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -317,8 +317,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame, gNB->handled_frame, slot, gNB->handled_slot); return; } - gNB->handled_frame = frame; - gNB->handled_slot = slot; + NR_COMMON_channels_t *cc = gNB->common_channels; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; NR_TDD_UL_DL_Pattern_t *tdd_pattern = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index b9b9f3b435..3d7c5bd773 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1030,14 +1030,16 @@ void nr_schedule_ulsch(module_id_t module_id, harq_id, cur_harq->round, cur_harq->ndi); + gNB_MAC_INST *gNB = RC.nrmac[0]; if (sched_pusch->frame == gNB->handled_frame && sched_pusch->slot == gNB->handled_slot) { - LOG_D(NR_MAC, "Dropping becasue frame %d == gNB frame %d, slot %d == gNb slot %d\n", - frame, gNB->handled_frame, slot, gNB->handled_slot); + LOG_E(NR_MAC, "Dropping because frame %d == gNB frame %d, slot %d == gNb slot %d\n", + sched_pusch->frame, gNB->handled_frame, sched_pusch->slot, gNB->handled_slot); return; } - gNB->handled_frame = sched_pusch->frame; - gNB->handled_slot = sched_pusch->slot; + gNB->handled_frame = frame; + gNB->handled_slot = slot; + /* PUSCH in a later slot, but corresponding DCI now! */ nfapi_nr_ul_tti_request_t *future_ul_tti_req = &RC.nrmac[module_id]->UL_tti_req_ahead[0][sched_pusch->slot]; AssertFatal(future_ul_tti_req->SFN == sched_pusch->frame