From 389b9cf4ef124ca07d34e9d4053f9cafcbc9a870 Mon Sep 17 00:00:00 2001 From: Guido Date: Wed, 11 Jan 2023 17:48:04 +0100 Subject: [PATCH] Reuse old TDA when allocating DL retransmissions - reusing old TDA whenever possible helps allocate DL retransmission when TDA chnges - e.g. nrOfSymbols of new TDA > nrOfSymbols old TDA (leading to TBS size mismatching and allocation failure) - This bugifx improves DL throughput stability in a multi-UE operation --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 2c52d3f52d..fec1fde0dd 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -408,16 +408,27 @@ bool allocate_dl_retransmission(module_id_t module_id, const int tda = get_dl_tda(nr_mac, scc, slot); AssertFatal(tda>=0,"Unable to find PDSCH time domain allocation in list\n"); - if (tda == retInfo->time_domain_allocation && + /* Check first whether the old TDA can be reused + * this helps allocate retransmission when TDA changes (e.g. new nrOfSymbols > old nrOfSymbols) */ + NR_tda_info_t temp_tda = nr_get_pdsch_tda_info(dl_bwp, tda); + const uint16_t temp_bitmap = SL_to_bitmap(temp_tda.startSymbolIndex, temp_tda.nrOfSymbols); + NR_tda_info_t *old_tda = &retInfo->tda_info; + const uint16_t old_bitmap = SL_to_bitmap(old_tda->startSymbolIndex, old_tda->nrOfSymbols); + bool reuse_old_tda = (old_bitmap & temp_bitmap) == old_bitmap; + LOG_D(NR_MAC, "[UE %x] %s old TDA, %s number of layers\n", + UE->rnti, + reuse_old_tda ? "reuse" : "do not reuse", + layers == retInfo->nrOfLayers ? "same" : "different"); + + if ((reuse_old_tda || tda == retInfo->time_domain_allocation) && layers == retInfo->nrOfLayers) { - NR_tda_info_t *tda_info = &retInfo->tda_info; /* Check that there are enough resources for retransmission */ while (rbSize < retInfo->rbSize) { rbStart += rbSize; /* last iteration rbSize was not enough, skip it */ rbSize = 0; - const int slbitmap = SL_to_bitmap(tda_info->startSymbolIndex, tda_info->nrOfSymbols); + const uint16_t slbitmap = reuse_old_tda ? old_bitmap : temp_bitmap; while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap) rbStart++; @@ -434,7 +445,6 @@ bool allocate_dl_retransmission(module_id_t module_id, } else { /* the retransmission will use a different time domain allocation, check * that we have enough resources */ - NR_tda_info_t temp_tda = nr_get_pdsch_tda_info(dl_bwp, tda); NR_pdsch_dmrs_t temp_dmrs = get_dl_dmrs_params(scc, dl_bwp, &temp_tda,