From e42e1d8065c9ea4d6aaeab080a0e631defcc7750 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 29 Aug 2023 10:35:49 +0200 Subject: [PATCH] limiting the number of DCI candidates at UE according to available CCEs --- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 7 +++---- openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c | 8 +++++--- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 0d9f2c2a51..b6de28dd81 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -4554,13 +4554,12 @@ void fill_searchSpaceZero(NR_SearchSpace_t *ss0, ss0->monitoringSymbolsWithinSlot->buf[0] |= ((symbols>>i)&0x01)<<(7-i); } - const uint16_t max_agg = (type0_PDCCH_CSS_config->num_symbols*type0_PDCCH_CSS_config->num_rbs)/6; // max values are set according to TS38.213 Section 10.1 Table 10.1-1 ss0->nrofCandidates->aggregationLevel1 = NR_SearchSpace__nrofCandidates__aggregationLevel1_n0; ss0->nrofCandidates->aggregationLevel2 = NR_SearchSpace__nrofCandidates__aggregationLevel2_n0; - ss0->nrofCandidates->aggregationLevel4 = (((max_agg>>2) > 4)? 4 : max_agg>>2); - ss0->nrofCandidates->aggregationLevel8 = (((max_agg>>3) > 2)? 2 : max_agg>>3); - ss0->nrofCandidates->aggregationLevel16 = (((max_agg>>4) > 1)? 1 : max_agg>>4); + ss0->nrofCandidates->aggregationLevel4 = 4; + ss0->nrofCandidates->aggregationLevel8 = 2; + ss0->nrofCandidates->aggregationLevel16 = 1; ss0->searchSpaceType->present = NR_SearchSpace__searchSpaceType_PR_common; } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c index efcbd7e2ff..d0b114cd1f 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c @@ -56,7 +56,6 @@ void fill_dci_search_candidates(const NR_SearchSpace_t *ss, maxL); if (number_of_candidates > 0) { LOG_D(NR_MAC,"L %d, number of candidates %d, aggregation %d\n", maxL, number_of_candidates, aggregation); - rel15->number_of_candidates += number_of_candidates; int N_cce_sym = 0; // nb of rbs of coreset per symbol for (int f = 0; f < 6; f++) { for (int t = 0; t < 8; t++) { @@ -64,9 +63,12 @@ void fill_dci_search_candidates(const NR_SearchSpace_t *ss, } } int N_cces = N_cce_sym * rel15->coreset.duration; - for (int j = 0; j < number_of_candidates; i++, j++) { + // limit the number of candidates to the ones fitting current configuration + int max_candidates = min(N_cces / aggregation, number_of_candidates); + rel15->number_of_candidates += max_candidates; + for (int j = 0; j < max_candidates; i++, j++) { int first_cce = aggregation * ((Y + ((j * N_cces) / (aggregation * number_of_candidates)) + 0) % (N_cces / aggregation)); - LOG_D(NR_MAC,"Candidate %d of %d first_cce %d (L %d N_cces %d Y %d)\n", j, number_of_candidates, first_cce, aggregation, N_cces, Y); + LOG_D(NR_MAC,"Candidate %d of %d first_cce %d (L %d N_cces %d Y %d)\n", j, max_candidates, first_cce, aggregation, N_cces, Y); rel15->CCE[i] = first_cce; rel15->L[i] = aggregation; } diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 942ec698c3..c5326f0b05 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1165,8 +1165,8 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info) continue; fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list+i; - /* The check below filters out UL_DCIs (format 7) which are being processed as DL_DCIs. */ - if (dci_index->dci_format == 7 && mac->ra.ra_state == RA_SUCCEEDED) { + /* The check below filters out UL_DCIs which are being processed as DL_DCIs. */ + if (dci_index->dci_format != NR_DL_DCI_FORMAT_1_0 && dci_index->dci_format != NR_DL_DCI_FORMAT_1_1) { LOG_D(NR_MAC, "We are filtering a UL_DCI to prevent it from being treated like a DL_DCI\n"); continue; }