From 60dca0657b660d2977039467f40d0b7a8b6d68d3 Mon Sep 17 00:00:00 2001 From: David Kim Date: Mon, 27 Sep 2021 12:59:40 -0700 Subject: [PATCH 01/32] processing crc_ind and rx_ind per pdu in gNB. 1. If matched rnti does not exist between crc_ind pdus and rx_ind puds, the ind or unmatched pdus will be requeued. 2. Sending crc_ind and rx_ind togetehr with crc_ind first in nrUE. --- executables/nr-ue.c | 18 +++--- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 73 +++++++++++++++++++++--- 2 files changed, 74 insertions(+), 17 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 41abf55a0f..3ae4f3c655 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -366,15 +366,6 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) free(rach_ind); nr_Msg1_transmitted(mod_id, CC_id, frame, gNB_id); } - if (rx_ind && rx_ind->number_of_pdus > 0) - { - NR_UL_IND_t UL_INFO = { - .rx_ind = *rx_ind, - }; - send_nsa_standalone_msg(&UL_INFO, rx_ind->header.message_id); - free(rx_ind->pdu_list); - free(rx_ind); - } if (crc_ind && crc_ind->number_crcs > 0) { NR_UL_IND_t UL_INFO = { @@ -384,6 +375,15 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) free(crc_ind->crc_list); free(crc_ind); } + if (rx_ind && rx_ind->number_of_pdus > 0) + { + NR_UL_IND_t UL_INFO = { + .rx_ind = *rx_ind, + }; + send_nsa_standalone_msg(&UL_INFO, rx_ind->header.message_id); + free(rx_ind->pdu_list); + free(rx_ind); + } } return NULL; } diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index cd8ae2a7c9..a791b57ba6 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -78,7 +78,7 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) UL_INFO.module_id = UL_info->module_id; UL_INFO.CC_id = UL_info->CC_id; - int frame_diff = UL_info->frame - rach_ind->sfn; + int frame_diff = UL_info->frame - rach_ind->sfn; if (frame_diff < 0) { frame_diff += 1024; @@ -209,7 +209,7 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) if (!crc_ind) { LOG_D(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot); - requeue(&gnb_rx_ind_queue, rx_ind); + put_queue(&gnb_rx_ind_queue, rx_ind); return; } @@ -227,8 +227,9 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) ); if (rx_ind && UL_INFO.rx_ind.number_of_pdus > 0 && crc_ind && UL_INFO.crc_ind.number_crcs > 0) { - for (int i = 0; i < UL_INFO.rx_ind.number_of_pdus; i++) { - for (int j = 0; j < UL_INFO.crc_ind.number_crcs; j++) { + int i, j; + for (i = 0; i < UL_INFO.rx_ind.number_of_pdus; i++) { + for (j = 0; j < UL_INFO.crc_ind.number_crcs; j++) { // find crc_indication j corresponding rx_indication i const nfapi_nr_rx_data_pdu_t *rx = &UL_INFO.rx_ind.pdu_list[i]; const nfapi_nr_crc_t *crc = &UL_INFO.crc_ind.crc_list[j]; @@ -267,14 +268,70 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) handle_nr_ul_harq(UL_INFO.CC_id, UL_INFO.module_id, UL_INFO.frame, UL_INFO.slot, crc); break; } // for (j=0;jcrc_list[j].handle = crc_ind->crc_list[last].handle; + crc_ind->crc_list[j].harq_id = crc_ind->crc_list[last].harq_id; + crc_ind->crc_list[j].num_cb = crc_ind->crc_list[last].num_cb; + crc_ind->crc_list[j].rnti = crc_ind->crc_list[last].rnti; + crc_ind->crc_list[j].tb_crc_status = crc_ind->crc_list[last].tb_crc_status; + crc_ind->crc_list[j].timing_advance = crc_ind->crc_list[last].timing_advance; + crc_ind->crc_list[j].ul_cqi = crc_ind->crc_list[last].ul_cqi; + UL_INFO.crc_ind.number_crcs--; + + } + else if (j == last) + { + UL_INFO.crc_ind.number_crcs--; + } + + last = UL_INFO.rx_ind.number_of_pdus -1; + if (i < last) + { + int last = UL_INFO.rx_ind.number_of_pdus -1; + rx_ind->pdu_list[i].handle = rx_ind->pdu_list[last].handle; + rx_ind->pdu_list[i].harq_id = rx_ind->pdu_list[last].harq_id; + rx_ind->pdu_list[i].pdu = rx_ind->pdu_list[last].pdu; + rx_ind->pdu_list[i].pdu_length = rx_ind->pdu_list[last].pdu_length; + rx_ind->pdu_list[i].rnti = rx_ind->pdu_list[last].rnti; + rx_ind->pdu_list[i].timing_advance = rx_ind->pdu_list[last].timing_advance; + rx_ind->pdu_list[i].ul_cqi = rx_ind->pdu_list[last].ul_cqi; + UL_INFO.rx_ind.number_of_pdus--; + i--; + } + else if (i == last) + { + UL_INFO.rx_ind.number_of_pdus--; + } } // for (i=0;inumber_crcs > 0) + if (UL_INFO.crc_ind.number_crcs > 0) + { + crc_ind->number_crcs = UL_INFO.crc_ind.number_crcs; + requeue(&gnb_crc_ind_queue, crc_ind); + } + + if (UL_INFO.rx_ind.number_of_pdus > 0) + { + rx_ind->number_of_pdus = UL_INFO.rx_ind.number_of_pdus; + requeue(&gnb_rx_ind_queue, rx_ind); + } + + if (UL_INFO.crc_ind.number_crcs == 0) + { free(crc_ind->crc_list); - free(crc_ind); - if (rx_ind && rx_ind->number_of_pdus > 0) + crc_ind->crc_list = NULL; + free(crc_ind); + crc_ind = NULL; + } + if (UL_INFO.rx_ind.number_of_pdus == 0) + { free(rx_ind->pdu_list); - free(rx_ind); + rx_ind->pdu_list = NULL; + free(rx_ind); + rx_ind = NULL; + } } else if ((rx_ind && UL_INFO.rx_ind.number_of_pdus != 0) || (crc_ind && UL_INFO.crc_ind.number_crcs != 0)) { LOG_E(NR_PHY, From 4cbea4cc8cd9a0cdbe136d0ef8730d3d24526367 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 28 Sep 2021 14:30:31 -0700 Subject: [PATCH 02/32] Cleaning up MR code --- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 28 ++++++------------------ 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index a791b57ba6..1e9db6ed9b 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -227,8 +227,8 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) ); if (rx_ind && UL_INFO.rx_ind.number_of_pdus > 0 && crc_ind && UL_INFO.crc_ind.number_crcs > 0) { - int i, j; - for (i = 0; i < UL_INFO.rx_ind.number_of_pdus; i++) { + for (int i = 0; i < UL_INFO.rx_ind.number_of_pdus; i++) { + int j; for (j = 0; j < UL_INFO.crc_ind.number_crcs; j++) { // find crc_indication j corresponding rx_indication i const nfapi_nr_rx_data_pdu_t *rx = &UL_INFO.rx_ind.pdu_list[i]; @@ -268,35 +268,21 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) handle_nr_ul_harq(UL_INFO.CC_id, UL_INFO.module_id, UL_INFO.frame, UL_INFO.slot, crc); break; } // for (j=0;jcrc_list[j].handle = crc_ind->crc_list[last].handle; - crc_ind->crc_list[j].harq_id = crc_ind->crc_list[last].harq_id; - crc_ind->crc_list[j].num_cb = crc_ind->crc_list[last].num_cb; - crc_ind->crc_list[j].rnti = crc_ind->crc_list[last].rnti; - crc_ind->crc_list[j].tb_crc_status = crc_ind->crc_list[last].tb_crc_status; - crc_ind->crc_list[j].timing_advance = crc_ind->crc_list[last].timing_advance; - crc_ind->crc_list[j].ul_cqi = crc_ind->crc_list[last].ul_cqi; + crc_ind->crc_list[j] = rc_ind->crc_list[last]; UL_INFO.crc_ind.number_crcs--; - } else if (j == last) { UL_INFO.crc_ind.number_crcs--; } - - last = UL_INFO.rx_ind.number_of_pdus -1; + + last = UL_INFO.rx_ind.number_of_pdus - 1; if (i < last) { - int last = UL_INFO.rx_ind.number_of_pdus -1; - rx_ind->pdu_list[i].handle = rx_ind->pdu_list[last].handle; - rx_ind->pdu_list[i].harq_id = rx_ind->pdu_list[last].harq_id; - rx_ind->pdu_list[i].pdu = rx_ind->pdu_list[last].pdu; - rx_ind->pdu_list[i].pdu_length = rx_ind->pdu_list[last].pdu_length; - rx_ind->pdu_list[i].rnti = rx_ind->pdu_list[last].rnti; - rx_ind->pdu_list[i].timing_advance = rx_ind->pdu_list[last].timing_advance; - rx_ind->pdu_list[i].ul_cqi = rx_ind->pdu_list[last].ul_cqi; + rx_ind->pdu_list[i] = rx_ind->pdu_list[last]; UL_INFO.rx_ind.number_of_pdus--; i--; } From abb81d8d70a14ba8f0203d6892b0b55c4fcb4514 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 28 Sep 2021 14:46:40 -0700 Subject: [PATCH 03/32] Fixing a typo --- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 1e9db6ed9b..291d445969 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -271,7 +271,7 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) int last = UL_INFO.crc_ind.number_crcs - 1; if (j < last) { - crc_ind->crc_list[j] = rc_ind->crc_list[last]; + crc_ind->crc_list[j] = crc_ind->crc_list[last]; UL_INFO.crc_ind.number_crcs--; } else if (j == last) From cf0430a5bc444aee126bd901a83151645a3f9eec Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 29 Sep 2021 12:15:58 -0700 Subject: [PATCH 04/32] Correctly packing UCI indications. Also, removing memset for def_dci_pdu_rel15 because it is setting the DL_BWP_ID = 0 before we have used it. --- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 4 ++-- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 2 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index 919fc577a9..97e22d3747 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -3301,8 +3301,8 @@ static uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uin for(int i=0; inum_ucis;i++) { - if(!pack_nr_uci_indication_body(pNfapiMsg->uci_list,ppWritePackedMsg,end)) - return 0; + if (!pack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppWritePackedMsg, end)) + return 0; } return 1; diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 954b9867dc..4bf3717c9b 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -184,7 +184,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response uci_ind->uci_list[j].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t); pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR pdu_0_1->handle = 0; - pdu_0_1->rnti = dl_config->dl_config_list[0].dlsch_config_pdu.rnti; + pdu_0_1->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti; pdu_0_1->pucch_format = 1; pdu_0_1->ul_cqi = 27; pdu_0_1->timing_advance = 0; diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 318efebfd7..ace5a2d536 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -905,7 +905,6 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci_index->dci_format]; g_harq_pid = def_dci_pdu_rel15->harq_pid; LOG_D(NR_MAC, "Setting harq_pid = %d and dci_index = %d (based on format)\n", g_harq_pid, dci_index->dci_format); - memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15)); ret_mask |= (ret << FAPI_NR_DCI_IND); if (ret >= 0) { From b2d1052fe91db5aacdc99dbb22caf2dce829fab2 Mon Sep 17 00:00:00 2001 From: David Kim Date: Thu, 30 Sep 2021 17:07:44 -0700 Subject: [PATCH 05/32] Added some config files after restoring original config files. --- ci-scripts/conf_files/episci_nr-ue.nfapi.conf | 44 +++ .../episci_rcc.band7.tm1.nfapi.conf | 247 ++++++++++++++++ ci-scripts/conf_files/episci_ue.nfapi.conf | 44 +++ .../conf_files/rcc.band7.tm1.nfapi.conf | 27 +- ci-scripts/conf_files/ue.nfapi.conf | 4 +- .../episci_rcc.band78.tm1.106PRB.nfapi.conf | 265 ++++++++++++++++++ .../CONF/rcc.band78.tm1.106PRB.nfapi.conf | 140 +++++---- 7 files changed, 698 insertions(+), 73 deletions(-) create mode 100644 ci-scripts/conf_files/episci_nr-ue.nfapi.conf create mode 100644 ci-scripts/conf_files/episci_rcc.band7.tm1.nfapi.conf create mode 100644 ci-scripts/conf_files/episci_ue.nfapi.conf create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/episci_rcc.band78.tm1.106PRB.nfapi.conf diff --git a/ci-scripts/conf_files/episci_nr-ue.nfapi.conf b/ci-scripts/conf_files/episci_nr-ue.nfapi.conf new file mode 100644 index 0000000000..b12e0c8d05 --- /dev/null +++ b/ci-scripts/conf_files/episci_nr-ue.nfapi.conf @@ -0,0 +1,44 @@ +log_config = { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="medium"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="full"; +}; + + +L1s = ( + { + num_cc = 1; + tr_n_preference = "nfapi"; + local_n_if_name = "ens3"; + remote_n_address = "127.0.0.1"; //Proxy IP + local_n_address = "127.0.0.1"; + local_n_portc = 50600; + remote_n_portc = 50601; + local_n_portd = 50610; + remote_n_portd = 50611; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 90 + att_rx = 0; + bands = [7,38,42,43]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 125; + } +); diff --git a/ci-scripts/conf_files/episci_rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/episci_rcc.band7.tm1.nfapi.conf new file mode 100644 index 0000000000..4e596f81b5 --- /dev/null +++ b/ci-scripts/conf_files/episci_rcc.band7.tm1.nfapi.conf @@ -0,0 +1,247 @@ +Active_eNBs = ( "eNB-Eurecom-LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB-Eurecom-LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 5; + + plmn_list = ( { mcc = 320; mnc = 230; mnc_length = 3; } ); + + tr_s_preference = "local_mac" + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "3GPP_eNODEB"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2685000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + pbch_repetition = "FALSE"; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 0; + pucch_nCS_AN = 0; + pucch_n1_AN = 0; + pdsch_referenceSignalPower = -27; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -104; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 1; + + //Parameters for SIB18 + rxPool_sc_CP_Len = "normal"; + rxPool_sc_Period = "sf40"; + rxPool_data_CP_Len = "normal"; + rxPool_ResourceConfig_prb_Num = 20; + rxPool_ResourceConfig_prb_Start = 5; + rxPool_ResourceConfig_prb_End = 44; + rxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + rxPool_ResourceConfig_offsetIndicator_choice = 0; + rxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; +/* rxPool_dataHoppingConfig_hoppingParameter = 0; + rxPool_dataHoppingConfig_numSubbands = "ns1"; + rxPool_dataHoppingConfig_rbOffset = 0; + rxPool_commTxResourceUC-ReqAllowed = "TRUE"; +*/ + // Parameters for SIB19 + discRxPool_cp_Len = "normal" + discRxPool_discPeriod = "rf32" + discRxPool_numRetx = 1; + discRxPool_numRepetition = 2; + discRxPool_ResourceConfig_prb_Num = 5; + discRxPool_ResourceConfig_prb_Start = 3; + discRxPool_ResourceConfig_prb_End = 21; + discRxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + discRxPool_ResourceConfig_offsetIndicator_choice = 0; + discRxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.61.195"; + ipv6 = "192:168:30::17"; + port = 36412 ; + active = "yes"; + preference = "ipv4"; + } + ); + + enable_measurement_reports = "yes"; + + ///X2 + enable_x2 = "yes"; + t_reloc_prep = 1000; /* unit: millisecond */ + tx2_reloc_overall = 2000; /* unit: millisecond */ + t_dc_prep = 1000; /* unit: millisecond */ + t_dc_overall = 2000; /* unit: millisecond */ + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "ctrl0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "172.16.0.1"; + ENB_INTERFACE_NAME_FOR_S1U = "ctrl0"; + ENB_IPV4_ADDRESS_FOR_S1U = "172.16.0.1"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + ENB_IPV4_ADDRESS_FOR_X2C = "172.16.0.1"; + ENB_PORT_FOR_X2C = 36422; # Spec 36422 + + }; + } +); + +MACRLCs = ( + { + num_cc = 1; + local_s_if_name = "lo"; + remote_s_address = "127.0.0.1"; + local_s_address = "127.0.0.1"; + local_s_portc = 50001; + remote_s_portc = 50000; + local_s_portd = 50011; + remote_s_portd = 50010; + tr_s_preference = "nfapi"; + tr_n_preference = "local_RRC"; + scheduler_mode = "fairRR"; + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_RU_L1_SPLIT"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +log_config = + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; diff --git a/ci-scripts/conf_files/episci_ue.nfapi.conf b/ci-scripts/conf_files/episci_ue.nfapi.conf new file mode 100644 index 0000000000..0170a46655 --- /dev/null +++ b/ci-scripts/conf_files/episci_ue.nfapi.conf @@ -0,0 +1,44 @@ +log_config = { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="medium"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="full"; +}; + + +L1s = ( + { + num_cc = 1; + tr_n_preference = "nfapi"; + local_n_if_name = "ens3"; + remote_n_address = "127.0.0.1"; //Proxy IP + local_n_address = "127.0.0.1"; + local_n_portc = 50000; + remote_n_portc = 50001; + local_n_portd = 50010; + remote_n_portd = 50011; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 90 + att_rx = 0; + bands = [7,38,42,43]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 125; + } +); diff --git a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf index 4e596f81b5..281f7433af 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf @@ -13,9 +13,9 @@ eNBs = eNB_name = "eNB-Eurecom-LTEBox"; // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 5; + tracking_area_code = 1; - plmn_list = ( { mcc = 320; mnc = 230; mnc_length = 3; } ); + plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2; } ); tr_s_preference = "local_mac" @@ -172,7 +172,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.61.195"; + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; ipv6 = "192:168:30::17"; port = 36412 ; active = "yes"; @@ -180,10 +180,10 @@ eNBs = } ); - enable_measurement_reports = "yes"; + enable_measurement_reports = "no"; ///X2 - enable_x2 = "yes"; + enable_x2 = "no"; t_reloc_prep = 1000; /* unit: millisecond */ tx2_reloc_overall = 2000; /* unit: millisecond */ t_dc_prep = 1000; /* unit: millisecond */ @@ -191,12 +191,12 @@ eNBs = NETWORK_INTERFACES : { - ENB_INTERFACE_NAME_FOR_S1_MME = "ctrl0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "172.16.0.1"; - ENB_INTERFACE_NAME_FOR_S1U = "ctrl0"; - ENB_IPV4_ADDRESS_FOR_S1U = "172.16.0.1"; + ENB_INTERFACE_NAME_FOR_S1_MME = "ens3"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; + ENB_INTERFACE_NAME_FOR_S1U = "ens3"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 - ENB_IPV4_ADDRESS_FOR_X2C = "172.16.0.1"; + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; @@ -206,16 +206,15 @@ eNBs = MACRLCs = ( { num_cc = 1; - local_s_if_name = "lo"; - remote_s_address = "127.0.0.1"; - local_s_address = "127.0.0.1"; + local_s_if_name = "ens3"; + remote_s_address = "CI_UE_IP_ADDR"; + local_s_address = "CI_ENB_IP_ADDR"; local_s_portc = 50001; remote_s_portc = 50000; local_s_portd = 50011; remote_s_portd = 50010; tr_s_preference = "nfapi"; tr_n_preference = "local_RRC"; - scheduler_mode = "fairRR"; } ); diff --git a/ci-scripts/conf_files/ue.nfapi.conf b/ci-scripts/conf_files/ue.nfapi.conf index 0170a46655..2b602cbcf2 100644 --- a/ci-scripts/conf_files/ue.nfapi.conf +++ b/ci-scripts/conf_files/ue.nfapi.conf @@ -21,8 +21,8 @@ L1s = ( num_cc = 1; tr_n_preference = "nfapi"; local_n_if_name = "ens3"; - remote_n_address = "127.0.0.1"; //Proxy IP - local_n_address = "127.0.0.1"; + remote_n_address = "CI_ENB_IP_ADDR"; + local_n_address = "CI_UE_IP_ADDR"; local_n_portc = 50000; remote_n_portc = 50001; local_n_portd = 50010; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/episci_rcc.band78.tm1.106PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/episci_rcc.band78.tm1.106PRB.nfapi.conf new file mode 100644 index 0000000000..b64b88ddea --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/episci_rcc.band78.tm1.106PRB.nfapi.conf @@ -0,0 +1,265 @@ +Active_gNBs = ( "gNB-Eurecom-5GNRBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + + cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-Eurecom-5GNRBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 5; + + plmn_list = ({mcc = 320; mnc = 230; mnc_length = 3;}); + + tr_s_preference = "local_mac" + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 31; //0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 84 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 641272; //641032; #641968; 641968=start of ssb at 3600MHz + 82 RBs 641032=center of SSB at center of cell + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 640000; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=84,L=13 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 6368; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 0; + initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 6368; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -100; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 5; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; //15; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, + +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; #0x80; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; //8; //7; + nrofDownlinkSymbols = 6; //0; //6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; //0; //4; + + ssPBCH_BlockPower = -25; + } + + ); + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.61.195"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + ///X2 + enable_x2 = "yes"; + t_reloc_prep = 1000; /* unit: millisecond */ + tx2_reloc_overall = 2000; /* unit: millisecond */ + t_dc_prep = 1000; /* unit: millisecond */ + t_dc_overall = 2000; /* unit: millisecond */ + target_enb_x2_ip_address = ( + { ipv4 = "172.16.0.1"; # rrc.band7.tm1.nfapi.conf:line 201 + ipv6 = "192:168:30::17"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { # All of these have to be IP addr of gNB + # if in CORE container, make it 172.16.0.X + # if not launched in CORE, can set to lo (127.0.0.2) + GNB_INTERFACE_NAME_FOR_S1_MME = "ctrl0"; + GNB_IPV4_ADDRESS_FOR_S1_MME = "172.16.0.2"; + GNB_INTERFACE_NAME_FOR_S1U = "ctrl0"; + GNB_IPV4_ADDRESS_FOR_S1U = "172.16.0.2"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + GNB_IPV4_ADDRESS_FOR_X2C = "172.16.0.2"; + GNB_PORT_FOR_X2C = 36422; # Spec 36422 + }; + } +); + + +MACRLCs = ( + { + num_cc = 1; + local_s_if_name = "lo:"; + remote_s_address = "127.0.0.1"; // pnf addr [!] + local_s_address = "127.0.0.2"; // vnf addr + local_s_portc = 50601; // vnf p5 port + remote_s_portc = 50600; // pnf p5 port [!] + local_s_portd = 50611; // vnf p7 port [!] + remote_s_portd = 50610; // pnf p7 port [!] + tr_s_preference = "nfapi"; + tr_n_preference = "local_RRC"; + } +) + + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_RU_L1_TRX_SPLIT"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +log_config = + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf index b64b88ddea..e541607559 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf @@ -13,18 +13,18 @@ gNBs = gNB_name = "gNB-Eurecom-5GNRBox"; // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 5; + tracking_area_code = 1; - plmn_list = ({mcc = 320; mnc = 230; mnc_length = 3;}); + plmn_list = ({mcc = 208; mnc = 93; mnc_length = 2;}); tr_s_preference = "local_mac" ////////// Physical parameters: - ssb_SubcarrierOffset = 31; //0; + ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - + servingCellConfigCommon = ( { #spCellConfigCommon @@ -33,8 +33,8 @@ gNBs = # downlinkConfigCommon #frequencyInfoDL - # this is 3600 MHz + 84 PRBs@30kHz SCS (same as initial BWP) - absoluteFrequencySSB = 641272; //641032; #641968; 641968=start of ssb at 3600MHz + 82 RBs 641032=center of SSB at center of cell + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 641032; dl_frequencyBand = 78; # this is 3600 MHz dl_absoluteFrequencyPointA = 640000; @@ -46,23 +46,37 @@ gNBs = dl_carrierBandwidth = 106; #initialDownlinkBWP #genericParameters - # this is RBstart=84,L=13 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 6368; + # this is RBstart=41,L=24 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 6366; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 0; + initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; #pdsch-ConfigCommon #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=2,L=12 + initialDLBWPstartSymbolAndLength_1 = 53; + + initialDLBWPk0_2 = 0; + initialDLBWPmappingType_2 = 0; + #this is SS=1,L=12 + initialDLBWPstartSymbolAndLength_2 = 54; + + initialDLBWPk0_3 = 0; + initialDLBWPmappingType_3 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -76,7 +90,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 6368; + initialULBWPlocationAndBandwidth = 6366; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; @@ -88,7 +102,7 @@ gNBs = prach_msg1_FDM = 0; prach_msg1_FrequencyStart = 0; zeroCorrelationZoneConfig = 13; - preambleReceivedTargetPower = -100; + preambleReceivedTargetPower = -118; #preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) preambleTransMax = 6; #powerRampingStep @@ -96,12 +110,12 @@ gNBs = powerRampingStep = 1; #ra_ReponseWindow #1,2,4,8,10,20,40,80 - ra_ResponseWindow = 5; + ra_ResponseWindow = 4; #ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR #1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; #oneHalf (0..15) 4,8,12,16,...60,64 - ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; //15; + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; #ra_ContentionResolutionTimer #(0..7) 8,16,24,32,40,48,56,64 ra_ContentionResolutionTimer = 7; @@ -113,22 +127,25 @@ gNBs = # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex # msg1_SubcarrierSpacing = 1, - # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot + initialULBWPk2_0 = 6; initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_0 = 55; - initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPk2_1 = 6; initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; - initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPk2_2 = 7; initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; @@ -142,7 +159,7 @@ gNBs = # ssb_PositionsInBurs_BitmapPR # 1=short, 2=medium, 3=long ssb_PositionsInBurst_PR = 2; - ssb_PositionsInBurst_Bitmap = 1; #0x80; + ssb_PositionsInBurst_Bitmap = 1; # ssb_periodicityServingCell # 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 @@ -165,16 +182,40 @@ gNBs = # dl_UL_TransmissionPeriodicity # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 dl_UL_TransmissionPeriodicity = 6; - nrofDownlinkSlots = 7; //8; //7; - nrofDownlinkSymbols = 6; //0; //6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; nrofUplinkSlots = 2; - nrofUplinkSymbols = 4; //0; //4; + nrofUplinkSymbols = 4; - ssPBCH_BlockPower = -25; + ssPBCH_BlockPower = 10; } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + # ------- SCTP definitions SCTP : { @@ -185,36 +226,21 @@ gNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.61.195"; + mme_ip_address = ( { ipv4 = "192.168.12.26"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; } ); - ///X2 - enable_x2 = "yes"; - t_reloc_prep = 1000; /* unit: millisecond */ - tx2_reloc_overall = 2000; /* unit: millisecond */ - t_dc_prep = 1000; /* unit: millisecond */ - t_dc_overall = 2000; /* unit: millisecond */ - target_enb_x2_ip_address = ( - { ipv4 = "172.16.0.1"; # rrc.band7.tm1.nfapi.conf:line 201 - ipv6 = "192:168:30::17"; - preference = "ipv4"; - } - ); NETWORK_INTERFACES : - { # All of these have to be IP addr of gNB - # if in CORE container, make it 172.16.0.X - # if not launched in CORE, can set to lo (127.0.0.2) - GNB_INTERFACE_NAME_FOR_S1_MME = "ctrl0"; - GNB_IPV4_ADDRESS_FOR_S1_MME = "172.16.0.2"; - GNB_INTERFACE_NAME_FOR_S1U = "ctrl0"; - GNB_IPV4_ADDRESS_FOR_S1U = "172.16.0.2"; + { + + GNB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; + GNB_INTERFACE_NAME_FOR_S1U = "eth0"; + GNB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; GNB_PORT_FOR_S1U = 2152; # Spec 2152 - GNB_IPV4_ADDRESS_FOR_X2C = "172.16.0.2"; - GNB_PORT_FOR_X2C = 36422; # Spec 36422 }; } ); @@ -226,10 +252,10 @@ MACRLCs = ( local_s_if_name = "lo:"; remote_s_address = "127.0.0.1"; // pnf addr [!] local_s_address = "127.0.0.2"; // vnf addr - local_s_portc = 50601; // vnf p5 port - remote_s_portc = 50600; // pnf p5 port [!] - local_s_portd = 50611; // vnf p7 port [!] - remote_s_portd = 50610; // pnf p7 port [!] + local_s_portc = 50001; // vnf p5 port + remote_s_portc = 50000; // pnf p5 port [!] + local_s_portd = 50011; // vnf p7 port [!] + remote_s_portd = 50010; // pnf p7 port [!] tr_s_preference = "nfapi"; tr_n_preference = "local_RRC"; } From ce8301ba3806b759a63e22c150b009a90b786881 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 30 Sep 2021 19:25:57 -0700 Subject: [PATCH 06/32] Setting SR flag to 0 in NR UE to ensure we dont handle SRs --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 1 + openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 4bf3717c9b..5e441a804f 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -182,6 +182,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[j].pucch_pdu_format_0_1; uci_ind->uci_list[j].pdu_type = NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE; uci_ind->uci_list[j].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t); + memset(pdu_0_1, 0, sizeof(*pdu_0_1)); pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR pdu_0_1->handle = 0; pdu_0_1->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti; diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index ace5a2d536..307c6fd5aa 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -396,13 +396,26 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n pdu_list->pdu_type, ul_tti_req->pdus_list[i].pucch_pdu.rnti); if (pdu_list->pdu_type == NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE && pdu_list->pucch_pdu.rnti == mac->crnti) { + LOG_I(NR_MAC, "This is the number of UCIs in the queue %ld\n", nr_uci_ind_queue.num_items); nfapi_nr_uci_indication_t *uci_ind = get_queue(&nr_uci_ind_queue); if (uci_ind) { + LOG_I(NR_MAC, "This is the SFN/SF [%d, %d] of the UCI ind. \n", uci_ind->sfn, uci_ind->slot); if (uci_ind->num_ucis > 0) { uci_ind->sfn = ul_tti_req->SFN; uci_ind->slot = ul_tti_req->Slot; + if (pdu_list->pucch_pdu.sr_flag) + { + for (int j = 0; j < uci_ind->num_ucis; j++) + { + nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[j].pucch_pdu_format_0_1; + pdu_0_1->sr = CALLOC(1, sizeof(*pdu_0_1->sr)); + pdu_0_1->sr->sr_confidence_level = 0; + pdu_0_1->sr->sr_indication = 0; + } + + } LOG_I(NR_MAC, "We have dequeued the previously filled uci_ind and updated the snf/slot to %d/%d.\n", uci_ind->sfn, uci_ind->slot); NR_UL_IND_t UL_INFO = { @@ -410,9 +423,10 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n }; send_nsa_standalone_msg(&UL_INFO, uci_ind->header.message_id); } - for (int j = 0; j < uci_ind->num_ucis; j++) + for (int k = 0; k < uci_ind->num_ucis; k++) { - nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[j].pucch_pdu_format_0_1; + nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[k].pucch_pdu_format_0_1; + free(pdu_0_1->sr); free(pdu_0_1->harq->harq_list); free(pdu_0_1->harq); } From a5d6ff5a75c551b4d70c763e2ca870fe0419978d Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 1 Oct 2021 14:24:15 -0700 Subject: [PATCH 07/32] We are now sending either SR or HARQ based on UL_TTI_REQ This requires some updates to the nFAPI code as well. We also have declared the def_dci_rel15 extern variable consistently throughout the code. In this commit, the gNB is still crashing. However, it seems that the NSA UE is sending the proper responses back, but there some sort of incorrect management of the def_dci_pdu_rel15 variable. If we memset this array to 0, we can see incorrect 0 assignments to elements of the UCI indications. Hopefully fixing this issue will result in less gNB crashes. --- nfapi/oai_integration/nfapi_vnf.c | 38 ++++++---- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 7 +- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 25 ++----- openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h | 2 +- openair2/LAYER2/NR_MAC_UE/mac_extern.h | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 6 +- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 13 +++- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 72 ++++++++++++------- 8 files changed, 102 insertions(+), 63 deletions(-) diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index cfaf71b3f3..fb01064f09 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -788,17 +788,21 @@ int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind) case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: { nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_ind_pdu = &uci_ind->uci_list[i].pucch_pdu_format_0_1; nfapi_nr_uci_pucch_pdu_format_0_1_t *ind_pdu = &ind->uci_list[i].pucch_pdu_format_0_1; - - uci_ind_pdu->harq = CALLOC(1, sizeof(*uci_ind_pdu->harq)); - AssertFatal(uci_ind_pdu->harq != NULL, "Memory not allocated for uci_ind_pdu->harq in phy_nr_uci_indication."); + if (ind_pdu->sr) { + uci_ind_pdu->sr = CALLOC(1, sizeof(*uci_ind_pdu->sr)); + AssertFatal(uci_ind_pdu->sr != NULL, "Memory not allocated for uci_ind_pdu->harq in phy_nr_uci_indication."); + *uci_ind_pdu->sr = *ind_pdu->sr; + } + if (ind_pdu->harq) { + uci_ind_pdu->harq = CALLOC(1, sizeof(*uci_ind_pdu->harq)); + AssertFatal(uci_ind_pdu->harq != NULL, "Memory not allocated for uci_ind_pdu->harq in phy_nr_uci_indication."); - *uci_ind_pdu->harq = *ind_pdu->harq; - - uci_ind_pdu->harq->harq_list = CALLOC(uci_ind_pdu->harq->num_harq, sizeof(*uci_ind_pdu->harq->harq_list)); - AssertFatal(uci_ind_pdu->harq->harq_list != NULL, "Memory not allocated for uci_ind_pdu->harq->harq_list in phy_nr_uci_indication."); - for (int j = 0; j < uci_ind_pdu->harq->num_harq; j++) - uci_ind_pdu->harq->harq_list[j].harq_value = ind_pdu->harq->harq_list[j].harq_value; - + *uci_ind_pdu->harq = *ind_pdu->harq; + uci_ind_pdu->harq->harq_list = CALLOC(uci_ind_pdu->harq->num_harq, sizeof(*uci_ind_pdu->harq->harq_list)); + AssertFatal(uci_ind_pdu->harq->harq_list != NULL, "Memory not allocated for uci_ind_pdu->harq->harq_list in phy_nr_uci_indication."); + for (int j = 0; j < uci_ind_pdu->harq->num_harq; j++) + uci_ind_pdu->harq->harq_list[j].harq_value = ind_pdu->harq->harq_list[j].harq_value; + } break; } @@ -832,8 +836,16 @@ int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind) { if (uci_ind->uci_list[i].pdu_type == NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE) { - free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list); - free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq); + if (uci_ind->uci_list[i].pucch_pdu_format_0_1.harq) { + free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list); + uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list = NULL; + free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq); + uci_ind->uci_list[i].pucch_pdu_format_0_1.harq = NULL; + } + if (uci_ind->uci_list[i].pucch_pdu_format_0_1.sr) { + free(uci_ind->uci_list[i].pucch_pdu_format_0_1.sr); + uci_ind->uci_list[i].pucch_pdu_format_0_1.sr = NULL; + } } if (uci_ind->uci_list[i].pdu_type == NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE) { @@ -843,7 +855,9 @@ int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind) } } free(uci_ind->uci_list); + uci_ind->uci_list = NULL; free(uci_ind); + uci_ind = NULL; } } else { diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index 97e22d3747..b0ff94e684 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -5865,7 +5865,12 @@ static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *valu )) return 0; if (value->pduBitmap & 0x01) { //SR - value->sr = (nfapi_nr_sr_pdu_0_1_t*) malloc(sizeof(nfapi_nr_sr_pdu_0_1_t)); + value->sr = nfapi_p7_allocate(sizeof(*value->sr), config); + if (value->sr == NULL) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate sr pdu\n", __FUNCTION__); + return 0; + } if(!(pull8(ppReadPackedMsg, &value->sr->sr_indication, end) && pull8(ppReadPackedMsg, &value->sr->sr_confidence_level, end) )) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 5e441a804f..e2a92781d8 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -92,7 +92,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response memcpy(rx_ind->pdu_list[j].pdu, tx_req_body->pdu, tx_req_body->pdu_length * sizeof(*rx_ind->pdu_list[j].pdu)); rx_ind->pdu_list[j].rnti = pusch_config_pdu->rnti; rx_ind->pdu_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance; - rx_ind->pdu_list[j].ul_cqi = scheduled_response->tx_request->tx_config.ul_cqi; + rx_ind->pdu_list[j].ul_cqi = 255; // scheduled_response->tx_request->tx_config.ul_cqi; char buffer[1024]; hexdump(rx_ind->pdu_list[j].pdu, rx_ind->pdu_list[j].pdu_length, buffer, sizeof(buffer)); LOG_D(MAC, "Melissa Elkadi, this is hexdump of pdu %s before queuing rx_ind\n", @@ -183,38 +183,21 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response uci_ind->uci_list[j].pdu_type = NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE; uci_ind->uci_list[j].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t); memset(pdu_0_1, 0, sizeof(*pdu_0_1)); - pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR pdu_0_1->handle = 0; pdu_0_1->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti; pdu_0_1->pucch_format = 1; - pdu_0_1->ul_cqi = 27; + pdu_0_1->ul_cqi = 255; pdu_0_1->timing_advance = 0; pdu_0_1->rssi = 0; - pdu_0_1->harq = CALLOC(1, sizeof(*pdu_0_1->harq)); - pdu_0_1->harq->num_harq = 1; - pdu_0_1->harq->harq_confidence_level = 0; - pdu_0_1->harq->harq_list = CALLOC(pdu_0_1->harq->num_harq, sizeof(*pdu_0_1->harq->harq_list)); - for (int k = 0; k < pdu_0_1->harq->num_harq; k++) - { - pdu_0_1->harq->harq_list[k].harq_value = 0; - } } LOG_I(NR_PHY, "In %s: Filled queue uci_ind which was filled by dlconfig.\n" - "uci_num %d, uci_slot %d, uci_frame %d and num_harqs %d\n", - __FUNCTION__, uci_ind->num_ucis, uci_ind->slot, uci_ind->sfn, uci_ind->uci_list[0].pucch_pdu_format_0_1.harq->num_harq); + "uci_num %d, SFN/SLOT: [%d, %d]\n", + __FUNCTION__, uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot); if (!put_queue(&nr_uci_ind_queue, uci_ind)) { LOG_E(NR_MAC, "Put_queue failed for uci_ind\n"); - //free(uci_ind->uci_list[0].pucch_pdu_format_0_1.harq->harq_list); - //free(uci_ind->uci_list[0].pucch_pdu_format_0_1.harq); - for (int j = 0; j < uci_ind->num_ucis; j++) - { - nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[j].pucch_pdu_format_0_1; - free(pdu_0_1->harq->harq_list); - free(pdu_0_1->harq); - } free(uci_ind->uci_list); free(uci_ind); } diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h index f81e15d5fd..8145a37b45 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h @@ -39,7 +39,7 @@ extern const uint8_t nr_slots_per_frame[5]; -extern dci_pdu_rel15_t *def_dci_pdu_rel15; +extern dci_pdu_rel15_t def_dci_pdu_rel15[8]; /* extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE]; extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE]; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_extern.h b/openair2/LAYER2/NR_MAC_UE/mac_extern.h index 7fd63666f0..7dd2a740f6 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_extern.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_extern.h @@ -66,7 +66,7 @@ extern const uint8_t table_7_3_2_3_3_4_twoCodeword[6][10]; extern const uint16_t table_7_2_1[16]; -extern dci_pdu_rel15_t *def_dci_pdu_rel15; +extern dci_pdu_rel15_t def_dci_pdu_rel15[8]; extern void mac_rlc_data_ind(const module_id_t module_idP, const rnti_t rntiP, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 9cc9221d25..50e8a82f9d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1109,8 +1109,10 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id, // tpc (power control) only if we received AckNack or positive SR. For a // negative SR, the UE won't have sent anything, and the SNR is not valid if (((uci_01->pduBitmap >> 1) & 0x1) || sched_ctrl->SR) { - if (uci_01->harq->harq_confidence_level==0) sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10, uci_01->ul_cqi, 30); - else sched_ctrl->tpc1 = 3; + if (((uci_01->pduBitmap >> 1) & 0x1) && uci_01->harq->harq_confidence_level==0) + sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10, uci_01->ul_cqi, 30); + else + sched_ctrl->tpc1 = 3; sched_ctrl->pucch_snrx10 = uci_01->ul_cqi * 5 - 640; } } diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 291d445969..afc335f1bb 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -156,8 +156,16 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) for (int i = 0; i < num_ucis; i++) { switch (uci_list[i].pdu_type) { case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: + if (uci_list[i].pucch_pdu_format_0_1.harq) { free(uci_list[i].pucch_pdu_format_0_1.harq->harq_list); + uci_list[i].pucch_pdu_format_0_1.harq->harq_list = NULL; free(uci_list[i].pucch_pdu_format_0_1.harq); + uci_list[i].pucch_pdu_format_0_1.harq = NULL; + } + if (uci_list[i].pucch_pdu_format_0_1.sr) { + free(uci_list[i].pucch_pdu_format_0_1.sr); + uci_list[i].pucch_pdu_format_0_1.sr = NULL; + } break; case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: @@ -167,9 +175,12 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) break; } } - if (uci_ind && num_ucis > 0) + if (uci_ind && num_ucis > 0) { free(uci_list); + uci_list = NULL; + } free(uci_ind); + uci_ind = NULL; } static bool crc_sfn_slot_matcher(void *wanted, void *candidate) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 307c6fd5aa..2aeb289b41 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -392,46 +392,70 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n for (int i = 0; i < num_pdus; i++) { nfapi_nr_ul_tti_request_number_of_pdus_t *pdu_list = &ul_tti_req->pdus_list[i]; - LOG_D(NR_PHY, "This is the pdu type %d and rnti %x in ul_tti_req\n", - pdu_list->pdu_type, ul_tti_req->pdus_list[i].pucch_pdu.rnti); + LOG_D(NR_PHY, "This is the pdu type %d and rnti %x and SR flag %d and harq_pdu_len %d in in ul_tti_req\n", + pdu_list->pdu_type, ul_tti_req->pdus_list[i].pucch_pdu.rnti, pdu_list->pucch_pdu.sr_flag, pdu_list->pucch_pdu.bit_len_harq); if (pdu_list->pdu_type == NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE && pdu_list->pucch_pdu.rnti == mac->crnti) { LOG_I(NR_MAC, "This is the number of UCIs in the queue %ld\n", nr_uci_ind_queue.num_items); nfapi_nr_uci_indication_t *uci_ind = get_queue(&nr_uci_ind_queue); - if (uci_ind) + if (uci_ind && uci_ind->num_ucis > 0) { - LOG_I(NR_MAC, "This is the SFN/SF [%d, %d] of the UCI ind. \n", uci_ind->sfn, uci_ind->slot); - if (uci_ind->num_ucis > 0) + LOG_D(NR_MAC, "This is the SFN/SF [%d, %d] and RNTI %x of the UCI ind. ul_tti_req.pdu[%d]->rnti = %x \n", + uci_ind->sfn, uci_ind->slot, uci_ind->uci_list[0].pucch_pdu_format_0_1.rnti, i, ul_tti_req->pdus_list[i].pucch_pdu.rnti); + uci_ind->sfn = ul_tti_req->SFN; + uci_ind->slot = ul_tti_req->Slot; + for (int j = 0; j < uci_ind->num_ucis; j++) { - uci_ind->sfn = ul_tti_req->SFN; - uci_ind->slot = ul_tti_req->Slot; + nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[j].pucch_pdu_format_0_1; if (pdu_list->pucch_pdu.sr_flag) { - for (int j = 0; j < uci_ind->num_ucis; j++) + LOG_D(NR_MAC, "We have the SR flag in pdu i %d\n", i); + pdu_0_1->pduBitmap = 1; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR + pdu_0_1->sr = CALLOC(1, sizeof(*pdu_0_1->sr)); + pdu_0_1->sr->sr_confidence_level = 0; + pdu_0_1->sr->sr_indication = 1; + } + if (pdu_list->pucch_pdu.bit_len_harq > 0) + { + LOG_D(NR_MAC, "We have the Harq len bits %d\n", pdu_list->pucch_pdu.bit_len_harq); + pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR + pdu_0_1->harq = CALLOC(1, sizeof(*pdu_0_1->harq)); + pdu_0_1->harq->num_harq = 1; + pdu_0_1->harq->harq_confidence_level = 0; + pdu_0_1->harq->harq_list = CALLOC(pdu_0_1->harq->num_harq, sizeof(*pdu_0_1->harq->harq_list)); + for (int k = 0; k < pdu_0_1->harq->num_harq; k++) { - nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[j].pucch_pdu_format_0_1; - pdu_0_1->sr = CALLOC(1, sizeof(*pdu_0_1->sr)); - pdu_0_1->sr->sr_confidence_level = 0; - pdu_0_1->sr->sr_indication = 0; + pdu_0_1->harq->harq_list[k].harq_value = 0; } - } - LOG_I(NR_MAC, "We have dequeued the previously filled uci_ind and updated the snf/slot to %d/%d.\n", - uci_ind->sfn, uci_ind->slot); - NR_UL_IND_t UL_INFO = { - .uci_ind = *uci_ind, - }; - send_nsa_standalone_msg(&UL_INFO, uci_ind->header.message_id); } + LOG_I(NR_MAC, "We have dequeued the previously filled uci_ind and updated the snf/slot to %d/%d.\n", + uci_ind->sfn, uci_ind->slot); + NR_UL_IND_t UL_INFO = { + .uci_ind = *uci_ind, + }; + send_nsa_standalone_msg(&UL_INFO, uci_ind->header.message_id); + for (int k = 0; k < uci_ind->num_ucis; k++) { - nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[k].pucch_pdu_format_0_1; - free(pdu_0_1->sr); - free(pdu_0_1->harq->harq_list); - free(pdu_0_1->harq); + nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[k].pucch_pdu_format_0_1; + if (pdu_list->pucch_pdu.sr_flag) + { + free(pdu_0_1->sr); + pdu_0_1->sr = NULL; + } + if (pdu_list->pucch_pdu.bit_len_harq > 1) + { + free(pdu_0_1->harq->harq_list); + pdu_0_1->harq->harq_list = NULL; + free(pdu_0_1->harq); + pdu_0_1->harq = NULL; + } } free(uci_ind->uci_list); + uci_ind->uci_list = NULL; free(uci_ind); + uci_ind = NULL; } } @@ -898,7 +922,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; - if ((!dl_info->dci_ind && !dl_info->rx_ind)) { //Melissa review this with Raymond|| !def_dci_pdu_rel15 + if ((!dl_info->dci_ind && !dl_info->rx_ind)) { // UL indication to schedule DCI reception nr_ue_scheduler(dl_info, NULL); } else { From eb5f517165f80d4d439556b73ffc8fb0f9749cbb Mon Sep 17 00:00:00 2001 From: David Kim Date: Fri, 1 Oct 2021 10:21:42 -0700 Subject: [PATCH 08/32] updated configuration file location for ci test. --- ci-scripts/conf_files/{ => episci}/episci_nr-ue.nfapi.conf | 0 .../conf_files/{ => episci}/episci_rcc.band7.tm1.nfapi.conf | 0 .../conf_files/episci}/episci_rcc.band78.tm1.106PRB.nfapi.conf | 0 ci-scripts/conf_files/{ => episci}/episci_ue.nfapi.conf | 0 ci-scripts/conf_files/{ => episci}/proxy_nr-ue.nfapi.conf | 0 ci-scripts/conf_files/{ => episci}/proxy_rcc.band7.tm1.nfapi.conf | 0 .../conf_files/episci}/proxy_rcc.band78.tm1.106PRB.nfapi.conf | 0 ci-scripts/conf_files/{ => episci}/proxy_ue.nfapi.conf | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename ci-scripts/conf_files/{ => episci}/episci_nr-ue.nfapi.conf (100%) rename ci-scripts/conf_files/{ => episci}/episci_rcc.band7.tm1.nfapi.conf (100%) rename {targets/PROJECTS/GENERIC-LTE-EPC/CONF => ci-scripts/conf_files/episci}/episci_rcc.band78.tm1.106PRB.nfapi.conf (100%) rename ci-scripts/conf_files/{ => episci}/episci_ue.nfapi.conf (100%) rename ci-scripts/conf_files/{ => episci}/proxy_nr-ue.nfapi.conf (100%) rename ci-scripts/conf_files/{ => episci}/proxy_rcc.band7.tm1.nfapi.conf (100%) rename {targets/PROJECTS/GENERIC-LTE-EPC/CONF => ci-scripts/conf_files/episci}/proxy_rcc.band78.tm1.106PRB.nfapi.conf (100%) rename ci-scripts/conf_files/{ => episci}/proxy_ue.nfapi.conf (100%) diff --git a/ci-scripts/conf_files/episci_nr-ue.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf similarity index 100% rename from ci-scripts/conf_files/episci_nr-ue.nfapi.conf rename to ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf diff --git a/ci-scripts/conf_files/episci_rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf similarity index 100% rename from ci-scripts/conf_files/episci_rcc.band7.tm1.nfapi.conf rename to ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/episci_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf similarity index 100% rename from targets/PROJECTS/GENERIC-LTE-EPC/CONF/episci_rcc.band78.tm1.106PRB.nfapi.conf rename to ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf diff --git a/ci-scripts/conf_files/episci_ue.nfapi.conf b/ci-scripts/conf_files/episci/episci_ue.nfapi.conf similarity index 100% rename from ci-scripts/conf_files/episci_ue.nfapi.conf rename to ci-scripts/conf_files/episci/episci_ue.nfapi.conf diff --git a/ci-scripts/conf_files/proxy_nr-ue.nfapi.conf b/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf similarity index 100% rename from ci-scripts/conf_files/proxy_nr-ue.nfapi.conf rename to ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf diff --git a/ci-scripts/conf_files/proxy_rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf similarity index 100% rename from ci-scripts/conf_files/proxy_rcc.band7.tm1.nfapi.conf rename to ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/proxy_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf similarity index 100% rename from targets/PROJECTS/GENERIC-LTE-EPC/CONF/proxy_rcc.band78.tm1.106PRB.nfapi.conf rename to ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf diff --git a/ci-scripts/conf_files/proxy_ue.nfapi.conf b/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf similarity index 100% rename from ci-scripts/conf_files/proxy_ue.nfapi.conf rename to ci-scripts/conf_files/episci/proxy_ue.nfapi.conf From fb0a80ee84a9ce6240b46369c8ec09e96e6f1623 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 1 Oct 2021 15:53:23 -0700 Subject: [PATCH 09/32] Adding memset of def_dci_pdu_rel15 back in Removing the memset seemed to hide the problem and now the problem is appearing in a differnt manner... it is causing the NRUE to skip HARQ PIDs as its filling the UCI indication and process the DCI PDUs. So adding the memset causes the NR UE to crash becasue the DL_BWP_ID is becoming 0 which leads us to index into an pointer that is not allocated and then a crash happens in DCI handling. --- openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h | 2 -- openair2/LAYER2/NR_MAC_UE/mac_extern.h | 2 -- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 1 + 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h index 8145a37b45..5b4ebe2397 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h @@ -39,8 +39,6 @@ extern const uint8_t nr_slots_per_frame[5]; -extern dci_pdu_rel15_t def_dci_pdu_rel15[8]; - /* extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE]; extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE]; extern const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_extern.h b/openair2/LAYER2/NR_MAC_UE/mac_extern.h index 7dd2a740f6..7959b07694 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_extern.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_extern.h @@ -66,8 +66,6 @@ extern const uint8_t table_7_3_2_3_3_4_twoCodeword[6][10]; extern const uint16_t table_7_2_1[16]; -extern dci_pdu_rel15_t def_dci_pdu_rel15[8]; - extern void mac_rlc_data_ind(const module_id_t module_idP, const rnti_t rntiP, const eNB_index_t eNB_index, diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 2aeb289b41..d816d294cf 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -951,6 +951,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, dl_info->module_id, dl_info->cc_id, dl_info->frame, dl_info->slot, dl_info->thread_id); nr_ue_if_module_inst[module_id]->scheduled_response(&scheduled_response); } + memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15)); } } From 1b2d8b5288bf9dde6dd1af4e6cc78891b0877acd Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 5 Oct 2021 11:40:40 -0700 Subject: [PATCH 10/32] def_dci_pdu_rel15 fix. In this commit we were trying to understand why the memset of the def_dci_pdu_rel15 array in the NRUE was casuing the NR UE to crash. This was happening becuase some of the members of the def_dci_pdu_rel15 array canont be zero in NSA mode. This was happening because sometimes, we would recevied two DCI indications in a row, after the first one, we would be memesetting the array to all 0s and then try to process the second DCI. The fix we have implemnted is to call the configure_dci() prior to processing ANY DCI, to ensure we have properly configured the UE to handle these DCIs. Also, in the gNB, it was not able to find the UL scheduled slot for the feedback harq because it was not accounting for the slot wrapping. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 2 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 4 +++- 2 files 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 50e8a82f9d..847a6a808f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1317,7 +1317,7 @@ int nr_acknack_scheduling(int mod_id, while (i < 8) { LOG_D(NR_MAC,"pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n", i,pdsch_to_harq_feedback[i],pucch->ul_slot,slot); - if (pdsch_to_harq_feedback[i] == pucch->ul_slot - slot) { + if (pdsch_to_harq_feedback[i] == (pucch->ul_slot - slot) % n_slots_frame) { ind_found = i; break; } diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index d816d294cf..0b5255d235 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -480,7 +480,7 @@ static void fill_dci_from_dl_config(nr_downlink_indication_t*dl_ind, fapi_nr_dl_ int num_dci_options = rel15_dci->num_dci_options; if (num_dci_options <= 0) { - LOG_I(NR_MAC, "num_dci_opts = %d for %dth pdu in dl_config_list\n", rel15_dci->num_dci_options, i); + LOG_I(NR_MAC, "num_dci_opts = %d for pdu[%d] in dl_config_list\n", rel15_dci->num_dci_options, i); } AssertFatal(num_dci_options <= sizeof(rel15_dci->dci_length_options) / sizeof(rel15_dci->dci_length_options[0]), "num_dci_options %d > dci_length_options array\n", num_dci_options); @@ -932,6 +932,8 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ for (int i = 0; i < dl_info->dci_ind->number_of_dcis; i++) { LOG_D(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n",i,dl_info->dci_ind->number_of_dcis); nr_scheduled_response_t scheduled_response; + nr_dcireq_t dcireq; + nr_ue_dcireq(&dcireq); int8_t ret = handle_dci(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index, From 47e96132f629bbb0dd9e95448a581f9d33b5c33c Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 5 Oct 2021 16:09:52 -0700 Subject: [PATCH 11/32] Handling multiple DCIs in a single DL_TTI and TX_REQ --- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 2 + openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 2 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 94 ++++++++++++-------- 3 files changed, 58 insertions(+), 40 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 8d60aa74f5..fddd14bb8e 100755 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -434,7 +434,9 @@ typedef struct { // Defined for abstracted mode nr_downlink_indication_t dl_info; NR_UE_HARQ_STATUS_t dl_harq_info[16]; + bool expected_dci; + bool index_has_dci[16]; pthread_mutex_t mutex_dl_info; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 16f4a6b215..03c8078953 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -2757,7 +2757,7 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac, // check BWP id if (mac->DLbwp[0]) N_RB=NRRIV2BW(mac->DLbwp[0]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); else N_RB=mac->type0_PDCCH_CSS_config.num_rbs; -; + // indicating a DL DCI format 1bit pos++; diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 0b5255d235..dae821f897 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -229,6 +229,7 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_ { NR_UE_MAC_INST_t *mac = get_mac_inst(dl_info->module_id); mac->expected_dci = false; + memset(mac->index_has_dci, 0, sizeof(*mac->index_has_dci)); int pdu_idx = 0; int num_pdus = dl_tti_request->dl_tti_request_body.nPDUs; @@ -262,7 +263,7 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_ for (int j = 0; j < num_dcis; j++) { nfapi_nr_dl_dci_pdu_t *dci_pdu_list = &pdu_list->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[j]; - if ((dci_pdu_list->RNTI != mac->crnti) && + if ((dci_pdu_list->RNTI != mac->crnti) && ((dci_pdu_list->RNTI != mac->ra.ra_rnti) || mac->ra.RA_RAPID_found)) { LOG_D(NR_MAC, "We are filtering PDCCH DCI pdu because RNTI doesnt match!\n"); @@ -271,6 +272,8 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_ } fill_dl_info_with_pdcch(dl_info->dci_ind, dci_pdu_list, pdu_idx); mac->expected_dci = true; + LOG_D(NR_MAC, "Setting index_has_dci[%d] = true\n", j); + mac->index_has_dci[j] = true; pdu_idx++; } } @@ -280,6 +283,36 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_ dl_info->frame = dl_tti_request->SFN; } +static void fill_rx_ind(nfapi_nr_pdu_t *pdu_list, fapi_nr_rx_indication_t *rx_ind, int pdu_idx, int pdu_type) +{ + AssertFatal(pdu_list->num_TLV < sizeof(pdu_list->TLVs) / sizeof(pdu_list->TLVs[0]), "Num TLVs exceeds TLV array size"); + int length = 0; + for (int j = 0; j < pdu_list->num_TLV; j++) + { + length += pdu_list->TLVs[j].length; + } + LOG_I(NR_PHY, "%s: num_tlv %d and length %d, pdu index %d\n", + __FUNCTION__, pdu_list->num_TLV, length, pdu_idx); + uint8_t *pdu = malloc(length); + AssertFatal(pdu != NULL, "%s: Out of memory in malloc", __FUNCTION__); + rx_ind->rx_indication_body[pdu_idx].pdsch_pdu.pdu = pdu; + for (int j = 0; j < pdu_list->num_TLV; j++) + { + const uint32_t *ptr; + if (pdu_list->TLVs[j].tag) + ptr = pdu_list->TLVs[j].value.ptr; + else + ptr = pdu_list->TLVs[j].value.direct; + memcpy(pdu, ptr, pdu_list->TLVs[j].length); + pdu += pdu_list->TLVs[j].length; + } + rx_ind->rx_indication_body[pdu_idx].pdsch_pdu.ack_nack = 1; + rx_ind->rx_indication_body[pdu_idx].pdsch_pdu.pdu_length = length; + rx_ind->rx_indication_body[pdu_idx].pdu_type = pdu_type; + +} + + static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_nr_tx_data_request_t *tx_data_request) { NR_UE_MAC_INST_t *mac = get_mac_inst(dl_info->module_id); @@ -292,45 +325,34 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi dl_info->rx_ind = CALLOC(1, sizeof(fapi_nr_rx_indication_t)); AssertFatal(dl_info->rx_ind != NULL, "%s: Out of memory in calloc", __FUNCTION__); - dl_info->rx_ind->sfn = tx_data_request->SFN; - dl_info->rx_ind->slot = tx_data_request->Slot; - dl_info->rx_ind->number_pdus = num_pdus; + fapi_nr_rx_indication_t *rx_ind = dl_info->rx_ind; + rx_ind->sfn = tx_data_request->SFN; + rx_ind->slot = tx_data_request->Slot; + + int pdu_idx = 0; for (int i = 0; i < num_pdus; i++) { nfapi_nr_pdu_t *pdu_list = &tx_data_request->pdu_list[i]; - AssertFatal(pdu_list->num_TLV < sizeof(pdu_list->TLVs) / sizeof(pdu_list->TLVs[0]), "Num TLVs exceeds TLV array size"); - int length = 0; - for (int j = 0; j < pdu_list->num_TLV; j++) + if(mac->ra.ra_state <= WAIT_RAR) { - length += pdu_list->TLVs[j].length; + fill_rx_ind(pdu_list, rx_ind, pdu_idx, FAPI_NR_RX_PDU_TYPE_RAR); + pdu_idx++; } - LOG_I(NR_PHY, "%s: num_tlv %d and length %d, pdu index %d\n", - __FUNCTION__, pdu_list->num_TLV, length, i); - uint8_t *pdu = malloc(length); - AssertFatal(pdu != NULL, "%s: Out of memory in malloc", __FUNCTION__); - dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.pdu = pdu; - for (int j = 0; j < pdu_list->num_TLV; j++) + else if (mac->index_has_dci[i]) { - const uint32_t *ptr; - if (pdu_list->TLVs[j].tag) - ptr = pdu_list->TLVs[j].value.ptr; - else - ptr = pdu_list->TLVs[j].value.direct; - memcpy(pdu, ptr, pdu_list->TLVs[j].length); - pdu += pdu_list->TLVs[j].length; + fill_rx_ind(pdu_list, rx_ind, pdu_idx, FAPI_NR_RX_PDU_TYPE_DLSCH); + pdu_idx++; } - dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.ack_nack = 1; // Melissa we will come back during channel modelling - dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.pdu_length = length; - if (tx_data_request->Slot == 7 && mac->ra.ra_state <= WAIT_RAR) { //Melissa this means we have an RAR, sorta hacky though - dl_info->rx_ind->rx_indication_body[i].pdu_type = FAPI_NR_RX_PDU_TYPE_RAR; - } - else { - dl_info->rx_ind->rx_indication_body[i].pdu_type = FAPI_NR_RX_PDU_TYPE_DLSCH; + else + { + LOG_D(NR_MAC, "mac->index_has_dci[%d] = 0, so this index contained a DCI for a different UE\n", i); } + } dl_info->slot = tx_data_request->Slot; dl_info->frame = tx_data_request->SFN; + dl_info->rx_ind->number_pdus = pdu_idx; } static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_nr_ul_dci_request_t *ul_dci_req) @@ -587,16 +609,6 @@ static void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, { nr_ue_ul_indication(&ul_info); } - - - #if 0 //Melissa may want to free this - free(dl_info.dci_ind); - dl_info.dci_ind = NULL; - - free(dl_info.rx_ind); - dl_info.rx_ind = NULL; - #endif - } static void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request) @@ -746,7 +758,7 @@ void *nrue_standalone_pnf_task(void *context) save_nr_measurement_info(&dl_tti_request); check_and_process_dci(&dl_tti_request, NULL, NULL, NULL); if (mac->expected_dci) - { + { sfn_of_dl_tti_req = dl_tti_request.SFN; slot_of_dl_tti_req = dl_tti_request.Slot; } @@ -955,6 +967,8 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ } memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15)); } + free(dl_info->dci_ind); + dl_info->dci_ind = NULL; } if (dl_info->rx_ind != NULL) { @@ -995,6 +1009,8 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ break; } } + free(dl_info->rx_ind); + dl_info->rx_ind = NULL; } //clean up nr_downlink_indication_t *dl_info From 98bc149e98bd0002c02caf33481815938c031dc9 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 6 Oct 2021 09:47:19 -0700 Subject: [PATCH 12/32] Reverting change that that forces DCI config before handling By reverting this change, we will see the NRUE2 crash because the DCI wont be configured before handling. This will get fixed in the next commit by adding queues for the nFAPI messages, therefore forcing us to handle the nfapi messages only after we have processes the corresponding slot indication. --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index dae821f897..f505022336 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -944,8 +944,6 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ for (int i = 0; i < dl_info->dci_ind->number_of_dcis; i++) { LOG_D(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n",i,dl_info->dci_ind->number_of_dcis); nr_scheduled_response_t scheduled_response; - nr_dcireq_t dcireq; - nr_ue_dcireq(&dcireq); int8_t ret = handle_dci(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index, From 746d07464657edd4397c9e075dffa659db025493 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 6 Oct 2021 18:13:13 -0700 Subject: [PATCH 13/32] Queuing all nFAPI messages and handling after slot ind This commit changes the stub functionality entirely. We are now queueing any received NR nFAPI message and handling it only after we recevie a slot ind that corresponds with the nFAPI message's sfn/slot value. When doing this, an existing issue has been brought to light. The gNB and NR UE are not in sync when it comes to their slot indications. Generally, the NR UE seems to be ahead of the gNB by around 6-7 slots. This commit has a hack... when we receive a slot indication at the moment, we decrament it by 6 to try to keep the NRUE from being ahead of the gNB. This will be fixed shortly... This was a temporary fix.. --- executables/nr-ue.c | 215 ++++++++---- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 1 - openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 359 +++++++++++++------- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h | 7 + openair2/RRC/NR_UE/rrc_UE.c | 4 + openair2/RRC/NR_UE/rrc_proto.h | 4 + 6 files changed, 405 insertions(+), 185 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 00aa1f9125..43dc7f7fc6 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -30,6 +30,7 @@ #include "LAYER2/nr_pdcp/nr_pdcp_entity.h" //#include "executables/softmodem-common.h" #include "SCHED_NR_UE/pucch_uci_ue_nr.h" +#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h" /* * NR SLOT PROCESSING SEQUENCE @@ -224,6 +225,30 @@ static bool sfn_slot_matcher(void *wanted, void *candidate) return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->sfn && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->slot; } + case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: + { + nfapi_nr_dl_tti_request_t *ind = candidate; + return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot; + } + + case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: + { + nfapi_nr_tx_data_request_t *ind = candidate; + return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot; + } + + case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: + { + nfapi_nr_ul_dci_request_t *ind = candidate; + return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot; + } + + case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: + { + nfapi_nr_ul_tti_request_t *ind = candidate; + return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot; + } + default: LOG_E(NR_MAC, "sfn_slot_match bad ID: %d\n", msg->message_id); @@ -232,6 +257,130 @@ static bool sfn_slot_matcher(void *wanted, void *candidate) return false; } +static void process_queued_nr_nfapi_msgs(int sfn_slot) +{ + nfapi_nr_rach_indication_t *rach_ind = unqueue_matching(&nr_rach_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); + nfapi_nr_rx_data_indication_t *rx_ind = unqueue_matching(&nr_rx_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); + nfapi_nr_crc_indication_t *crc_ind = unqueue_matching(&nr_crc_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); + nfapi_nr_dl_tti_request_t *dl_tti_request = unqueue_matching(&nr_dl_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); + nfapi_nr_tx_data_request_t *tx_data_request = unqueue_matching(&nr_tx_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); + nfapi_nr_ul_dci_request_t *ul_dci_request = unqueue_matching(&nr_ul_dci_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); + nfapi_nr_ul_tti_request_t *ul_tti_request = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); + + if (rach_ind && rach_ind->number_of_pdus > 0) + { + NR_UL_IND_t UL_INFO = { + .rach_ind = *rach_ind, + }; + send_nsa_standalone_msg(&UL_INFO, rach_ind->header.message_id); + for (int i = 0; i < rach_ind->number_of_pdus; i++) + { + free(rach_ind->pdu_list[i].preamble_list); + } + free(rach_ind->pdu_list); + free(rach_ind); + nr_Msg1_transmitted(0, 0, NFAPI_SFNSLOT2SFN(sfn_slot), 0); + } + if (crc_ind && crc_ind->number_crcs > 0) + { + NR_UL_IND_t UL_INFO = { + .crc_ind = *crc_ind, + }; + send_nsa_standalone_msg(&UL_INFO, crc_ind->header.message_id); + free(crc_ind->crc_list); + free(crc_ind); + } + if (rx_ind && rx_ind->number_of_pdus > 0) + { + NR_UL_IND_t UL_INFO = { + .rx_ind = *rx_ind, + }; + send_nsa_standalone_msg(&UL_INFO, rx_ind->header.message_id); + free(rx_ind->pdu_list); + free(rx_ind); + } + if (dl_tti_request || tx_data_request) + { + if (!tx_data_request) + { + save_nr_measurement_info(dl_tti_request); + LOG_E(NR_MAC, "[%d %d] No corresponding tx_data_request for given dl_tti_request\n", + NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot)); + if (!put_queue(&nr_dl_tti_req_queue, dl_tti_request)) + { + LOG_E(NR_PHY, "put_queue failed for dl_tti_request.\n"); + free(dl_tti_request); + dl_tti_request = NULL; + } + } + else if (!dl_tti_request) + { + LOG_E(NR_MAC, "[%d %d] No corresponding dl_tti_request for given tx_data_request \n", + NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot)); + if (!put_queue(&nr_tx_req_queue, tx_data_request)) + { + LOG_E(NR_PHY, "put_queue failed for tx_request.\n"); + free(tx_data_request); + tx_data_request = NULL; + } + } + else if (dl_tti_request->dl_tti_request_body.nPDUs > 0 && tx_data_request->Number_of_PDUs > 0) + { + save_nr_measurement_info(dl_tti_request); + check_and_process_dci(dl_tti_request, tx_data_request, NULL, NULL); + } + } + if (ul_dci_request && ul_dci_request->numPdus > 0) + { + check_and_process_dci(NULL, NULL, ul_dci_request, NULL); + //free(ul_dci_request); + //ul_dci_request = NULL; + } + if (ul_tti_request && ul_tti_request->n_pdus > 0) + { + check_and_process_dci(NULL, NULL, NULL, ul_tti_request); + //free(ul_tti_request); + //ul_tti_request = NULL; + } +} + +static void check_nr_prach(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info, NR_PRACH_RESOURCES_t *prach_resources) +{ + fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, ul_info->slot_tx); + if (!ul_config) + { + LOG_E(NR_MAC, "mac->ul_config is null! \n"); + return; + } + if (mac->ra.ra_state != RA_SUCCEEDED) + { + AssertFatal(ul_config->number_pdus < sizeof(ul_config->ul_config_list) / sizeof(ul_config->ul_config_list[0]), + "Number of PDUS in ul_config = %d > ul_config_list num elements", ul_config->number_pdus); + fapi_nr_ul_config_prach_pdu *prach_pdu = &ul_config->ul_config_list[ul_config->number_pdus].prach_config_pdu; + uint8_t nr_prach = nr_ue_get_rach(prach_resources, + prach_pdu, + ul_info->module_id, + ul_info->cc_id, + ul_info->frame_tx, + ul_info->gNB_index, + ul_info->slot_tx); + if (nr_prach == 1) + { + L1_nsa_prach_procedures(ul_info->frame_tx, ul_info->slot_tx, prach_pdu); + ul_config->number_pdus = 0; + ul_info->ue_sched_mode = SCHED_ALL; + } + else if (nr_prach == 2) + { + LOG_I(NR_PHY, "In %s: [UE %d] RA completed, setting UE mode to PUSCH\n", __FUNCTION__, ul_info->module_id); + } + else if(nr_prach == 3) + { + LOG_I(NR_PHY, "In %s: [UE %d] RA failed, setting UE mode to PRACH\n", __FUNCTION__, ul_info->module_id); + } + } +} + static void *NRUE_phy_stub_standalone_pnf_task(void *arg) { LOG_I(MAC, "Clearing Queues\n"); @@ -319,71 +468,9 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) { LOG_D(NR_MAC, "Slot %d. calling nr_ue_ul_ind() from %s\n", ul_info.slot_tx, __FUNCTION__); nr_ue_ul_indication(&ul_info); - fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, ul_info.slot_tx); - if (!ul_config) - { - LOG_E(NR_MAC, "mac->ul_config is null! \n"); - continue; - } - if (mac->ra.ra_state != RA_SUCCEEDED) - { - AssertFatal(ul_config->number_pdus < sizeof(ul_config->ul_config_list) / sizeof(ul_config->ul_config_list[0]), - "Number of PDUS in ul_config = %d > ul_config_list num elements", ul_config->number_pdus); - fapi_nr_ul_config_prach_pdu *prach_pdu = &ul_config->ul_config_list[ul_config->number_pdus].prach_config_pdu; - uint8_t nr_prach = nr_ue_get_rach(&prach_resources, prach_pdu, mod_id, CC_id, ul_info.frame_tx, gNB_id, ul_info.slot_tx); - if (nr_prach == 1) - { - L1_nsa_prach_procedures(ul_info.frame_tx, ul_info.slot_tx, prach_pdu); - ul_config->number_pdus = 0; - ul_info.ue_sched_mode = SCHED_ALL; - } - else if (nr_prach == 2) - { - LOG_I(NR_PHY, "In %s: [UE %d] RA completed, setting UE mode to PUSCH\n", __FUNCTION__, mod_id); - } - else if(nr_prach == 3) - { - LOG_I(NR_PHY, "In %s: [UE %d] RA failed, setting UE mode to PRACH\n", __FUNCTION__, mod_id); - } - } - } - - nfapi_nr_rach_indication_t *rach_ind = unqueue_matching(&nr_rach_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); - nfapi_nr_rx_data_indication_t *rx_ind = unqueue_matching(&nr_rx_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); - nfapi_nr_crc_indication_t *crc_ind = unqueue_matching(&nr_crc_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); - - if (rach_ind && rach_ind->number_of_pdus > 0) - { - NR_UL_IND_t UL_INFO = { - .rach_ind = *rach_ind, - }; - send_nsa_standalone_msg(&UL_INFO, rach_ind->header.message_id); - for (int i = 0; i < rach_ind->number_of_pdus; i++) - { - free(rach_ind->pdu_list[i].preamble_list); - } - free(rach_ind->pdu_list); - free(rach_ind); - nr_Msg1_transmitted(mod_id, CC_id, frame, gNB_id); - } - if (crc_ind && crc_ind->number_crcs > 0) - { - NR_UL_IND_t UL_INFO = { - .crc_ind = *crc_ind, - }; - send_nsa_standalone_msg(&UL_INFO, crc_ind->header.message_id); - free(crc_ind->crc_list); - free(crc_ind); - } - if (rx_ind && rx_ind->number_of_pdus > 0) - { - NR_UL_IND_t UL_INFO = { - .rx_ind = *rx_ind, - }; - send_nsa_standalone_msg(&UL_INFO, rx_ind->header.message_id); - free(rx_ind->pdu_list); - free(rx_ind); + check_nr_prach(mac, &ul_info, &prach_resources); } + process_queued_nr_nfapi_msgs(sfn_slot); } return NULL; } diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index e2a92781d8..dcb1262a26 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -48,7 +48,6 @@ const char *ul_pdu_type[]={"PRACH", "PUCCH", "PUSCH", "SRS"}; queue_t nr_rx_ind_queue; queue_t nr_crc_ind_queue; queue_t nr_uci_ind_queue; -queue_t nr_sfn_slot_queue; int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response) { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index f505022336..ba482d5d0f 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -55,6 +55,12 @@ static int g_harq_pid; int current_sfn_slot; sem_t sfn_slot_semaphore; +queue_t nr_sfn_slot_queue; +queue_t nr_dl_tti_req_queue; +queue_t nr_tx_req_queue; +queue_t nr_ul_dci_req_queue; +queue_t nr_ul_tti_req_queue; + void nrue_init_standalone_socket(int tx_port, int rx_port) { { @@ -532,10 +538,10 @@ static void fill_dci_from_dl_config(nr_downlink_indication_t*dl_ind, fapi_nr_dl_ } } -static void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, - nfapi_nr_tx_data_request_t *tx_data_request, - nfapi_nr_ul_dci_request_t *ul_dci_request, - nfapi_nr_ul_tti_request_t *ul_tti_request) +void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, + nfapi_nr_tx_data_request_t *tx_data_request, + nfapi_nr_ul_dci_request_t *ul_dci_request, + nfapi_nr_ul_tti_request_t *ul_tti_request) { frame_t frame = 0; int slot = 0; @@ -560,7 +566,7 @@ static void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, incoming tx_data_request is also destined for the current UE. If the RAR hasn't been processed yet, we do not want to be filtering the tx_data_requests. */ - else if (tx_data_request && (mac->expected_dci || mac->ra.ra_state == WAIT_RAR)) + if (tx_data_request && (mac->expected_dci || mac->ra.ra_state == WAIT_RAR)) { frame = tx_data_request->SFN; slot = tx_data_request->Slot; @@ -584,6 +590,7 @@ static void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, else { if (pthread_mutex_unlock(&mac->mutex_dl_info)) abort(); + LOG_E(NR_MAC, "Error! All indications were NULL\n"); return; } @@ -611,7 +618,7 @@ static void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, } } -static void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request) +void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request) { int num_pdus = dl_tti_request->dl_tti_request_body.nPDUs; char buffer[MAX_MESSAGE_SIZE]; @@ -647,26 +654,183 @@ static void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request) nsa_sendmsg_to_lte_ue(buffer, pack_len, NR_UE_RRC_MEASUREMENT); LOG_A(NR_RRC, "Populated NR_UE_RRC_MEASUREMENT information and sent to LTE UE\n"); } +# if 0 +static void process_nr_dl_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_header_t header) +{ + NR_UE_MAC_INST_t *mac = get_mac_inst(0); + char buffer_for_tx_data_req[NFAPI_MAX_PACKED_MESSAGE_SIZE]; + ssize_t len_of_tx_data_req = 0; + int sfn_of_tx_data_req = 0; + int slot_of_tx_data_req = 0; + int sfn_of_dl_tti_req = 0; + int slot_of_dl_tti_req = 0; + int delta = 0; + nfapi_nr_dl_tti_request_t dl_tti_request; + nfapi_nr_ul_tti_request_t ul_tti_request; + nfapi_nr_tx_data_request_t tx_data_request; + nfapi_nr_ul_dci_request_t ul_dci_request; + if (dl_tti_req) + { + LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST message in sfn/slot %d %d. \n", + dl_tti_request.SFN, dl_tti_request.Slot); + save_nr_measurement_info(&dl_tti_request); + check_and_process_dci(&dl_tti_request, NULL, NULL, NULL); + if (mac->expected_dci) + { + sfn_of_dl_tti_req = dl_tti_request.SFN; + slot_of_dl_tti_req = dl_tti_request.Slot; + } + if (len_of_tx_data_req > 0 + && sfn_of_dl_tti_req == sfn_of_tx_data_req + && slot_of_dl_tti_req == slot_of_tx_data_req) + { + if (nfapi_nr_p7_message_unpack((void *)buffer_for_tx_data_req, len_of_tx_data_req, &tx_data_request, + sizeof(tx_data_request), NULL) < 0) + { + LOG_E(NR_PHY, "Message tx_data_request failed to unpack\n"); + break; + } + LOG_I(NR_PHY, "Processing an NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST message in SFN/slot %d %d. \n", + tx_data_request.SFN, tx_data_request.Slot); + check_and_process_dci(NULL, &tx_data_request, NULL, NULL); + len_of_tx_data_req = 0; + } + } + if (tx_request) + { + LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST message in SFN/slot %d %d. \n", + tx_data_request.SFN, tx_data_request.Slot); + + if (tx_data_request.SFN == sfn_of_dl_tti_req && tx_data_request.Slot == slot_of_dl_tti_req + && (mac->expected_dci || mac->ra.ra_state <= WAIT_RAR)) + { + check_and_process_dci(NULL, &tx_data_request, NULL, NULL); + } + else + { + len_of_tx_data_req = len; + sfn_of_tx_data_req = tx_data_request.SFN; + slot_of_tx_data_req = tx_data_request.Slot; + memcpy(buffer_for_tx_data_req, buffer, len); + LOG_I(NR_PHY, "Saved an NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST message in SFN/slot %d %d. \n", + tx_data_request.SFN, tx_data_request.Slot); + } + } + if (ul_dci_request) + { + LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST message in SFN/slot %d %d. \n", + ul_dci_request.SFN, ul_dci_request.Slot); + delta = NFAPI_SFNSLOT2DEC(sfn, slot) - NFAPI_SFNSLOT2DEC(ul_dci_request.SFN, ul_dci_request.Slot); + if (delta < -NFAPI_SFNSLOT2DEC(512, 0)) + { + delta += NFAPI_SFNSLOT2DEC(1024, 0); + } + if (delta < 6) + { + check_and_process_dci(NULL, NULL, &ul_dci_request, NULL); + } + } + if (ul_tti_request) + { + LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message in SFN/slot %d %d. \n", + ul_tti_request.SFN, ul_tti_request.Slot); + check_and_process_dci(NULL, NULL, NULL, &ul_tti_request); + } + else + LOG_E(NR_PHY, "Case Statement has no corresponding nfapi message, this is the header ID %d\n", header.message_id); + +} +#endif +static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_header_t header) +{ + nfapi_nr_dl_tti_request_t dl_tti_request; + nfapi_nr_tx_data_request_t tx_data_request; + nfapi_nr_ul_dci_request_t ul_dci_request; + nfapi_nr_ul_tti_request_t ul_tti_request; + switch (header.message_id) + { + case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: + if (nfapi_nr_p7_message_unpack((void *)buffer, len, &dl_tti_request, + sizeof(dl_tti_request), NULL) < 0) + { + LOG_E(NR_PHY, "Message dl_tti_request failed to unpack\n"); + break; + } + LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST message in sfn/slot %d %d. \n", + dl_tti_request.SFN, dl_tti_request.Slot); + if (!put_queue(&nr_dl_tti_req_queue, &dl_tti_request)) + { + LOG_E(NR_PHY, "put_queue failed for dl_tti_request.\n"); + } + break; + + case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: + if (nfapi_nr_p7_message_unpack((void *)buffer, len, &tx_data_request, + sizeof(tx_data_request), NULL) < 0) + { + LOG_E(NR_PHY, "Message tx_data_request failed to unpack\n"); + break; + } + LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST message in SFN/slot %d %d. \n", + tx_data_request.SFN, tx_data_request.Slot); + if (!put_queue(&nr_tx_req_queue, &tx_data_request)) + { + LOG_E(NR_PHY, "put_queue failed for tx_request.\n"); + } + break; + + case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: + if (nfapi_nr_p7_message_unpack((void *)buffer, len, &ul_dci_request, + sizeof(ul_dci_request), NULL) < 0) + { + LOG_E(NR_PHY, "Message ul_dci_request failed to unpack\n"); + break; + } + LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST message in SFN/slot %d %d. \n", + ul_dci_request.SFN, ul_dci_request.Slot); + if (!put_queue(&nr_ul_dci_req_queue, &ul_dci_request)) + { + LOG_E(NR_PHY, "put_queue failed for ul_dci_request.\n"); + } + break; + + case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: + if (nfapi_nr_p7_message_unpack((void *)buffer, len, &ul_tti_request, + sizeof(ul_tti_request), NULL) < 0) + { + LOG_E(NR_PHY, "Message ul_tti_request failed to unpack\n"); + break; + } + LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message in SFN/slot %d %d. \n", + ul_tti_request.SFN, ul_tti_request.Slot); + if (!put_queue(&nr_ul_tti_req_queue, &ul_tti_request)) + { + LOG_E(NR_PHY, "put_queue failed for ul_tti_request.\n"); + } + break; + + default: + LOG_E(NR_PHY, "Invalid nFAPI message. Header ID %d\n", + header.message_id); + break; + } + return; +} + uint16_t sfn_slot_pool[512]; uint16_t sfn_slot_id; - void *nrue_standalone_pnf_task(void *context) { - NR_UE_MAC_INST_t *mac = get_mac_inst(0); struct sockaddr_in server_address; socklen_t addr_len = sizeof(server_address); - char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - char buffer_for_tx_data_req[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - ssize_t len_of_tx_data_req = 0; - int sfn_of_tx_data_req = 0; - int slot_of_tx_data_req = 0; - int sfn_of_dl_tti_req = 0; - int slot_of_dl_tti_req = 0; - int sfn = 0; - int slot = 0; - int delta = 0; int sd = ue_rx_sock_descriptor; assert(sd > 0); + + char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; + int sfn = 0; + int slot = 0; + + LOG_I(NR_RRC, "Sucessfully started %s.\n", __FUNCTION__); while (true) @@ -686,6 +850,61 @@ void *nrue_standalone_pnf_task(void *context) { uint16_t sfn_slot = 0; memcpy((void *)&sfn_slot, buffer, sizeof(sfn_slot)); + sfn = NFAPI_SFNSLOT2SFN(sfn_slot); + slot = NFAPI_SFNSLOT2SLOT(sfn_slot); + if (slot == 5) + { + slot = 19; + if (sfn == 0) + sfn = 1023; + else + sfn = sfn - 1; + } + else if (slot == 4) + { + slot = 18; + if (sfn == 0) + sfn = 1023; + else + sfn = sfn - 1; + } + else if (slot == 3) + { + slot = 17; + if (sfn == 0) + sfn = 1023; + else + sfn = sfn - 1; + } + else if (slot == 2) + { + slot = 16; + if (sfn == 0) + sfn = 1023; + else + sfn = sfn - 1; + } + else if (slot == 1) + { + slot = 15; + if (sfn == 0) + sfn = 1023; + else + sfn = sfn - 1; + } + else if (slot == 0) + { + slot = 14; + if (sfn == 0) + sfn = 1023; + else + sfn = sfn - 1; + } + else + { + slot = slot - 6; + } + sfn_slot = NFAPI_SFNSLOT2HEX(sfn, slot); current_sfn_slot = sfn_slot; sfn_slot_pool[sfn_slot_id] = sfn_slot; @@ -702,8 +921,7 @@ void *nrue_standalone_pnf_task(void *context) LOG_E(NR_PHY, "sem_post() error\n"); abort(); } - sfn = NFAPI_SFNSLOT2SFN(sfn_slot); - slot = NFAPI_SFNSLOT2SLOT(sfn_slot); + LOG_I(NR_PHY, "Received from proxy sfn %d slot %d\n", sfn, slot); } else if (len == sizeof(nr_phy_channel_params_t)) @@ -733,111 +951,12 @@ void *nrue_standalone_pnf_task(void *context) else { nfapi_p7_message_header_t header; - nfapi_nr_dl_tti_request_t dl_tti_request; - nfapi_nr_ul_tti_request_t ul_tti_request; - nfapi_nr_tx_data_request_t tx_data_request; - nfapi_nr_ul_dci_request_t ul_dci_request; if (nfapi_p7_message_header_unpack((void *)buffer, len, &header, sizeof(header), NULL) < 0) { LOG_E(NR_PHY, "Header unpack failed for nrue_standalone pnf\n"); continue; } - else - { - switch (header.message_id) - { - case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: - if (nfapi_nr_p7_message_unpack((void *)buffer, len, &dl_tti_request, - sizeof(nfapi_nr_dl_tti_request_t), NULL) < 0) - { - LOG_E(NR_PHY, "Message dl_tti_request failed to unpack\n"); - break; - } - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST message in sfn/slot %d %d. \n", - dl_tti_request.SFN, dl_tti_request.Slot); - save_nr_measurement_info(&dl_tti_request); - check_and_process_dci(&dl_tti_request, NULL, NULL, NULL); - if (mac->expected_dci) - { - sfn_of_dl_tti_req = dl_tti_request.SFN; - slot_of_dl_tti_req = dl_tti_request.Slot; - } - if (len_of_tx_data_req > 0 - && sfn_of_dl_tti_req == sfn_of_tx_data_req - && slot_of_dl_tti_req == slot_of_tx_data_req) - { - if (nfapi_nr_p7_message_unpack((void *)buffer_for_tx_data_req, len_of_tx_data_req, &tx_data_request, - sizeof(tx_data_request), NULL) < 0) - { - LOG_E(NR_PHY, "Message tx_data_request failed to unpack\n"); - break; - } - LOG_I(NR_PHY, "Processing an NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST message in SFN/slot %d %d. \n", - tx_data_request.SFN, tx_data_request.Slot); - check_and_process_dci(NULL, &tx_data_request, NULL, NULL); - len_of_tx_data_req = 0; - } - break; - case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: - if (nfapi_nr_p7_message_unpack((void *)buffer, len, &tx_data_request, - sizeof(tx_data_request), NULL) < 0) - { - LOG_E(NR_PHY, "Message tx_data_request failed to unpack\n"); - break; - } - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST message in SFN/slot %d %d. \n", - tx_data_request.SFN, tx_data_request.Slot); - - if (tx_data_request.SFN == sfn_of_dl_tti_req && tx_data_request.Slot == slot_of_dl_tti_req - && (mac->expected_dci || mac->ra.ra_state <= WAIT_RAR)) - { - check_and_process_dci(NULL, &tx_data_request, NULL, NULL); - } - else - { - len_of_tx_data_req = len; - sfn_of_tx_data_req = tx_data_request.SFN; - slot_of_tx_data_req = tx_data_request.Slot; - memcpy(buffer_for_tx_data_req, buffer, len); - LOG_I(NR_PHY, "Saved an NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST message in SFN/slot %d %d. \n", - tx_data_request.SFN, tx_data_request.Slot); - } - break; - case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: - if (nfapi_nr_p7_message_unpack((void *)buffer, len, &ul_dci_request, - sizeof(ul_dci_request), NULL) < 0) - { - LOG_E(NR_PHY, "Message ul_dci_request failed to unpack\n"); - break; - } - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST message in SFN/slot %d %d. \n", - ul_dci_request.SFN, ul_dci_request.Slot); - delta = NFAPI_SFNSLOT2DEC(sfn, slot) - NFAPI_SFNSLOT2DEC(ul_dci_request.SFN, ul_dci_request.Slot); - if (delta < -NFAPI_SFNSLOT2DEC(512, 0)) - { - delta += NFAPI_SFNSLOT2DEC(1024, 0); - } - if (delta < 6) - { - check_and_process_dci(NULL, NULL, &ul_dci_request, NULL); - } - break; - case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: - if (nfapi_nr_p7_message_unpack((void *)buffer, len, &ul_tti_request, - sizeof(ul_tti_request), NULL) < 0) - { - LOG_E(NR_PHY, "Message ul_tti_request failed to unpack\n"); - break; - } - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message in SFN/slot %d %d. \n", - ul_tti_request.SFN, ul_tti_request.Slot); - check_and_process_dci(NULL, NULL, NULL, &ul_tti_request); - break; - default: - LOG_E(NR_PHY, "Case Statement has no corresponding nfapi message, this is the header ID %d\n", header.message_id); - break; - } - } + enqueue_nr_nfapi_msg(buffer, len, header); } } //while(true) } diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h index 055da7e3a6..2bd1888c18 100755 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h @@ -234,6 +234,13 @@ typedef struct nfapi_dl_tti_config_req_tx_data_req_t void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id); +void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request); + +void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, + nfapi_nr_tx_data_request_t *tx_data_request, + nfapi_nr_ul_dci_request_t *ul_dci_request, + nfapi_nr_ul_tti_request_t *ul_tti_request); + /**\brief done free of memory allocation by module_id and release to pointer pool. \param module_id module id*/ int nr_ue_if_module_kill(uint32_t module_id); diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index d413513c7a..a5ce7c926d 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2890,6 +2890,10 @@ static void start_oai_nrue_threads() init_queue(&nr_crc_ind_queue); init_queue(&nr_uci_ind_queue); init_queue(&nr_sfn_slot_queue); + init_queue(&nr_dl_tti_req_queue); + init_queue(&nr_tx_req_queue); + init_queue(&nr_ul_dci_req_queue); + init_queue(&nr_ul_tti_req_queue); if (sem_init(&sfn_slot_semaphore, 0, 0) != 0) { diff --git a/openair2/RRC/NR_UE/rrc_proto.h b/openair2/RRC/NR_UE/rrc_proto.h index 0b37036fd1..f5178f469f 100644 --- a/openair2/RRC/NR_UE/rrc_proto.h +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -46,6 +46,10 @@ extern queue_t nr_rx_ind_queue; extern queue_t nr_crc_ind_queue; extern queue_t nr_uci_ind_queue; extern queue_t nr_sfn_slot_queue; +extern queue_t nr_dl_tti_req_queue; +extern queue_t nr_tx_req_queue; +extern queue_t nr_ul_dci_req_queue; +extern queue_t nr_ul_tti_req_queue; // // main_rrc.c // From 5552d53b08a6e433fe5df2e08a62fcc49fc20495 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 7 Oct 2021 10:06:40 -0700 Subject: [PATCH 14/32] gNB and NRUE slots not matching is what happens in LTE This commit allows us to call the scheduler for every slot indication we get to ensure we properly configure the DCI. Also, we are sure to process the DCI only when we have both the config (dl_tti) and the payload (tx_req). Lastly, removed the hack to the slot indication (we do not shift the slot indication by -6 anymore). We are passing up to 4 NSA UEs, but sometimes one will not complete the CFRA procedure. --- executables/nr-ue.c | 36 ++--- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 143 +------------------- 2 files changed, 11 insertions(+), 168 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 43dc7f7fc6..48d44ae1ca 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -262,10 +262,9 @@ static void process_queued_nr_nfapi_msgs(int sfn_slot) nfapi_nr_rach_indication_t *rach_ind = unqueue_matching(&nr_rach_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); nfapi_nr_rx_data_indication_t *rx_ind = unqueue_matching(&nr_rx_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); nfapi_nr_crc_indication_t *crc_ind = unqueue_matching(&nr_crc_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); - nfapi_nr_dl_tti_request_t *dl_tti_request = unqueue_matching(&nr_dl_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); - nfapi_nr_tx_data_request_t *tx_data_request = unqueue_matching(&nr_tx_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); - nfapi_nr_ul_dci_request_t *ul_dci_request = unqueue_matching(&nr_ul_dci_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); - nfapi_nr_ul_tti_request_t *ul_tti_request = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); + nfapi_nr_dl_tti_request_t *dl_tti_request = get_queue(&nr_dl_tti_req_queue); + nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue); + nfapi_nr_ul_tti_request_t *ul_tti_request = get_queue(&nr_ul_tti_req_queue); if (rach_ind && rach_ind->number_of_pdus > 0) { @@ -299,13 +298,14 @@ static void process_queued_nr_nfapi_msgs(int sfn_slot) free(rx_ind->pdu_list); free(rx_ind); } - if (dl_tti_request || tx_data_request) + if (dl_tti_request) { + int dl_tti_sfn_slot = NFAPI_SFNSLOT2HEX(dl_tti_request->SFN, dl_tti_request->Slot); + nfapi_nr_tx_data_request_t *tx_data_request = unqueue_matching(&nr_tx_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &dl_tti_sfn_slot); if (!tx_data_request) { - save_nr_measurement_info(dl_tti_request); - LOG_E(NR_MAC, "[%d %d] No corresponding tx_data_request for given dl_tti_request\n", - NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot)); + LOG_E(NR_MAC, "[%d %d] No corresponding tx_data_request for given dl_tti_request sfn/slot\n", + NFAPI_SFNSLOT2SFN(dl_tti_sfn_slot), NFAPI_SFNSLOT2SLOT(dl_tti_sfn_slot)); if (!put_queue(&nr_dl_tti_req_queue, dl_tti_request)) { LOG_E(NR_PHY, "put_queue failed for dl_tti_request.\n"); @@ -313,17 +313,6 @@ static void process_queued_nr_nfapi_msgs(int sfn_slot) dl_tti_request = NULL; } } - else if (!dl_tti_request) - { - LOG_E(NR_MAC, "[%d %d] No corresponding dl_tti_request for given tx_data_request \n", - NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot)); - if (!put_queue(&nr_tx_req_queue, tx_data_request)) - { - LOG_E(NR_PHY, "put_queue failed for tx_request.\n"); - free(tx_data_request); - tx_data_request = NULL; - } - } else if (dl_tti_request->dl_tti_request_body.nPDUs > 0 && tx_data_request->Number_of_PDUs > 0) { save_nr_measurement_info(dl_tti_request); @@ -333,14 +322,10 @@ static void process_queued_nr_nfapi_msgs(int sfn_slot) if (ul_dci_request && ul_dci_request->numPdus > 0) { check_and_process_dci(NULL, NULL, ul_dci_request, NULL); - //free(ul_dci_request); - //ul_dci_request = NULL; } if (ul_tti_request && ul_tti_request->n_pdus > 0) { check_and_process_dci(NULL, NULL, NULL, ul_tti_request); - //free(ul_tti_request); - //ul_tti_request = NULL; } } @@ -457,10 +442,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) mac->dl_info.dci_ind = NULL; mac->dl_info.rx_ind = NULL; - if (is_nr_DL_slot(mac->scc->tdd_UL_DL_ConfigurationCommon, ul_info.slot_rx)) - { - nr_ue_dl_indication(&mac->dl_info, &ul_time_alignment); - } + nr_ue_dl_indication(&mac->dl_info, &ul_time_alignment); if (pthread_mutex_unlock(&mac->mutex_dl_info)) abort(); diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index ba482d5d0f..827fd3e0f1 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -654,93 +654,7 @@ void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request) nsa_sendmsg_to_lte_ue(buffer, pack_len, NR_UE_RRC_MEASUREMENT); LOG_A(NR_RRC, "Populated NR_UE_RRC_MEASUREMENT information and sent to LTE UE\n"); } -# if 0 -static void process_nr_dl_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_header_t header) -{ - NR_UE_MAC_INST_t *mac = get_mac_inst(0); - char buffer_for_tx_data_req[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - ssize_t len_of_tx_data_req = 0; - int sfn_of_tx_data_req = 0; - int slot_of_tx_data_req = 0; - int sfn_of_dl_tti_req = 0; - int slot_of_dl_tti_req = 0; - int delta = 0; - nfapi_nr_dl_tti_request_t dl_tti_request; - nfapi_nr_ul_tti_request_t ul_tti_request; - nfapi_nr_tx_data_request_t tx_data_request; - nfapi_nr_ul_dci_request_t ul_dci_request; - if (dl_tti_req) - { - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST message in sfn/slot %d %d. \n", - dl_tti_request.SFN, dl_tti_request.Slot); - save_nr_measurement_info(&dl_tti_request); - check_and_process_dci(&dl_tti_request, NULL, NULL, NULL); - if (mac->expected_dci) - { - sfn_of_dl_tti_req = dl_tti_request.SFN; - slot_of_dl_tti_req = dl_tti_request.Slot; - } - if (len_of_tx_data_req > 0 - && sfn_of_dl_tti_req == sfn_of_tx_data_req - && slot_of_dl_tti_req == slot_of_tx_data_req) - { - if (nfapi_nr_p7_message_unpack((void *)buffer_for_tx_data_req, len_of_tx_data_req, &tx_data_request, - sizeof(tx_data_request), NULL) < 0) - { - LOG_E(NR_PHY, "Message tx_data_request failed to unpack\n"); - break; - } - LOG_I(NR_PHY, "Processing an NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST message in SFN/slot %d %d. \n", - tx_data_request.SFN, tx_data_request.Slot); - check_and_process_dci(NULL, &tx_data_request, NULL, NULL); - len_of_tx_data_req = 0; - } - } - if (tx_request) - { - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST message in SFN/slot %d %d. \n", - tx_data_request.SFN, tx_data_request.Slot); - if (tx_data_request.SFN == sfn_of_dl_tti_req && tx_data_request.Slot == slot_of_dl_tti_req - && (mac->expected_dci || mac->ra.ra_state <= WAIT_RAR)) - { - check_and_process_dci(NULL, &tx_data_request, NULL, NULL); - } - else - { - len_of_tx_data_req = len; - sfn_of_tx_data_req = tx_data_request.SFN; - slot_of_tx_data_req = tx_data_request.Slot; - memcpy(buffer_for_tx_data_req, buffer, len); - LOG_I(NR_PHY, "Saved an NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST message in SFN/slot %d %d. \n", - tx_data_request.SFN, tx_data_request.Slot); - } - } - if (ul_dci_request) - { - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST message in SFN/slot %d %d. \n", - ul_dci_request.SFN, ul_dci_request.Slot); - delta = NFAPI_SFNSLOT2DEC(sfn, slot) - NFAPI_SFNSLOT2DEC(ul_dci_request.SFN, ul_dci_request.Slot); - if (delta < -NFAPI_SFNSLOT2DEC(512, 0)) - { - delta += NFAPI_SFNSLOT2DEC(1024, 0); - } - if (delta < 6) - { - check_and_process_dci(NULL, NULL, &ul_dci_request, NULL); - } - } - if (ul_tti_request) - { - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message in SFN/slot %d %d. \n", - ul_tti_request.SFN, ul_tti_request.Slot); - check_and_process_dci(NULL, NULL, NULL, &ul_tti_request); - } - else - LOG_E(NR_PHY, "Case Statement has no corresponding nfapi message, this is the header ID %d\n", header.message_id); - -} -#endif static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_header_t header) { nfapi_nr_dl_tti_request_t dl_tti_request; @@ -850,61 +764,6 @@ void *nrue_standalone_pnf_task(void *context) { uint16_t sfn_slot = 0; memcpy((void *)&sfn_slot, buffer, sizeof(sfn_slot)); - sfn = NFAPI_SFNSLOT2SFN(sfn_slot); - slot = NFAPI_SFNSLOT2SLOT(sfn_slot); - if (slot == 5) - { - slot = 19; - if (sfn == 0) - sfn = 1023; - else - sfn = sfn - 1; - } - else if (slot == 4) - { - slot = 18; - if (sfn == 0) - sfn = 1023; - else - sfn = sfn - 1; - } - else if (slot == 3) - { - slot = 17; - if (sfn == 0) - sfn = 1023; - else - sfn = sfn - 1; - } - else if (slot == 2) - { - slot = 16; - if (sfn == 0) - sfn = 1023; - else - sfn = sfn - 1; - } - else if (slot == 1) - { - slot = 15; - if (sfn == 0) - sfn = 1023; - else - sfn = sfn - 1; - } - else if (slot == 0) - { - slot = 14; - if (sfn == 0) - sfn = 1023; - else - sfn = sfn - 1; - } - else - { - slot = slot - 6; - } - sfn_slot = NFAPI_SFNSLOT2HEX(sfn, slot); current_sfn_slot = sfn_slot; sfn_slot_pool[sfn_slot_id] = sfn_slot; @@ -922,6 +781,8 @@ void *nrue_standalone_pnf_task(void *context) abort(); } + sfn = NFAPI_SFNSLOT2SFN(sfn_slot); + slot = NFAPI_SFNSLOT2SLOT(sfn_slot); LOG_I(NR_PHY, "Received from proxy sfn %d slot %d\n", sfn, slot); } else if (len == sizeof(nr_phy_channel_params_t)) From 39563f3cd5ff550dc478b3173f7f686e04cdc7bf Mon Sep 17 00:00:00 2001 From: David Kim Date: Wed, 6 Oct 2021 11:52:49 -0700 Subject: [PATCH 15/32] Restored the original NAS configuration file. --- .../conf_files/episci/episci_ue_test_sfr.conf | 786 ++++++++++++++++++ openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf | 686 +-------------- 2 files changed, 793 insertions(+), 679 deletions(-) create mode 100644 ci-scripts/conf_files/episci/episci_ue_test_sfr.conf diff --git a/ci-scripts/conf_files/episci/episci_ue_test_sfr.conf b/ci-scripts/conf_files/episci/episci_ue_test_sfr.conf new file mode 100644 index 0000000000..e98e1b92f1 --- /dev/null +++ b/ci-scripts/conf_files/episci/episci_ue_test_sfr.conf @@ -0,0 +1,786 @@ +# List of known PLMNS +PLMN: { + PLMN0: { + FULLNAME="Test network"; + SHORTNAME="OAI4G"; + MNC="01"; + MCC="001"; + + }; + PLMN1: { + FULLNAME="SFR France"; + SHORTNAME="SFR"; + MNC="10"; + MCC="208"; + + }; + PLMN2: { + FULLNAME="SFR France"; + SHORTNAME="SFR"; + MNC="11"; + MCC="208"; + }; + PLMN3: { + FULLNAME="SFR France"; + SHORTNAME="SFR"; + MNC="13"; + MCC="208"; + }; + PLMN4: { + FULLNAME="OAI LTEBOX"; + SHORTNAME="OAIALU"; + MNC="95"; + MCC="208"; + }; + PLMN5: { + FULLNAME="T-Mobile USA"; + SHORTNAME="T-Mobile"; + MNC="280"; + MCC="310"; + }; + PLMN6: { + FULLNAME="FICTITIOUS USA"; + SHORTNAME="FICTITIO"; + MNC="028"; + MCC="310"; + }; + PLMN7: { + FULLNAME="Vodafone Italia"; + SHORTNAME="VODAFONE"; + MNC="10"; + MCC="222"; + }; + PLMN8: { + FULLNAME="Vodafone Spain"; + SHORTNAME="VODAFONE"; + MNC="01"; + MCC="214"; + }; + PLMN9: { + FULLNAME="Vodafone Spain"; + SHORTNAME="VODAFONE"; + MNC="06"; + MCC="214"; + }; + PLMN10: { + FULLNAME="Vodafone Germ"; + SHORTNAME="VODAFONE"; + MNC="02"; + MCC="262"; + }; + PLMN11: { + FULLNAME="Vodafone Germ"; + SHORTNAME="VODAFONE"; + MNC="04"; + MCC="262"; + }; + PLMN12: { + FULLNAME="Vodafone Germ"; + SHORTNAME="VODAFONE"; + MNC="230"; + MCC="320"; + }; +}; + +UE0: +{ + USER: { + IMEI="356113022094148"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000025"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561024"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE1: +{ + USER: { + IMEI="356113022094149"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000166"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561165"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE2: +{ + USER: { + IMEI="356113022094150"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000012"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561011"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE3: +{ + USER: { + IMEI="356113022094151"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000064"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561063"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE4: +{ + USER: { + IMEI="356113022094152"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000082"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561081"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE5: +{ + USER: { + IMEI="356113022094153"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000011"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561010"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE6: +{ + USER: { + IMEI="356113022094154"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000093"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561092"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE7: +{ + USER: { + IMEI="356113022094155"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000188"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561187"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE8: +{ + USER: { + IMEI="356113022094158"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000017"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561016"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE9: +{ + USER: { + IMEI="356113022094159"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000071"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561070"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE10: +{ + USER: { + IMEI="356113022094110"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000125"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561124"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE11: +{ + USER: { + IMEI="356113022094111"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000067"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561066"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE12: +{ + USER: { + IMEI="356113022094112"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000152"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561151"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE13: +{ + USER: { + IMEI="356113022094113"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000083"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561082"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE14: +{ + USER: { + IMEI="356113022094114"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000086"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561085"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE15: +{ + USER: { + IMEI="356113022094115"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000026"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561025"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE16: +{ + USER: { + IMEI="356113022094116"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000114"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561113"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE17: +{ + USER: { + IMEI="356113022094117"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000159"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561158"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; + +UE18: +{ + USER: { + IMEI="356113022094118"; + MANUFACTURER="EURECOM"; + MODEL="LTE Android PC"; + PIN="0000"; + }; + + SIM: { + MSIN="100000113"; + USIM_API_K="0c0a34601d4f07677303652c0462535b"; + OPC="ba05688178e398bedc100674071002cb"; + MSISDN="1011234561112"; + }; + + # Home PLMN Selector with Access Technology + HPLMN= "320230"; + + # User controlled PLMN Selector with Access Technology + UCPLMN_LIST = (); + + # Operator PLMN List + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + + # Operator controlled PLMN Selector with Access Technology + OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); + + # Forbidden plmns + FPLMN_LIST = (); + + # List of Equivalent HPLMNs +#TODO: UE does not connect if set, to be fixed in the UE +# EHPLMN_LIST= ("20811", "20813"); + EHPLMN_LIST= (); +}; \ No newline at end of file diff --git a/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf b/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf index e98e1b92f1..33405805a6 100644 --- a/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf +++ b/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf @@ -29,7 +29,7 @@ PLMN: { PLMN4: { FULLNAME="OAI LTEBOX"; SHORTNAME="OAIALU"; - MNC="95"; + MNC="93"; MCC="208"; }; PLMN5: { @@ -74,52 +74,9 @@ PLMN: { MNC="04"; MCC="262"; }; - PLMN12: { - FULLNAME="Vodafone Germ"; - SHORTNAME="VODAFONE"; - MNC="230"; - MCC="320"; - }; }; UE0: -{ - USER: { - IMEI="356113022094148"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000025"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561024"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE1: { USER: { IMEI="356113022094149"; @@ -129,20 +86,20 @@ UE1: }; SIM: { - MSIN="100000166"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561165"; + MSIN="0100001111"; + USIM_API_K="8baf473f2f8fd09487cccbd7097c6862"; + OPC="e734f8734007d6c5ce7a0508809e7e9c"; + MSISDN="33611123456"; }; # Home PLMN Selector with Access Technology - HPLMN= "320230"; + HPLMN= "20893"; # User controlled PLMN Selector with Access Technology UCPLMN_LIST = (); # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); + OPLMN_LIST = ("00101", "20810", "20811", "20813", "20893", "310280", "310028"); # Operator controlled PLMN Selector with Access Technology OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); @@ -155,632 +112,3 @@ UE1: # EHPLMN_LIST= ("20811", "20813"); EHPLMN_LIST= (); }; - -UE2: -{ - USER: { - IMEI="356113022094150"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000012"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561011"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE3: -{ - USER: { - IMEI="356113022094151"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000064"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561063"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE4: -{ - USER: { - IMEI="356113022094152"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000082"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561081"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE5: -{ - USER: { - IMEI="356113022094153"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000011"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561010"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE6: -{ - USER: { - IMEI="356113022094154"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000093"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561092"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE7: -{ - USER: { - IMEI="356113022094155"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000188"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561187"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE8: -{ - USER: { - IMEI="356113022094158"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000017"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561016"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE9: -{ - USER: { - IMEI="356113022094159"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000071"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561070"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE10: -{ - USER: { - IMEI="356113022094110"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000125"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561124"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE11: -{ - USER: { - IMEI="356113022094111"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000067"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561066"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE12: -{ - USER: { - IMEI="356113022094112"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000152"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561151"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE13: -{ - USER: { - IMEI="356113022094113"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000083"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561082"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE14: -{ - USER: { - IMEI="356113022094114"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000086"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561085"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE15: -{ - USER: { - IMEI="356113022094115"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000026"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561025"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE16: -{ - USER: { - IMEI="356113022094116"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000114"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561113"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE17: -{ - USER: { - IMEI="356113022094117"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000159"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561158"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; - -UE18: -{ - USER: { - IMEI="356113022094118"; - MANUFACTURER="EURECOM"; - MODEL="LTE Android PC"; - PIN="0000"; - }; - - SIM: { - MSIN="100000113"; - USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; - MSISDN="1011234561112"; - }; - - # Home PLMN Selector with Access Technology - HPLMN= "320230"; - - # User controlled PLMN Selector with Access Technology - UCPLMN_LIST = (); - - # Operator PLMN List - OPLMN_LIST = ("00101", "20810", "20811", "20813", "20895", "310280", "310028", "320230"); - - # Operator controlled PLMN Selector with Access Technology - OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204"); - - # Forbidden plmns - FPLMN_LIST = (); - - # List of Equivalent HPLMNs -#TODO: UE does not connect if set, to be fixed in the UE -# EHPLMN_LIST= ("20811", "20813"); - EHPLMN_LIST= (); -}; \ No newline at end of file From 9355495ad164549b98e5242eebb0d739b333f9f9 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 7 Oct 2021 16:44:42 -0700 Subject: [PATCH 16/32] Unqueueing UL_TTI_REQs based on active harq sfn sf Also fixed some silly spelling errors. --- executables/nr-ue.c | 18 +++++++++++++++--- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 1 + openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 4 +++- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 6 +++--- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 48d44ae1ca..2ac77f66b2 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -257,14 +257,17 @@ static bool sfn_slot_matcher(void *wanted, void *candidate) return false; } -static void process_queued_nr_nfapi_msgs(int sfn_slot) +static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot) { nfapi_nr_rach_indication_t *rach_ind = unqueue_matching(&nr_rach_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); nfapi_nr_rx_data_indication_t *rx_ind = unqueue_matching(&nr_rx_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); nfapi_nr_crc_indication_t *crc_ind = unqueue_matching(&nr_crc_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); nfapi_nr_dl_tti_request_t *dl_tti_request = get_queue(&nr_dl_tti_req_queue); nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue); - nfapi_nr_ul_tti_request_t *ul_tti_request = get_queue(&nr_ul_tti_req_queue); + + LOG_D(NR_MAC, "Try to get a ul_tti_req for sfn/slot %d %d from queue with %d items\n", + NFAPI_SFNSLOT2SFN(mac->active_harq_sfn_sf),NFAPI_SFNSLOT2SLOT(mac->active_harq_sfn_sf), nr_ul_tti_req_queue.num_items); + nfapi_nr_ul_tti_request_t *ul_tti_request = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->active_harq_sfn_sf); if (rach_ind && rach_ind->number_of_pdus > 0) { @@ -318,6 +321,11 @@ static void process_queued_nr_nfapi_msgs(int sfn_slot) save_nr_measurement_info(dl_tti_request); check_and_process_dci(dl_tti_request, tx_data_request, NULL, NULL); } + else + { + AssertFatal(false, "We dont have PDUs in either dl_tti %d or tx_req %d\n", + dl_tti_request->dl_tti_request_body.nPDUs, tx_data_request->Number_of_PDUs); + } } if (ul_dci_request && ul_dci_request->numPdus > 0) { @@ -373,6 +381,10 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) reset_queue(&nr_rx_ind_queue); reset_queue(&nr_crc_ind_queue); reset_queue(&nr_uci_ind_queue); + reset_queue(&nr_dl_tti_req_queue); + reset_queue(&nr_tx_req_queue); + reset_queue(&nr_ul_dci_req_queue); + reset_queue(&nr_ul_tti_req_queue); NR_PRACH_RESOURCES_t prach_resources; memset(&prach_resources, 0, sizeof(prach_resources)); @@ -452,7 +464,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) nr_ue_ul_indication(&ul_info); check_nr_prach(mac, &ul_info, &prach_resources); } - process_queued_nr_nfapi_msgs(sfn_slot); + process_queued_nr_nfapi_msgs(mac, sfn_slot); } return NULL; } diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index fddd14bb8e..8aa1be3e59 100755 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -437,6 +437,7 @@ typedef struct { bool expected_dci; bool index_has_dci[16]; + int active_harq_sfn_sf; pthread_mutex_t mutex_dl_info; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 03c8078953..4cd398c1f2 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1283,8 +1283,10 @@ void set_harq_status(NR_UE_MAC_INST_t *mac, // FIXME k0 != 0 currently not taken into consideration current_harq->dl_frame = frame; current_harq->dl_slot = slot; + mac->active_harq_sfn_sf = NFAPI_SFNSLOT2HEX(frame, (slot + data_toul_fb)); - LOG_D(PHY,"Setting harq_status for harq_id %d, dl %d.%d\n",harq_id,frame,slot); + LOG_D(NR_PHY,"Setting harq_status for harq_id %d, dl %d.%d, sched ul %d.%d\n", + harq_id, frame, slot, frame, (slot + data_toul_fb)); } diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 827fd3e0f1..dd14754d8a 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -93,7 +93,7 @@ void nrue_init_standalone_socket(int tx_port, int rx_port) } assert(ue_tx_sock_descriptor == -1); ue_tx_sock_descriptor = sd; - LOG_D(NR_RRC, "Sucessfully set up tx_socket in %s.\n", __FUNCTION__); + LOG_D(NR_RRC, "Successfully set up tx_socket in %s.\n", __FUNCTION__); } { @@ -119,7 +119,7 @@ void nrue_init_standalone_socket(int tx_port, int rx_port) } assert(ue_rx_sock_descriptor == -1); ue_rx_sock_descriptor = sd; - LOG_D(NR_RRC, "Sucessfully set up rx_socket in %s.\n", __FUNCTION__); + LOG_D(NR_RRC, "Successfully set up rx_socket in %s.\n", __FUNCTION__); } LOG_I(NR_RRC, "NRUE standalone socket info: tx_port %d rx_port %d on %s.\n", tx_port, rx_port, stub_eth_params.remote_addr); @@ -745,7 +745,7 @@ void *nrue_standalone_pnf_task(void *context) int slot = 0; - LOG_I(NR_RRC, "Sucessfully started %s.\n", __FUNCTION__); + LOG_I(NR_RRC, "Successfully started %s.\n", __FUNCTION__); while (true) { From 4b8a15fa148a9c72e12d8acc3d3fa6dc0f181db3 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 7 Oct 2021 18:37:20 -0700 Subject: [PATCH 17/32] Allocating NR nFAPI messages on the heap prior to queueing This commit is properly allocating the NR nFAPI messages on the heap; however, when we do this, it makes the NR UE behind the gNB even more and casuses us to not finish the CFRA procedure. This is because the RAR is recevied in the NR UE, but the slot indications are too far in advance, so the CRC/RX pair (msg3) is never sent because the scheduled ul_slot and ul_frame already was received prior to getting the RAR. Need to fix this!! --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 146 ++++++++++++++++++-- 1 file changed, 131 insertions(+), 15 deletions(-) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index dd14754d8a..8d85af5f03 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -655,60 +655,173 @@ void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request) LOG_A(NR_RRC, "Populated NR_UE_RRC_MEASUREMENT information and sent to LTE UE\n"); } -static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_header_t header) +#if 0 +static void *memcpy_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_tti) { + nfapi_nr_dl_tti_request_t *p = malloc(sizeof(nfapi_nr_dl_tti_request_t)); + + p->header = dl_tti->header; + p->SFN = dl_tti->SFN; + p->Slot = dl_tti->Slot; + p->dl_tti_request_body = dl_tti->dl_tti_request_body; + p->vendor_extension = dl_tti->vendor_extension; + + p->dl_tti_request_body.nGroup = dl_tti->dl_tti_request_body.nGroup; + p->dl_tti_request_body.nPDUs = dl_tti->dl_tti_request_body.nPDUs; + + for (int i = 0; i < p->dl_tti_request_body.nPDUs; i++) + { + p->dl_tti_request_body.dl_tti_pdu_list[i] = + dl_tti->dl_tti_request_body.dl_tti_pdu_list[i]; + p->dl_tti_request_body.dl_tti_pdu_list[i].pdcch_pdu = + dl_tti->dl_tti_request_body.dl_tti_pdu_list[i].pdcch_pdu; + p->dl_tti_request_body.dl_tti_pdu_list[i].pdsch_pdu = + dl_tti->dl_tti_request_body.dl_tti_pdu_list[i].pdsch_pdu; + p->dl_tti_request_body.dl_tti_pdu_list[i].ssb_pdu = + dl_tti->dl_tti_request_body.dl_tti_pdu_list[i].ssb_pdu; + p->dl_tti_request_body.dl_tti_pdu_list[i].csi_rs_pdu = + dl_tti->dl_tti_request_body.dl_tti_pdu_list[i].csi_rs_pdu; + } + return p; +} + +static void *memcpy_tx_data_req(nfapi_nr_tx_data_request_t *tx_data) +{ + nfapi_nr_tx_data_request_t *p = malloc(sizeof(nfapi_nr_tx_data_request_t)); + + p->header = tx_data->header; + p->SFN = tx_data->SFN; + p->Slot = tx_data->Slot; + p->Number_of_PDUs = tx_data->Number_of_PDUs; + + for (int i = 0; i < p->Number_of_PDUs; i++) + { + p->pdu_list[i] = tx_data->pdu_list[i]; + for (int j = 0; j < p->pdu_list[i].num_TLV; j++) + p->pdu_list[i].TLVs[j] = tx_data->pdu_list[i].TLVs[j]; + + } + return p; +} + +static void *memcpy_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci) +{ + nfapi_nr_ul_dci_request_t *p = malloc(sizeof(nfapi_nr_ul_dci_request_t)); + + p->header = ul_dci->header; + p->SFN = ul_dci->SFN; + p->Slot = ul_dci->Slot; + p->numPdus = ul_dci->numPdus; + + for (int i = 0; i < p->numPdus; i++) + { + p->ul_dci_pdu_list[i] = ul_dci->ul_dci_pdu_list[i]; + p->ul_dci_pdu_list[i].pdcch_pdu = ul_dci->ul_dci_pdu_list[i].pdcch_pdu; + } + return p; +} + +static void *memcpy_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti) +{ + nfapi_nr_ul_tti_request_t *p = malloc(sizeof(nfapi_nr_ul_tti_request_t)); + + p->header = ul_tti->header; + p->SFN = ul_tti->SFN; + p->Slot = ul_tti->Slot; + p->n_pdus = ul_tti->n_pdus; + p->n_ulcch = ul_tti->n_ulcch; + p->n_ulsch = ul_tti->n_ulsch; + p->rach_present = ul_tti->rach_present; + + for (int i = 0; i < p->n_pdus; i++) + { + p->pdus_list[i] = ul_tti->pdus_list[i]; + p->pdus_list[i].prach_pdu = ul_tti->pdus_list[i].prach_pdu; + p->pdus_list[i].pucch_pdu = ul_tti->pdus_list[i].pucch_pdu; + p->pdus_list[i].pusch_pdu = ul_tti->pdus_list[i].pusch_pdu; + p->pdus_list[i].srs_pdu = ul_tti->pdus_list[i].srs_pdu; + } + return p; +} nfapi_nr_dl_tti_request_t dl_tti_request; nfapi_nr_tx_data_request_t tx_data_request; nfapi_nr_ul_dci_request_t ul_dci_request; nfapi_nr_ul_tti_request_t ul_tti_request; + + nfapi_nr_dl_tti_request_t *dl_tti_req_temp = memcpy_dl_tti_req(&dl_tti_request); + nfapi_nr_tx_data_request_t *tx_data_req_temp = memcpy_tx_data_req(&tx_data_request); + nfapi_nr_ul_dci_request_t *ul_dci_req_temp = memcpy_ul_dci_req(&ul_dci_request); + nfapi_nr_ul_tti_request_t *ul_tti_req_temp = memcpy_ul_tti_req(&ul_tti_request); +#endif + +static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_header_t header) +{ + switch (header.message_id) { case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: - if (nfapi_nr_p7_message_unpack((void *)buffer, len, &dl_tti_request, - sizeof(dl_tti_request), NULL) < 0) + { + nfapi_nr_dl_tti_request_t *dl_tti_request = MALLOC(sizeof(*dl_tti_request)); + if (nfapi_nr_p7_message_unpack((void *)buffer, len, dl_tti_request, + sizeof(*dl_tti_request), NULL) < 0) { LOG_E(NR_PHY, "Message dl_tti_request failed to unpack\n"); break; } LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST message in sfn/slot %d %d. \n", - dl_tti_request.SFN, dl_tti_request.Slot); - if (!put_queue(&nr_dl_tti_req_queue, &dl_tti_request)) + dl_tti_request->SFN, dl_tti_request->Slot); + if (!put_queue(&nr_dl_tti_req_queue, dl_tti_request)) { LOG_E(NR_PHY, "put_queue failed for dl_tti_request.\n"); + free(dl_tti_request); + dl_tti_request = NULL; } break; + } case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: - if (nfapi_nr_p7_message_unpack((void *)buffer, len, &tx_data_request, - sizeof(tx_data_request), NULL) < 0) + { + nfapi_nr_tx_data_request_t *tx_data_request = MALLOC(sizeof(*tx_data_request)); + if (nfapi_nr_p7_message_unpack((void *)buffer, len, tx_data_request, + sizeof(*tx_data_request), NULL) < 0) { LOG_E(NR_PHY, "Message tx_data_request failed to unpack\n"); break; } LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST message in SFN/slot %d %d. \n", - tx_data_request.SFN, tx_data_request.Slot); - if (!put_queue(&nr_tx_req_queue, &tx_data_request)) + tx_data_request->SFN, tx_data_request->Slot); + if (!put_queue(&nr_tx_req_queue, tx_data_request)) { LOG_E(NR_PHY, "put_queue failed for tx_request.\n"); + free(tx_data_request); + tx_data_request = NULL; } break; + } case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: - if (nfapi_nr_p7_message_unpack((void *)buffer, len, &ul_dci_request, - sizeof(ul_dci_request), NULL) < 0) + { + nfapi_nr_ul_dci_request_t *ul_dci_request = MALLOC(sizeof(*ul_dci_request)); + if (nfapi_nr_p7_message_unpack((void *)buffer, len, ul_dci_request, + sizeof(*ul_dci_request), NULL) < 0) { LOG_E(NR_PHY, "Message ul_dci_request failed to unpack\n"); break; } LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST message in SFN/slot %d %d. \n", - ul_dci_request.SFN, ul_dci_request.Slot); - if (!put_queue(&nr_ul_dci_req_queue, &ul_dci_request)) + ul_dci_request->SFN, ul_dci_request->Slot); + if (!put_queue(&nr_ul_dci_req_queue, ul_dci_request)) { LOG_E(NR_PHY, "put_queue failed for ul_dci_request.\n"); + free(ul_dci_request); + ul_dci_request = NULL; } break; + } case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: + { + nfapi_nr_ul_tti_request_t *ul_tti_request = MALLOC(sizeof(*ul_tti_request)); if (nfapi_nr_p7_message_unpack((void *)buffer, len, &ul_tti_request, sizeof(ul_tti_request), NULL) < 0) { @@ -716,12 +829,15 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea break; } LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message in SFN/slot %d %d. \n", - ul_tti_request.SFN, ul_tti_request.Slot); - if (!put_queue(&nr_ul_tti_req_queue, &ul_tti_request)) + ul_tti_request->SFN, ul_tti_request->Slot); + if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) { LOG_E(NR_PHY, "put_queue failed for ul_tti_request.\n"); + free(ul_tti_request); + ul_tti_request = NULL; } break; + } default: LOG_E(NR_PHY, "Invalid nFAPI message. Header ID %d\n", From b3145dec04a580316c315e99fc267d49741a1b2c Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 8 Oct 2021 08:53:49 -0700 Subject: [PATCH 18/32] Removing commented code --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 99 --------------------- 1 file changed, 99 deletions(-) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 8d85af5f03..78950ea176 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -655,105 +655,6 @@ void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request) LOG_A(NR_RRC, "Populated NR_UE_RRC_MEASUREMENT information and sent to LTE UE\n"); } -#if 0 -static void *memcpy_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_tti) -{ - nfapi_nr_dl_tti_request_t *p = malloc(sizeof(nfapi_nr_dl_tti_request_t)); - - p->header = dl_tti->header; - p->SFN = dl_tti->SFN; - p->Slot = dl_tti->Slot; - p->dl_tti_request_body = dl_tti->dl_tti_request_body; - p->vendor_extension = dl_tti->vendor_extension; - - p->dl_tti_request_body.nGroup = dl_tti->dl_tti_request_body.nGroup; - p->dl_tti_request_body.nPDUs = dl_tti->dl_tti_request_body.nPDUs; - - for (int i = 0; i < p->dl_tti_request_body.nPDUs; i++) - { - p->dl_tti_request_body.dl_tti_pdu_list[i] = - dl_tti->dl_tti_request_body.dl_tti_pdu_list[i]; - p->dl_tti_request_body.dl_tti_pdu_list[i].pdcch_pdu = - dl_tti->dl_tti_request_body.dl_tti_pdu_list[i].pdcch_pdu; - p->dl_tti_request_body.dl_tti_pdu_list[i].pdsch_pdu = - dl_tti->dl_tti_request_body.dl_tti_pdu_list[i].pdsch_pdu; - p->dl_tti_request_body.dl_tti_pdu_list[i].ssb_pdu = - dl_tti->dl_tti_request_body.dl_tti_pdu_list[i].ssb_pdu; - p->dl_tti_request_body.dl_tti_pdu_list[i].csi_rs_pdu = - dl_tti->dl_tti_request_body.dl_tti_pdu_list[i].csi_rs_pdu; - } - return p; -} - -static void *memcpy_tx_data_req(nfapi_nr_tx_data_request_t *tx_data) -{ - nfapi_nr_tx_data_request_t *p = malloc(sizeof(nfapi_nr_tx_data_request_t)); - - p->header = tx_data->header; - p->SFN = tx_data->SFN; - p->Slot = tx_data->Slot; - p->Number_of_PDUs = tx_data->Number_of_PDUs; - - for (int i = 0; i < p->Number_of_PDUs; i++) - { - p->pdu_list[i] = tx_data->pdu_list[i]; - for (int j = 0; j < p->pdu_list[i].num_TLV; j++) - p->pdu_list[i].TLVs[j] = tx_data->pdu_list[i].TLVs[j]; - - } - return p; -} - -static void *memcpy_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci) -{ - nfapi_nr_ul_dci_request_t *p = malloc(sizeof(nfapi_nr_ul_dci_request_t)); - - p->header = ul_dci->header; - p->SFN = ul_dci->SFN; - p->Slot = ul_dci->Slot; - p->numPdus = ul_dci->numPdus; - - for (int i = 0; i < p->numPdus; i++) - { - p->ul_dci_pdu_list[i] = ul_dci->ul_dci_pdu_list[i]; - p->ul_dci_pdu_list[i].pdcch_pdu = ul_dci->ul_dci_pdu_list[i].pdcch_pdu; - } - return p; -} - -static void *memcpy_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti) -{ - nfapi_nr_ul_tti_request_t *p = malloc(sizeof(nfapi_nr_ul_tti_request_t)); - - p->header = ul_tti->header; - p->SFN = ul_tti->SFN; - p->Slot = ul_tti->Slot; - p->n_pdus = ul_tti->n_pdus; - p->n_ulcch = ul_tti->n_ulcch; - p->n_ulsch = ul_tti->n_ulsch; - p->rach_present = ul_tti->rach_present; - - for (int i = 0; i < p->n_pdus; i++) - { - p->pdus_list[i] = ul_tti->pdus_list[i]; - p->pdus_list[i].prach_pdu = ul_tti->pdus_list[i].prach_pdu; - p->pdus_list[i].pucch_pdu = ul_tti->pdus_list[i].pucch_pdu; - p->pdus_list[i].pusch_pdu = ul_tti->pdus_list[i].pusch_pdu; - p->pdus_list[i].srs_pdu = ul_tti->pdus_list[i].srs_pdu; - } - return p; -} - nfapi_nr_dl_tti_request_t dl_tti_request; - nfapi_nr_tx_data_request_t tx_data_request; - nfapi_nr_ul_dci_request_t ul_dci_request; - nfapi_nr_ul_tti_request_t ul_tti_request; - - nfapi_nr_dl_tti_request_t *dl_tti_req_temp = memcpy_dl_tti_req(&dl_tti_request); - nfapi_nr_tx_data_request_t *tx_data_req_temp = memcpy_tx_data_req(&tx_data_request); - nfapi_nr_ul_dci_request_t *ul_dci_req_temp = memcpy_ul_dci_req(&ul_dci_request); - nfapi_nr_ul_tti_request_t *ul_tti_req_temp = memcpy_ul_tti_req(&ul_tti_request); -#endif - static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_header_t header) { From f37264e6767794ee51f1f1a981df4e8dae708d46 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 8 Oct 2021 15:45:28 -0700 Subject: [PATCH 19/32] Avoiding unnecessary casting and fixed bug in ul_tti handling --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 78950ea176..c1d5a04a2d 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -663,7 +663,7 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: { nfapi_nr_dl_tti_request_t *dl_tti_request = MALLOC(sizeof(*dl_tti_request)); - if (nfapi_nr_p7_message_unpack((void *)buffer, len, dl_tti_request, + if (nfapi_nr_p7_message_unpack(buffer, len, dl_tti_request, sizeof(*dl_tti_request), NULL) < 0) { LOG_E(NR_PHY, "Message dl_tti_request failed to unpack\n"); @@ -683,7 +683,7 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: { nfapi_nr_tx_data_request_t *tx_data_request = MALLOC(sizeof(*tx_data_request)); - if (nfapi_nr_p7_message_unpack((void *)buffer, len, tx_data_request, + if (nfapi_nr_p7_message_unpack(buffer, len, tx_data_request, sizeof(*tx_data_request), NULL) < 0) { LOG_E(NR_PHY, "Message tx_data_request failed to unpack\n"); @@ -703,7 +703,7 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: { nfapi_nr_ul_dci_request_t *ul_dci_request = MALLOC(sizeof(*ul_dci_request)); - if (nfapi_nr_p7_message_unpack((void *)buffer, len, ul_dci_request, + if (nfapi_nr_p7_message_unpack(buffer, len, ul_dci_request, sizeof(*ul_dci_request), NULL) < 0) { LOG_E(NR_PHY, "Message ul_dci_request failed to unpack\n"); @@ -723,8 +723,8 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: { nfapi_nr_ul_tti_request_t *ul_tti_request = MALLOC(sizeof(*ul_tti_request)); - if (nfapi_nr_p7_message_unpack((void *)buffer, len, &ul_tti_request, - sizeof(ul_tti_request), NULL) < 0) + if (nfapi_nr_p7_message_unpack(buffer, len, ul_tti_request, + sizeof(*ul_tti_request), NULL) < 0) { LOG_E(NR_PHY, "Message ul_tti_request failed to unpack\n"); break; @@ -829,7 +829,7 @@ void *nrue_standalone_pnf_task(void *context) else { nfapi_p7_message_header_t header; - if (nfapi_p7_message_header_unpack((void *)buffer, len, &header, sizeof(header), NULL) < 0) + if (nfapi_p7_message_header_unpack(buffer, len, &header, sizeof(header), NULL) < 0) { LOG_E(NR_PHY, "Header unpack failed for nrue_standalone pnf\n"); continue; From b17a5189b7a40faf033df690e6b5ad057bdf7201 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 12 Oct 2021 10:27:15 -0700 Subject: [PATCH 20/32] Adding timing informtion to rx'd slot indictions Ensuring in the NRUE that the slot indications we process are 500us apart. --- executables/nr-ue.c | 20 ++++++++++++---- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 5 ++++ openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 26 +++++++++++++++------ 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 2ac77f66b2..493fdf5deb 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -391,8 +391,9 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) NR_UL_TIME_ALIGNMENT_t ul_time_alignment; memset(&ul_time_alignment, 0, sizeof(ul_time_alignment)); int last_sfn_slot = -1; - uint16_t *sfn_slot_p; int sfn_slot; + uint64_t last_time_stamp = 0; + sfn_slot_info_t *sfn_slot_info; while (!oai_exit) { @@ -401,14 +402,14 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) LOG_E(NR_MAC, "sem_wait() error\n"); abort(); } - sfn_slot_p = get_queue(&nr_sfn_slot_queue); - if (sfn_slot_p == NULL) + sfn_slot_info = get_queue(&nr_sfn_slot_queue); + if (sfn_slot_info == NULL) { LOG_D(MAC, "get_queue(&nr_sfn_slot_queue) == NULL!\n"); continue; } - sfn_slot = *sfn_slot_p; + sfn_slot = sfn_slot_info->sfn_slot; if (sfn_slot == last_sfn_slot) { LOG_D(NR_MAC, "repeated sfn_sf = %d.%d\n", @@ -416,6 +417,17 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) continue; } last_sfn_slot = sfn_slot; + LOG_D(NR_MAC, "The received sfn/slot [%d %d], last time stamp %ld, current time stamp %ld\n", + NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot), last_time_stamp, sfn_slot_info->time_stamp); + + uint64_t delta = sfn_slot_info->time_stamp - last_time_stamp; + if (delta < 500) + { + LOG_D(NR_MAC, "sfn/slot [%d %d] has been received too quickly! Delta = %ld. Will sleep for %ld us\n", + NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot), delta, 500 - delta); + usleep(500 - delta); + } + last_time_stamp = sfn_slot_info->time_stamp; module_id_t mod_id = 0; NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 8aa1be3e59..4873b0027c 100755 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -443,6 +443,11 @@ typedef struct { } NR_UE_MAC_INST_t; +typedef struct sfn_slot_info { + uint16_t sfn_slot; + uint64_t time_stamp; +} sfn_slot_info_t; + typedef enum seach_space_mask_e { type0_pdcch = 0x1, type0a_pdcch = 0x2, diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index c1d5a04a2d..64182330ff 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -748,7 +748,17 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea return; } -uint16_t sfn_slot_pool[512]; +static uint64_t clock_usec() +{ + struct timespec t; + if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) + { + abort(); + } + return (uint64_t)t.tv_sec * 1000000 + (t.tv_nsec / 1000); +} + +sfn_slot_info_t sfn_slot_pool[512]; uint16_t sfn_slot_id; void *nrue_standalone_pnf_task(void *context) { @@ -783,7 +793,12 @@ void *nrue_standalone_pnf_task(void *context) memcpy((void *)&sfn_slot, buffer, sizeof(sfn_slot)); current_sfn_slot = sfn_slot; - sfn_slot_pool[sfn_slot_id] = sfn_slot; + sfn_slot_pool[sfn_slot_id].sfn_slot = sfn_slot; + sfn_slot_pool[sfn_slot_id].time_stamp = clock_usec(); + sfn = NFAPI_SFNSLOT2SFN(sfn_slot); + slot = NFAPI_SFNSLOT2SLOT(sfn_slot); + LOG_I(NR_PHY, "Received from proxy sfn %d slot %d and time_stamp = %ld\n", + sfn, slot, sfn_slot_pool[sfn_slot_id].time_stamp); if (!put_queue(&nr_sfn_slot_queue, &sfn_slot_pool[sfn_slot_id])) { @@ -797,10 +812,6 @@ void *nrue_standalone_pnf_task(void *context) LOG_E(NR_PHY, "sem_post() error\n"); abort(); } - - sfn = NFAPI_SFNSLOT2SFN(sfn_slot); - slot = NFAPI_SFNSLOT2SLOT(sfn_slot); - LOG_I(NR_PHY, "Received from proxy sfn %d slot %d\n", sfn, slot); } else if (len == sizeof(nr_phy_channel_params_t)) { @@ -808,7 +819,8 @@ void *nrue_standalone_pnf_task(void *context) memcpy(&ch_info, buffer, sizeof(nr_phy_channel_params_t)); current_sfn_slot = ch_info.sfn_slot; - sfn_slot_pool[sfn_slot_id] = ch_info.sfn_slot; + sfn_slot_pool[sfn_slot_id].sfn_slot = ch_info.sfn_slot; + sfn_slot_pool[sfn_slot_id].time_stamp = clock_usec(); if (!put_queue(&nr_sfn_slot_queue, &sfn_slot_pool[sfn_slot_id])) { From ea2495ea0a9b5c3ecc7ec1f529f87279a611e3eb Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 12 Oct 2021 17:06:00 -0700 Subject: [PATCH 21/32] Attemping to stop filling UL_TTI_REQ queue This is sort of hacky, but it stops the gNB from crashing for 2 UEs with the proxy and 4 UEs with our internal proxy. --- executables/nr-ue.c | 9 +++------ openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 493fdf5deb..ede6ff3fc2 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -309,12 +309,9 @@ static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot) { LOG_E(NR_MAC, "[%d %d] No corresponding tx_data_request for given dl_tti_request sfn/slot\n", NFAPI_SFNSLOT2SFN(dl_tti_sfn_slot), NFAPI_SFNSLOT2SLOT(dl_tti_sfn_slot)); - if (!put_queue(&nr_dl_tti_req_queue, dl_tti_request)) - { - LOG_E(NR_PHY, "put_queue failed for dl_tti_request.\n"); - free(dl_tti_request); - dl_tti_request = NULL; - } + save_nr_measurement_info(dl_tti_request); + free(dl_tti_request); + dl_tti_request = NULL; } else if (dl_tti_request->dl_tti_request_body.nPDUs > 0 && tx_data_request->Number_of_PDUs > 0) { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 64182330ff..47e8ae8b12 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -729,13 +729,22 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea LOG_E(NR_PHY, "Message ul_tti_request failed to unpack\n"); break; } - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message in SFN/slot %d %d. \n", + LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message in SFN/slot %d %d.\n", ul_tti_request->SFN, ul_tti_request->Slot); - if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) + if (nr_uci_ind_queue.num_items > 0) { - LOG_E(NR_PHY, "put_queue failed for ul_tti_request.\n"); - free(ul_tti_request); - ul_tti_request = NULL; + LOG_I(NR_MAC, "Melissa, we added UL_TTI_REQ to queue for sfn slot %d %d\n", + ul_tti_request->SFN, ul_tti_request->Slot); + if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) + { + reset_queue(&nr_ul_tti_req_queue); + if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) + { + LOG_E(NR_PHY, "put_queue failed for ul_tti_request.\n"); + free(ul_tti_request); + ul_tti_request = NULL; + } + } } break; } From 58eb8d2af49db520fece069f518cd0bcc3275dfa Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 19 Oct 2021 07:59:55 -0700 Subject: [PATCH 22/32] Creating new queue for ul_ttis if dl_tti is late Also, this commit changes the len argument in the pusharray32 to match the actual field type (uint16_t). There is also simple name change from sf -> slot. The new queueing system is not a permanent solution. It was simply a way for us to try to handle late dl_tti_requests. If we queue every single ul_tti_req that we get, the queue gets full very quickly becasue we only remove ul_ttis from the queue when a uci has been populated with a matching sfn/sf. Because of this, we only queue ul_ttis if we have a uci_indication prepared already. Rarely, a dl_tti_req will arrive at the NRUE too late, and the NRUE does not have time to create the uci_ind so we dont process the corresponding ul_tti. A seprate queue was made to hold all other ul_ttis the arrive in the NRUE (this queue will continuously get full and then emptied) but will occasionally hold a ul_tti that corresponds to a uci that hasnt been populated yet. --- executables/nr-ue.c | 10 ++++++-- nfapi/open-nFAPI/nfapi/inc/nfapi.h | 2 +- nfapi/open-nFAPI/nfapi/src/nfapi.c | 2 +- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 2 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 24 +++++++++++++++++++- openair2/RRC/NR_UE/rrc_UE.c | 1 + openair2/RRC/NR_UE/rrc_proto.h | 1 + 8 files changed, 37 insertions(+), 7 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index ede6ff3fc2..fd094770ea 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -266,8 +266,13 @@ static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot) nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue); LOG_D(NR_MAC, "Try to get a ul_tti_req for sfn/slot %d %d from queue with %d items\n", - NFAPI_SFNSLOT2SFN(mac->active_harq_sfn_sf),NFAPI_SFNSLOT2SLOT(mac->active_harq_sfn_sf), nr_ul_tti_req_queue.num_items); - nfapi_nr_ul_tti_request_t *ul_tti_request = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->active_harq_sfn_sf); + NFAPI_SFNSLOT2SFN(mac->active_harq_sfn_slot),NFAPI_SFNSLOT2SLOT(mac->active_harq_sfn_slot), nr_ul_tti_req_queue.num_items); + nfapi_nr_ul_tti_request_t *ul_tti_request = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->active_harq_sfn_slot); + if (!ul_tti_request) + { + LOG_D(NR_MAC, "Try to get a ul_tti_req from seprate queue because dl_tti_req was late\n"); + ul_tti_request = unqueue_matching(&nr_wait_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->active_harq_sfn_slot); + } if (rach_ind && rach_ind->number_of_pdus > 0) { @@ -382,6 +387,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) reset_queue(&nr_tx_req_queue); reset_queue(&nr_ul_dci_req_queue); reset_queue(&nr_ul_tti_req_queue); + reset_queue(&nr_wait_ul_tti_req_queue); NR_PRACH_RESOURCES_t prach_resources; memset(&prach_resources, 0, sizeof(prach_resources)); diff --git a/nfapi/open-nFAPI/nfapi/inc/nfapi.h b/nfapi/open-nFAPI/nfapi/inc/nfapi.h index 0f09efa78a..05db920035 100644 --- a/nfapi/open-nFAPI/nfapi/inc/nfapi.h +++ b/nfapi/open-nFAPI/nfapi/inc/nfapi.h @@ -50,7 +50,7 @@ uint32_t pullarrays32(uint8_t **in, int32_t out[], uint32_t max_len, uint32_t le uint32_t pusharray8(uint8_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); uint32_t pusharray16(uint16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); uint32_t pusharrays16(int16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); -uint32_t pusharray32(uint32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); +uint32_t pusharray32(uint32_t in[], uint32_t max_len, uint16_t len, uint8_t **out, uint8_t *end); uint32_t pusharrays32(int32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); typedef uint8_t (*pack_array_elem_fn)(void* elem, uint8_t **ppWritePackedMsg, uint8_t *end); diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi.c b/nfapi/open-nFAPI/nfapi/src/nfapi.c index 2783781e2c..37bb648e2b 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi.c @@ -363,7 +363,7 @@ uint32_t pullarrays32(uint8_t **in, int32_t out[], uint32_t max_len, uint32_t le return 0; } } -uint32_t pusharray32(uint32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) { +uint32_t pusharray32(uint32_t in[], uint32_t max_len, uint16_t len, uint8_t **out, uint8_t *end) { if(len == 0) return 1; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 4873b0027c..bd612c81cd 100755 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -437,7 +437,7 @@ typedef struct { bool expected_dci; bool index_has_dci[16]; - int active_harq_sfn_sf; + int active_harq_sfn_slot; pthread_mutex_t mutex_dl_info; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 4cd398c1f2..7e76e58d61 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1283,7 +1283,7 @@ void set_harq_status(NR_UE_MAC_INST_t *mac, // FIXME k0 != 0 currently not taken into consideration current_harq->dl_frame = frame; current_harq->dl_slot = slot; - mac->active_harq_sfn_sf = NFAPI_SFNSLOT2HEX(frame, (slot + data_toul_fb)); + mac->active_harq_sfn_slot = NFAPI_SFNSLOT2HEX(frame, (slot + data_toul_fb)); LOG_D(NR_PHY,"Setting harq_status for harq_id %d, dl %d.%d, sched ul %d.%d\n", harq_id, frame, slot, frame, (slot + data_toul_fb)); diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 47e8ae8b12..00d17d81bd 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -60,6 +60,7 @@ queue_t nr_dl_tti_req_queue; queue_t nr_tx_req_queue; queue_t nr_ul_dci_req_queue; queue_t nr_ul_tti_req_queue; +queue_t nr_wait_ul_tti_req_queue; void nrue_init_standalone_socket(int tx_port, int rx_port) { @@ -731,7 +732,7 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea } LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message in SFN/slot %d %d.\n", ul_tti_request->SFN, ul_tti_request->Slot); - if (nr_uci_ind_queue.num_items > 0) + if (nr_uci_ind_queue.num_items > 0) //TODO: In the future UL_TTIs can be for ULSCH and SRS. { LOG_I(NR_MAC, "Melissa, we added UL_TTI_REQ to queue for sfn slot %d %d\n", ul_tti_request->SFN, ul_tti_request->Slot); @@ -746,6 +747,27 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea } } } + /* TODO: This indicates that dl_tti_req was late or never arrived. If there are + not any prepared uci indications, the NRUE likely never had time to + populate the message is the dl_tti_req came in late and we received a + ul_tti_req immediately after the dl_tti_request. This is an attempt to + mitigate proxy timing issues. */ + else if (nr_uci_ind_queue.num_items == 0) + { + LOG_I(NR_MAC, "Melissa, we added UL_TTI_REQ to queue for sfn slot %d %d\n", + ul_tti_request->SFN, ul_tti_request->Slot); + if (!put_queue(&nr_wait_ul_tti_req_queue, ul_tti_request)) + { + reset_queue(&nr_wait_ul_tti_req_queue); + if (!put_queue(&nr_wait_ul_tti_req_queue, ul_tti_request)) + { + LOG_E(NR_PHY, "put_queue failed for nr_wait_ul_tti_req_queue.\n"); + free(ul_tti_request); + ul_tti_request = NULL; + } + } + } + break; } diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index a5ce7c926d..8fec4c002e 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2894,6 +2894,7 @@ static void start_oai_nrue_threads() init_queue(&nr_tx_req_queue); init_queue(&nr_ul_dci_req_queue); init_queue(&nr_ul_tti_req_queue); + init_queue(&nr_wait_ul_tti_req_queue); if (sem_init(&sfn_slot_semaphore, 0, 0) != 0) { diff --git a/openair2/RRC/NR_UE/rrc_proto.h b/openair2/RRC/NR_UE/rrc_proto.h index f5178f469f..2abc680943 100644 --- a/openair2/RRC/NR_UE/rrc_proto.h +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -50,6 +50,7 @@ extern queue_t nr_dl_tti_req_queue; extern queue_t nr_tx_req_queue; extern queue_t nr_ul_dci_req_queue; extern queue_t nr_ul_tti_req_queue; +extern queue_t nr_wait_ul_tti_req_queue; // // main_rrc.c // From 455e3d83439ed4f48a174ae34363aa7a86057af2 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 28 Oct 2021 08:14:20 -0700 Subject: [PATCH 23/32] This commit gets rid of sfn_slot sleep In the previous commit, the NRUE would record the time it received a slot and compare this rx time to the next slot. If the next slot came in before it had been 500us, the NRUE would sleep a delta amount to make the duration between the two slot indications 500 us. This change complicated the code and did not improve the performance so it was removed. Furthermore, this commit removes the old queueing mechanism of the slot indications and uses calloc rather than an array. --- executables/nr-ue.c | 37 ++++++---------- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 5 --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 49 +++++---------------- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h | 1 - 4 files changed, 24 insertions(+), 68 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 2782f874c2..cca7c4d9cd 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -265,7 +265,7 @@ static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot) nfapi_nr_dl_tti_request_t *dl_tti_request = get_queue(&nr_dl_tti_req_queue); nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue); - LOG_D(NR_MAC, "Try to get a ul_tti_req for sfn/slot %d %d from queue with %d items\n", + LOG_D(NR_MAC, "Try to get a ul_tti_req for sfn/slot %d %d from queue with %lu items\n", NFAPI_SFNSLOT2SFN(mac->active_harq_sfn_slot),NFAPI_SFNSLOT2SLOT(mac->active_harq_sfn_slot), nr_ul_tti_req_queue.num_items); nfapi_nr_ul_tti_request_t *ul_tti_request = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->active_harq_sfn_slot); if (!ul_tti_request) @@ -394,9 +394,6 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) NR_UL_TIME_ALIGNMENT_t ul_time_alignment; memset(&ul_time_alignment, 0, sizeof(ul_time_alignment)); int last_sfn_slot = -1; - int sfn_slot; - uint64_t last_time_stamp = 0; - sfn_slot_info_t *sfn_slot_info; while (!oai_exit) { @@ -405,32 +402,26 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) LOG_E(NR_MAC, "sem_wait() error\n"); abort(); } - sfn_slot_info = get_queue(&nr_sfn_slot_queue); - if (sfn_slot_info == NULL) + + uint16_t *sfn_slot = get_queue(&nr_sfn_slot_queue); + if (sfn_slot == NULL) { LOG_D(MAC, "get_queue(&nr_sfn_slot_queue) == NULL!\n"); continue; } - sfn_slot = sfn_slot_info->sfn_slot; - if (sfn_slot == last_sfn_slot) + frame_t frame = NFAPI_SFNSLOT2SFN(*sfn_slot); + int slot = NFAPI_SFNSLOT2SLOT(*sfn_slot); + if (*sfn_slot == last_sfn_slot) { LOG_D(NR_MAC, "repeated sfn_sf = %d.%d\n", - sfn_slot >> 6, sfn_slot & 0x3F); + frame, slot); continue; } - last_sfn_slot = sfn_slot; - LOG_D(NR_MAC, "The received sfn/slot [%d %d], last time stamp %ld, current time stamp %ld\n", - NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot), last_time_stamp, sfn_slot_info->time_stamp); + last_sfn_slot = *sfn_slot; - uint64_t delta = sfn_slot_info->time_stamp - last_time_stamp; - if (delta < 500) - { - LOG_D(NR_MAC, "sfn/slot [%d %d] has been received too quickly! Delta = %ld. Will sleep for %ld us\n", - NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot), delta, 500 - delta); - usleep(500 - delta); - } - last_time_stamp = sfn_slot_info->time_stamp; + LOG_D(NR_MAC, "The received sfn/slot [%d %d] from proxy\n", + frame, slot); module_id_t mod_id = 0; NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); @@ -443,8 +434,6 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) mac->ra.generate_nr_prach = 0; int CC_id = 0; uint8_t gNB_id = 0; - frame_t frame = NFAPI_SFNSLOT2SFN(sfn_slot); - int slot = NFAPI_SFNSLOT2SLOT(sfn_slot); nr_uplink_indication_t ul_info; int slots_per_frame = 20; //30 kHZ subcarrier spacing int slot_ahead = 2; // TODO: Make this dynamic @@ -479,7 +468,9 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) nr_ue_ul_indication(&ul_info); check_nr_prach(mac, &ul_info, &prach_resources); } - process_queued_nr_nfapi_msgs(mac, sfn_slot); + process_queued_nr_nfapi_msgs(mac, *sfn_slot); + free(sfn_slot); + sfn_slot = NULL; } return NULL; } diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index bd612c81cd..8f3c1526e5 100755 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -443,11 +443,6 @@ typedef struct { } NR_UE_MAC_INST_t; -typedef struct sfn_slot_info { - uint16_t sfn_slot; - uint64_t time_stamp; -} sfn_slot_info_t; - typedef enum seach_space_mask_e { type0_pdcch = 0x1, type0a_pdcch = 0x2, diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index dafffbc9cc..681c72a1ae 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -52,7 +52,6 @@ static nr_ue_if_module_t *nr_ue_if_module_inst[MAX_IF_MODULES]; static int ue_tx_sock_descriptor = -1; static int ue_rx_sock_descriptor = -1; static int g_harq_pid; -int current_sfn_slot; sem_t sfn_slot_semaphore; queue_t nr_sfn_slot_queue; @@ -789,18 +788,6 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea return; } -static uint64_t clock_usec() -{ - struct timespec t; - if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) - { - abort(); - } - return (uint64_t)t.tv_sec * 1000000 + (t.tv_nsec / 1000); -} - -sfn_slot_info_t sfn_slot_pool[512]; -uint16_t sfn_slot_id; void *nrue_standalone_pnf_task(void *context) { struct sockaddr_in server_address; @@ -809,9 +796,6 @@ void *nrue_standalone_pnf_task(void *context) assert(sd > 0); char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - int sfn = 0; - int slot = 0; - LOG_I(NR_RRC, "Successfully started %s.\n", __FUNCTION__); @@ -830,24 +814,17 @@ void *nrue_standalone_pnf_task(void *context) } if (len == sizeof(uint16_t)) { - uint16_t sfn_slot = 0; - memcpy((void *)&sfn_slot, buffer, sizeof(sfn_slot)); - current_sfn_slot = sfn_slot; + uint16_t *sfn_slot = CALLOC(1, sizeof(*sfn_slot)); + memcpy(sfn_slot, buffer, sizeof(*sfn_slot)); - sfn_slot_pool[sfn_slot_id].sfn_slot = sfn_slot; - sfn_slot_pool[sfn_slot_id].time_stamp = clock_usec(); - sfn = NFAPI_SFNSLOT2SFN(sfn_slot); - slot = NFAPI_SFNSLOT2SLOT(sfn_slot); - LOG_I(NR_PHY, "Received from proxy sfn %d slot %d and time_stamp = %ld\n", - sfn, slot, sfn_slot_pool[sfn_slot_id].time_stamp); + LOG_I(NR_PHY, "Received from proxy sfn %d slot %d\n", + NFAPI_SFNSLOT2SFN(*sfn_slot), NFAPI_SFNSLOT2SLOT(*sfn_slot)); - if (!put_queue(&nr_sfn_slot_queue, &sfn_slot_pool[sfn_slot_id])) + if (!put_queue(&nr_sfn_slot_queue, sfn_slot)) { LOG_E(NR_PHY, "put_queue failed for sfn slot.\n"); } - sfn_slot_id = (sfn_slot_id + 1) % 512; - if (sem_post(&sfn_slot_semaphore) != 0) { LOG_E(NR_PHY, "sem_post() error\n"); @@ -856,28 +833,22 @@ void *nrue_standalone_pnf_task(void *context) } else if (len == sizeof(nr_phy_channel_params_t)) { - nr_phy_channel_params_t ch_info; - memcpy(&ch_info, buffer, sizeof(nr_phy_channel_params_t)); - current_sfn_slot = ch_info.sfn_slot; + nr_phy_channel_params_t *ch_info = CALLOC(1, sizeof(*ch_info)); + memcpy(ch_info, buffer, sizeof(*ch_info)); - sfn_slot_pool[sfn_slot_id].sfn_slot = ch_info.sfn_slot; - sfn_slot_pool[sfn_slot_id].time_stamp = clock_usec(); + LOG_I(NR_PHY, "Received_SINR = %f, sfn:slot %d:%d\n", + ch_info->sinr, NFAPI_SFNSLOT2SFN(ch_info->sfn_slot), NFAPI_SFNSLOT2SLOT(ch_info->sfn_slot)); - if (!put_queue(&nr_sfn_slot_queue, &sfn_slot_pool[sfn_slot_id])) + if (!put_queue(&nr_sfn_slot_queue, ch_info)) { LOG_E(NR_PHY, "put_queue failed for sfn slot.\n"); } - sfn_slot_id = (sfn_slot_id + 1) % 512; - if (sem_post(&sfn_slot_semaphore) != 0) { LOG_E(MAC, "sem_post() error\n"); abort(); } - sfn = NFAPI_SFNSLOT2SFN(ch_info.sfn_slot); - slot = NFAPI_SFNSLOT2SLOT(ch_info.sfn_slot); - LOG_I(NR_PHY, "Received_SINR = %f, sfn:slot %d:%d\n", ch_info.sinr, sfn, slot); } else { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h index 2bd1888c18..37771282c0 100755 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h @@ -223,7 +223,6 @@ nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id); void nrue_init_standalone_socket(int tx_port, int rx_port); void *nrue_standalone_pnf_task(void *context); -extern int current_sfn_slot; extern sem_t sfn_slot_semaphore; typedef struct nfapi_dl_tti_config_req_tx_data_req_t From 66144698c78e1930a0dd3c10a3b3d575b765e243 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 28 Oct 2021 08:51:09 -0700 Subject: [PATCH 24/32] Reverting log and white space changes for MR --- nfapi/open-nFAPI/nfapi/inc/nfapi.h | 2 +- nfapi/open-nFAPI/nfapi/src/nfapi.c | 2 +- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 1 + openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 4 ++-- openair1/SCHED_NR/fapi_nr_l1.c | 10 +++++----- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 2 +- openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h | 2 ++ openair2/LAYER2/NR_MAC_UE/mac_extern.h | 2 ++ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 2 +- 9 files changed, 16 insertions(+), 11 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/inc/nfapi.h b/nfapi/open-nFAPI/nfapi/inc/nfapi.h index 05db920035..0f09efa78a 100644 --- a/nfapi/open-nFAPI/nfapi/inc/nfapi.h +++ b/nfapi/open-nFAPI/nfapi/inc/nfapi.h @@ -50,7 +50,7 @@ uint32_t pullarrays32(uint8_t **in, int32_t out[], uint32_t max_len, uint32_t le uint32_t pusharray8(uint8_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); uint32_t pusharray16(uint16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); uint32_t pusharrays16(int16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); -uint32_t pusharray32(uint32_t in[], uint32_t max_len, uint16_t len, uint8_t **out, uint8_t *end); +uint32_t pusharray32(uint32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); uint32_t pusharrays32(int32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); typedef uint8_t (*pack_array_elem_fn)(void* elem, uint8_t **ppWritePackedMsg, uint8_t *end); diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi.c b/nfapi/open-nFAPI/nfapi/src/nfapi.c index 37bb648e2b..2783781e2c 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi.c @@ -363,7 +363,7 @@ uint32_t pullarrays32(uint8_t **in, int32_t out[], uint32_t max_len, uint32_t le return 0; } } -uint32_t pusharray32(uint32_t in[], uint32_t max_len, uint16_t len, uint8_t **out, uint8_t *end) { +uint32_t pusharray32(uint32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) { if(len == 0) return 1; diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index b0ff94e684..15ac90aae2 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -3303,6 +3303,7 @@ static uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uin { if (!pack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppWritePackedMsg, end)) return 0; + } return 1; diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 80eb274812..8bbf569814 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -429,7 +429,7 @@ void nr_processULSegment(void* arg) { if (check_crc((uint8_t*)llrProcBuf,length_dec,ulsch_harq->F,crc_type)) { #ifdef PRINT_CRC_CHECK - LOG_I(PHY, "Segment %d CRC OK\n",r); + LOG_I(PHY, "Segment %d CRC OK, iterations %d/%d\n",r,no_iteration_ldpc,max_ldpc_iterations); #endif rdata->decodeIterations = no_iteration_ldpc; if (rdata->decodeIterations > p_decoderParms->numMaxIter) rdata->decodeIterations--; @@ -522,7 +522,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, A = (harq_process->TBS)<<3; - LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d\n",harq_pid,A,G, mcs, n_layers, nb_rb, Qm, n_layers); + LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d, Coderate %d\n",harq_pid,A,G, mcs, n_layers, nb_rb, Qm, n_layers, R); if (R<1024) Coderate = (float) R /(float) 1024; diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index accff2fba4..782c707857 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -159,11 +159,11 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ res = pullTpool(gNB->resp_L1_tx, gNB->threadPool); processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); if (DL_req != NULL && TX_req!=NULL && (number_dl_pdu > 0 || number_ul_dci_pdu > 0 || number_ul_tti_pdu > 0)) - LOG_D(NR_PHY,"NFAPI: Sched_INFO:SFN/SLOT:%04d/%d DL_req:SFN/SLO:%04d/%d:dl_pdu:%d tx_req:SFN/SLOT:%04d/%d:pdus:%d;ul_dci %d ul_tti %d\n", - frame,slot, - DL_req->SFN,DL_req->Slot,number_dl_pdu, - TX_req->SFN,TX_req->Slot,TX_req->Number_of_PDUs, - number_ul_dci_pdu,number_ul_tti_pdu); + LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SLOT:%04d/%d DL_req:SFN/SLO:%04d/%d:dl_pdu:%d tx_req:SFN/SLOT:%04d/%d:pdus:%d;ul_dci %d ul_tti %d\n", + frame,slot, + DL_req->SFN,DL_req->Slot,number_dl_pdu, + TX_req->SFN,TX_req->Slot,TX_req->Number_of_PDUs, + number_ul_dci_pdu,number_ul_tti_pdu); int pdcch_received=0; msgTx->num_pdsch_slot=0; diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index c402884ff9..c2ae84963b 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -91,7 +91,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response memcpy(rx_ind->pdu_list[j].pdu, tx_req_body->pdu, tx_req_body->pdu_length * sizeof(*rx_ind->pdu_list[j].pdu)); rx_ind->pdu_list[j].rnti = pusch_config_pdu->rnti; rx_ind->pdu_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance; - rx_ind->pdu_list[j].ul_cqi = 255; // scheduled_response->tx_request->tx_config.ul_cqi; + rx_ind->pdu_list[j].ul_cqi = scheduled_response->tx_request->tx_config.ul_cqi; char buffer[1024]; hexdump(rx_ind->pdu_list[j].pdu, rx_ind->pdu_list[j].pdu_length, buffer, sizeof(buffer)); LOG_D(NR_MAC, "Hexdump of pdu %s before queuing rx_ind\n", diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h index 5b4ebe2397..f81e15d5fd 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h @@ -39,6 +39,8 @@ extern const uint8_t nr_slots_per_frame[5]; +extern dci_pdu_rel15_t *def_dci_pdu_rel15; + /* extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE]; extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE]; extern const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_extern.h b/openair2/LAYER2/NR_MAC_UE/mac_extern.h index 7959b07694..7fd63666f0 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_extern.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_extern.h @@ -66,6 +66,8 @@ extern const uint8_t table_7_3_2_3_3_4_twoCodeword[6][10]; extern const uint16_t table_7_2_1[16]; +extern dci_pdu_rel15_t *def_dci_pdu_rel15; + extern void mac_rlc_data_ind(const module_id_t module_idP, const rnti_t rntiP, const eNB_index_t eNB_index, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 86524afe29..5df7e3d707 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1315,7 +1315,7 @@ int nr_acknack_scheduling(int mod_id, while (i < 8) { LOG_D(NR_MAC,"pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n", i,pdsch_to_harq_feedback[i],pucch->ul_slot,slot); - if (pdsch_to_harq_feedback[i] == (pucch->ul_slot - slot) % n_slots_frame) { + if (pdsch_to_harq_feedback[i] == pucch->ul_slot - slot) { ind_found = i; break; } From fa810fab70329524ecd791d073cde6c84c12ad4a Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 28 Oct 2021 08:58:36 -0700 Subject: [PATCH 25/32] Accounting for wrap in slot comparison in gNB --- executables/nr-ue.c | 5 ++++- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 1 - openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index cca7c4d9cd..d409ec0d4a 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -458,7 +458,10 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) mac->dl_info.dci_ind = NULL; mac->dl_info.rx_ind = NULL; - nr_ue_dl_indication(&mac->dl_info, &ul_time_alignment); + if (is_nr_DL_slot(mac->scc->tdd_UL_DL_ConfigurationCommon, ul_info.slot_rx)) + { + nr_ue_dl_indication(&mac->dl_info, &ul_time_alignment); + } if (pthread_mutex_unlock(&mac->mutex_dl_info)) abort(); diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 8f3c1526e5..ce1f5fe1af 100755 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -434,7 +434,6 @@ typedef struct { // Defined for abstracted mode nr_downlink_indication_t dl_info; NR_UE_HARQ_STATUS_t dl_harq_info[16]; - bool expected_dci; bool index_has_dci[16]; int active_harq_sfn_slot; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 5df7e3d707..932a49418e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1268,7 +1268,7 @@ int nr_acknack_scheduling(int mod_id, // Find the right timing_indicator value. int i = 0; while (i < 8) { - if (pdsch_to_harq_feedback[i] == pucch->ul_slot - slot) + if (pdsch_to_harq_feedback[i] == (pucch->ul_slot - slot) % n_slots_frame) break; ++i; } @@ -1315,7 +1315,7 @@ int nr_acknack_scheduling(int mod_id, while (i < 8) { LOG_D(NR_MAC,"pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n", i,pdsch_to_harq_feedback[i],pucch->ul_slot,slot); - if (pdsch_to_harq_feedback[i] == pucch->ul_slot - slot) { + if (pdsch_to_harq_feedback[i] == (pucch->ul_slot - slot) % n_slots_frame) { ind_found = i; break; } From cfb49c17d2974aff98119059cdbcc09998537469 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 28 Oct 2021 10:32:28 -0700 Subject: [PATCH 26/32] Added a seprate queue for chan_params --- executables/nr-ue.c | 33 +++++++++++++-------- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 3 +- openair2/RRC/NR_UE/rrc_UE.c | 1 + openair2/RRC/NR_UE/rrc_proto.h | 1 + 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index d409ec0d4a..889fa55058 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -394,6 +394,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) NR_UL_TIME_ALIGNMENT_t ul_time_alignment; memset(&ul_time_alignment, 0, sizeof(ul_time_alignment)); int last_sfn_slot = -1; + uint16_t sfn_slot = 0; while (!oai_exit) { @@ -402,23 +403,29 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) LOG_E(NR_MAC, "sem_wait() error\n"); abort(); } - - uint16_t *sfn_slot = get_queue(&nr_sfn_slot_queue); - if (sfn_slot == NULL) + uint16_t *slot_ind = get_queue(&nr_sfn_slot_queue); + nr_phy_channel_params_t *ch_info = get_queue(&nr_chan_param_queue); + if (!slot_ind && !ch_info) { - LOG_D(MAC, "get_queue(&nr_sfn_slot_queue) == NULL!\n"); - continue; + LOG_D(MAC, "get nr_sfn_slot_queue and nr_chan_param_queue == NULL!\n"); + continue; + } + if (slot_ind) { + sfn_slot = *slot_ind; + } + else if (ch_info) { + sfn_slot = ch_info->sfn_slot; } - frame_t frame = NFAPI_SFNSLOT2SFN(*sfn_slot); - int slot = NFAPI_SFNSLOT2SLOT(*sfn_slot); - if (*sfn_slot == last_sfn_slot) + frame_t frame = NFAPI_SFNSLOT2SFN(sfn_slot); + int slot = NFAPI_SFNSLOT2SLOT(sfn_slot); + if (sfn_slot == last_sfn_slot) { LOG_D(NR_MAC, "repeated sfn_sf = %d.%d\n", frame, slot); continue; } - last_sfn_slot = *sfn_slot; + last_sfn_slot = sfn_slot; LOG_D(NR_MAC, "The received sfn/slot [%d %d] from proxy\n", frame, slot); @@ -471,9 +478,11 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) nr_ue_ul_indication(&ul_info); check_nr_prach(mac, &ul_info, &prach_resources); } - process_queued_nr_nfapi_msgs(mac, *sfn_slot); - free(sfn_slot); - sfn_slot = NULL; + process_queued_nr_nfapi_msgs(mac, sfn_slot); + free(slot_ind); + slot_ind = NULL; + free(ch_info); + ch_info = NULL; } return NULL; } diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 681c72a1ae..bd452b6513 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -55,6 +55,7 @@ static int g_harq_pid; sem_t sfn_slot_semaphore; queue_t nr_sfn_slot_queue; +queue_t nr_chan_param_queue; queue_t nr_dl_tti_req_queue; queue_t nr_tx_req_queue; queue_t nr_ul_dci_req_queue; @@ -839,7 +840,7 @@ void *nrue_standalone_pnf_task(void *context) LOG_I(NR_PHY, "Received_SINR = %f, sfn:slot %d:%d\n", ch_info->sinr, NFAPI_SFNSLOT2SFN(ch_info->sfn_slot), NFAPI_SFNSLOT2SLOT(ch_info->sfn_slot)); - if (!put_queue(&nr_sfn_slot_queue, ch_info)) + if (!put_queue(&nr_chan_param_queue, ch_info)) { LOG_E(NR_PHY, "put_queue failed for sfn slot.\n"); } diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 1636ee5b24..6a45794e16 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2774,6 +2774,7 @@ static void start_oai_nrue_threads() init_queue(&nr_crc_ind_queue); init_queue(&nr_uci_ind_queue); init_queue(&nr_sfn_slot_queue); + init_queue(&nr_chan_param_queue); init_queue(&nr_dl_tti_req_queue); init_queue(&nr_tx_req_queue); init_queue(&nr_ul_dci_req_queue); diff --git a/openair2/RRC/NR_UE/rrc_proto.h b/openair2/RRC/NR_UE/rrc_proto.h index 6b3e81a3a9..3c074b04ef 100644 --- a/openair2/RRC/NR_UE/rrc_proto.h +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -46,6 +46,7 @@ extern queue_t nr_rx_ind_queue; extern queue_t nr_crc_ind_queue; extern queue_t nr_uci_ind_queue; extern queue_t nr_sfn_slot_queue; +extern queue_t nr_chan_param_queue; extern queue_t nr_dl_tti_req_queue; extern queue_t nr_tx_req_queue; extern queue_t nr_ul_dci_req_queue; From 30075501502b121a213dffa184fe81eb5e4e26dc Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 28 Oct 2021 11:14:47 -0700 Subject: [PATCH 27/32] Updating DCI configuration to avoid seg fault --- openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c | 8 +++----- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 10 ---------- 2 files changed, 3 insertions(+), 15 deletions(-) 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 c3aaf87844..a1056a2f71 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c @@ -259,6 +259,9 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl //NR_ServingCellConfig_t *scd = mac->scg->spCellConfig->spCellConfigDedicated; NR_BWP_DownlinkDedicated_t *bwpd = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Dedicated : mac->cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; NR_BWP_DownlinkCommon_t *bwp_Common = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Common : &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP; + fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15; + NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon; + struct NR_PhysicalCellGroupConfig *phy_cgc = (mac->cg) ? mac->cg->physicalCellGroupConfig : NULL; LOG_D(NR_MAC, "[DCI_CONFIG] ra_rnti %p (%x) crnti %p (%x) t_crnti %p (%x)\n", &ra->ra_rnti, ra->ra_rnti, &mac->crnti, mac->crnti, &ra->t_crnti, ra->t_crnti); @@ -267,9 +270,6 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl for (ss_id = 0; ss_id < FAPI_NR_MAX_SS_PER_CORESET && mac->SSpace[bwp_id][coreset_id - 1][ss_id] != NULL; ss_id++){ LOG_D(NR_MAC, "[DCI_CONFIG] ss_id %d\n",ss_id); NR_SearchSpace_t *ss = mac->SSpace[bwp_id][coreset_id - 1][ss_id]; - fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15; - NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon; - struct NR_PhysicalCellGroupConfig *phy_cgc = mac->cg->physicalCellGroupConfig; switch (ss->searchSpaceType->present){ case NR_SearchSpace__searchSpaceType_PR_common: // this is for CSSs, we use BWP common and pdcch_ConfigCommon @@ -414,8 +414,6 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl } // Search space 0, CORESET ID 0 - NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon; - if (pdcch_ConfigCommon && pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 && !get_softmodem_params()->nsa) { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index bd452b6513..ed33aa58f9 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -617,16 +617,6 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, { nr_ue_ul_indication(&ul_info); } - - - #if 0 // TODO: Heap use after free caught by sanitizer - free(dl_info.dci_ind); - dl_info.dci_ind = NULL; - - free(dl_info.rx_ind); - dl_info.rx_ind = NULL; - #endif - } void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request) From 26ddb9eabe3a3168c1b917b3056211eed7ad74ee Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 28 Oct 2021 11:58:01 -0700 Subject: [PATCH 28/32] Only do LTE channel modelling in LTE mode, not NSA --- openair2/PHY_INTERFACE/phy_stub_UE.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index 9876f4a4a7..b70745464e 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -37,6 +37,7 @@ #include "openair1/PHY/defs_gNB.h" #include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h" #include "openair1/PHY/LTE_TRANSPORT/transport_common.h" +#include "softmodem-common.h" extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind); void configure_nfapi_pnf(char *vnf_ip_addr, @@ -2061,7 +2062,7 @@ static inline bool is_channel_modeling(void) { /* TODO: For now we enable channel modeling based on the node_number. Replace with a command line option to enable/disable channel modeling. */ - return node_number == 0; + return node_number == 0 && !get_softmodem_params()->nsa; } static bool should_drop_transport_block(int sf, uint16_t rnti) From 733279689f5d119f5cb7dacd9cc0da9440bc799b Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 28 Oct 2021 15:02:14 -0700 Subject: [PATCH 29/32] Fixing white space and added a TODO comment --- executables/nr-ue.c | 4 ++-- openair2/PHY_INTERFACE/phy_stub_UE.c | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 889fa55058..fc69cf2722 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -407,8 +407,8 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) nr_phy_channel_params_t *ch_info = get_queue(&nr_chan_param_queue); if (!slot_ind && !ch_info) { - LOG_D(MAC, "get nr_sfn_slot_queue and nr_chan_param_queue == NULL!\n"); - continue; + LOG_D(MAC, "get nr_sfn_slot_queue and nr_chan_param_queue == NULL!\n"); + continue; } if (slot_ind) { sfn_slot = *slot_ind; diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index b70745464e..1598e3d620 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -2061,7 +2061,11 @@ static float get_bler_val(uint8_t mcs, int sinr) static inline bool is_channel_modeling(void) { /* TODO: For now we enable channel modeling based on the node_number. - Replace with a command line option to enable/disable channel modeling. */ + Replace with a command line option to enable/disable channel modeling. + The LTE UE will crash when channel modeling is conducted for NSA + mode. It does not crash for LTE mode. We have not implemented channel + modeling for NSA mode yet. For now, we ensure only do do chanel modeling + in LTE mode. */ return node_number == 0 && !get_softmodem_params()->nsa; } From 04251e84bed0c9138f118e7b483c4b879ea1cddf Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 29 Oct 2021 13:51:58 -0700 Subject: [PATCH 30/32] Removing name from log and demoting log --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index ed33aa58f9..cab2cc4863 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -734,7 +734,7 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea ul_tti_request->SFN, ul_tti_request->Slot); if (nr_uci_ind_queue.num_items > 0) //TODO: In the future UL_TTIs can be for ULSCH and SRS. { - LOG_I(NR_MAC, "Melissa, we added UL_TTI_REQ to queue for sfn slot %d %d\n", + LOG_D(NR_MAC, "We added UL_TTI_REQ to queue for sfn slot %d %d\n", ul_tti_request->SFN, ul_tti_request->Slot); if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) { @@ -754,7 +754,7 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea mitigate proxy timing issues. */ else if (nr_uci_ind_queue.num_items == 0) { - LOG_I(NR_MAC, "Melissa, we added UL_TTI_REQ to queue for sfn slot %d %d\n", + LOG_D(NR_MAC, "We added UL_TTI_REQ to queue for sfn slot %d %d\n", ul_tti_request->SFN, ul_tti_request->Slot); if (!put_queue(&nr_wait_ul_tti_req_queue, ul_tti_request)) { From 7825350905997b3e9412cfd4b048b3d10c1c0f94 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 1 Nov 2021 16:24:59 -0700 Subject: [PATCH 31/32] Fixing merge request comments --- openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c | 8 +++++--- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 12 +++++------- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 10 +++------- 3 files changed, 13 insertions(+), 17 deletions(-) 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 a1056a2f71..c3aaf87844 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c @@ -259,9 +259,6 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl //NR_ServingCellConfig_t *scd = mac->scg->spCellConfig->spCellConfigDedicated; NR_BWP_DownlinkDedicated_t *bwpd = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Dedicated : mac->cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; NR_BWP_DownlinkCommon_t *bwp_Common = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Common : &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP; - fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15; - NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon; - struct NR_PhysicalCellGroupConfig *phy_cgc = (mac->cg) ? mac->cg->physicalCellGroupConfig : NULL; LOG_D(NR_MAC, "[DCI_CONFIG] ra_rnti %p (%x) crnti %p (%x) t_crnti %p (%x)\n", &ra->ra_rnti, ra->ra_rnti, &mac->crnti, mac->crnti, &ra->t_crnti, ra->t_crnti); @@ -270,6 +267,9 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl for (ss_id = 0; ss_id < FAPI_NR_MAX_SS_PER_CORESET && mac->SSpace[bwp_id][coreset_id - 1][ss_id] != NULL; ss_id++){ LOG_D(NR_MAC, "[DCI_CONFIG] ss_id %d\n",ss_id); NR_SearchSpace_t *ss = mac->SSpace[bwp_id][coreset_id - 1][ss_id]; + fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15; + NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon; + struct NR_PhysicalCellGroupConfig *phy_cgc = mac->cg->physicalCellGroupConfig; switch (ss->searchSpaceType->present){ case NR_SearchSpace__searchSpaceType_PR_common: // this is for CSSs, we use BWP common and pdcch_ConfigCommon @@ -414,6 +414,8 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl } // Search space 0, CORESET ID 0 + NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon; + if (pdcch_ConfigCommon && pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 && !get_softmodem_params()->nsa) { diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 50d1bd6c92..f5a7e8b0cd 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -153,15 +153,13 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) switch (uci_list[i].pdu_type) { case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: if (uci_list[i].pucch_pdu_format_0_1.harq) { - free(uci_list[i].pucch_pdu_format_0_1.harq->harq_list); - uci_list[i].pucch_pdu_format_0_1.harq->harq_list = NULL; + free(uci_list[i].pucch_pdu_format_0_1.harq->harq_list); + uci_list[i].pucch_pdu_format_0_1.harq->harq_list = NULL; + } free(uci_list[i].pucch_pdu_format_0_1.harq); uci_list[i].pucch_pdu_format_0_1.harq = NULL; - } - if (uci_list[i].pucch_pdu_format_0_1.sr) { - free(uci_list[i].pucch_pdu_format_0_1.sr); - uci_list[i].pucch_pdu_format_0_1.sr = NULL; - } + free(uci_list[i].pucch_pdu_format_0_1.sr); + uci_list[i].pucch_pdu_format_0_1.sr = NULL; break; case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index cab2cc4863..c2d7e341bf 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -738,13 +738,9 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea ul_tti_request->SFN, ul_tti_request->Slot); if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) { - reset_queue(&nr_ul_tti_req_queue); - if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) - { - LOG_E(NR_PHY, "put_queue failed for ul_tti_request.\n"); - free(ul_tti_request); - ul_tti_request = NULL; - } + LOG_E(NR_PHY, "put_queue failed for ul_tti_request.\n"); + free(ul_tti_request); + ul_tti_request = NULL; } } /* TODO: This indicates that dl_tti_req was late or never arrived. If there are From b29fd449d0fa231c87a3c353adc89ed31e631521 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 2 Nov 2021 14:35:32 -0700 Subject: [PATCH 32/32] Changed ul_tti_req queueing mechanism: Instead of resetting queue when full, take last item out. --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 13 ++-------- openair2/PHY_INTERFACE/queue.c | 28 +++++++++++++++++++++ openair2/PHY_INTERFACE/queue.h | 1 + 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index c2d7e341bf..9dc6cf918f 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -752,18 +752,9 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea { LOG_D(NR_MAC, "We added UL_TTI_REQ to queue for sfn slot %d %d\n", ul_tti_request->SFN, ul_tti_request->Slot); - if (!put_queue(&nr_wait_ul_tti_req_queue, ul_tti_request)) - { - reset_queue(&nr_wait_ul_tti_req_queue); - if (!put_queue(&nr_wait_ul_tti_req_queue, ul_tti_request)) - { - LOG_E(NR_PHY, "put_queue failed for nr_wait_ul_tti_req_queue.\n"); - free(ul_tti_request); - ul_tti_request = NULL; - } - } + nfapi_nr_ul_tti_request_t *evicted_ul_tti_req = put_queue_replace(&nr_wait_ul_tti_req_queue, ul_tti_request); + free(evicted_ul_tti_req); } - break; } diff --git a/openair2/PHY_INTERFACE/queue.c b/openair2/PHY_INTERFACE/queue.c index c6e1fb6d2f..d837857ac7 100644 --- a/openair2/PHY_INTERFACE/queue.c +++ b/openair2/PHY_INTERFACE/queue.c @@ -25,6 +25,34 @@ void reset_queue(queue_t *q) } } +void *put_queue_replace(queue_t *q, void *item) +{ + assert(item != NULL); + if (pthread_mutex_lock(&q->mutex) != 0) + { + LOG_ERROR("put_queue: mutex_lock failed"); + return false; + } + + void *evicted = NULL; + if (q->num_items >= MAX_QUEUE_SIZE) + { + evicted = q->items[q->read_index]; + assert(evicted != NULL); + q->items[q->read_index] = NULL; + q->read_index = (q->read_index + 1) % MAX_QUEUE_SIZE; + q->num_items--; + } + assert(q->items[q->write_index] == NULL); + q->items[q->write_index] = item; + q->write_index = (q->write_index + 1) % MAX_QUEUE_SIZE; + q->num_items++; + + pthread_mutex_unlock(&q->mutex); + return evicted; +} + + bool put_queue(queue_t *q, void *item) { assert(item != NULL); diff --git a/openair2/PHY_INTERFACE/queue.h b/openair2/PHY_INTERFACE/queue.h index d274f7b0cd..4678e31030 100644 --- a/openair2/PHY_INTERFACE/queue.h +++ b/openair2/PHY_INTERFACE/queue.h @@ -42,6 +42,7 @@ typedef struct queue_t void init_queue(queue_t *q); void reset_queue(queue_t *q); +void *put_queue_replace(queue_t *q, void *item); bool put_queue(queue_t *q, void *item); void *get_queue(queue_t *q);