From 5951caa91e83f1aab2f13714026e23ef18a6873a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 3 Apr 2024 18:41:28 +0200 Subject: [PATCH] Avoid concurrent write while filling RX/CRC.indication We observe these asserts while running concurrent UL traffic on many UEs: Assertion (crc->rnti == rx->rnti) failed! In handle_nr_ulsch() ../../../openair2/NR_PHY_INTERFACE/NR_IF_Module.c:193 mis-match between CRC RNTI 7221 and RX RNTI 35cf CRC and RX indication need to be pairwise for one UE, when here we have each for different UE. However, investigation seemed to indicate that both arrays for CRC and RX indication contained only one PDU; it seemed the RNTI changed while writing the CRC/RX.indication messages in nr_fill_indication(). In this patch, we change the logic to mark a ULSCH free AFTER calling nr_fill_indication(). It is difficult to say if this makes the assertion disappear, but preliminary tests did not exhibit the same failure states. Closes #773 --- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 5 ++--- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index e04d8fc41a..4c35ee9933 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -292,10 +292,9 @@ int decode_offload(PHY_VARS_gNB *phy_vars_gNB, } if (crc_valid) { LOG_D(PHY, "ULSCH: Setting ACK for slot %d TBS %d\n", ulsch->slot, harq_process->TBS); + nr_fill_indication(phy_vars_gNB, ulsch->frame, ulsch->slot, ULSCH_id, harq_pid, 0, 0); ulsch->active = false; harq_process->round = 0; - LOG_D(PHY, "ULSCH received ok \n"); - nr_fill_indication(phy_vars_gNB, ulsch->frame, ulsch->slot, ULSCH_id, harq_pid, 0, 0); } else { LOG_D(PHY, "[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d)\n", @@ -306,10 +305,10 @@ int decode_offload(PHY_VARS_gNB *phy_vars_gNB, ulsch->active, harq_process->round, harq_process->TBS); + nr_fill_indication(phy_vars_gNB, ulsch->frame, ulsch->slot, ULSCH_id, harq_pid, 1, 0); ulsch->handled = 1; decodeIterations = ulsch->max_ldpc_iterations + 1; LOG_D(PHY, "ULSCH %d in error\n", ULSCH_id); - nr_fill_indication(phy_vars_gNB, ulsch->frame, ulsch->slot, ULSCH_id, harq_pid, 1, 0); } ulsch->last_iteration_cnt = decodeIterations; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 47753c2448..0a348e9c03 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -314,10 +314,10 @@ static void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) ulsch_harq->round, ulsch_harq->TBS, rdata->decodeIterations); + nr_fill_indication(gNB, ulsch->frame, ulsch->slot, rdata->ulsch_id, rdata->harq_pid, 0, 0); + LOG_D(PHY, "ULSCH received ok \n"); ulsch->active = false; ulsch_harq->round = 0; - LOG_D(PHY, "ULSCH received ok \n"); - nr_fill_indication(gNB, ulsch->frame, ulsch->slot, rdata->ulsch_id, rdata->harq_pid, 0, 0); //dumpsig=1; } else { LOG_D(PHY, @@ -335,9 +335,9 @@ static void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) ulsch_harq->ulsch_pdu.rb_size, ulsch_harq->TBS, r); + nr_fill_indication(gNB, ulsch->frame, ulsch->slot, rdata->ulsch_id, rdata->harq_pid, 1, 0); ulsch->handled = 1; LOG_D(PHY, "ULSCH %d in error\n",rdata->ulsch_id); - nr_fill_indication(gNB, ulsch->frame, ulsch->slot, rdata->ulsch_id, rdata->harq_pid, 1, 0); // dumpsig=1; } ulsch->last_iteration_cnt = rdata->decodeIterations;