From 27a232ab63441c578a3bb2dbb214ad4349e7a963 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 15 Jan 2021 13:42:31 -0800 Subject: [PATCH 1/6] Sending ACK or NACK for uci_harq_ind fix A fix had to be made in the uci_harq indication function in the UE. The uci_harq indicaiton function was not properly checking for dropped packets four subframes back in the UE. --- openair2/PHY_INTERFACE/phy_stub_UE.c | 77 +++++++++++++++++----------- openair2/PHY_INTERFACE/phy_stub_UE.h | 4 +- targets/RT/USER/lte-softmodem.c | 2 + 3 files changed, 52 insertions(+), 31 deletions(-) diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index 118714e1b3..db7c87195e 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -50,12 +50,12 @@ queue_t hi_dci0_req_queue; int current_sfn_sf; sem_t sfn_semaphore; -static sf_rnti_mcs_s sf_rnti_mcs[10]; +static sf_rnti_mcs_s sf_rnti_mcs[NUM_NFPAI_SUBFRAME]; static int ue_tx_sock_descriptor = -1; static int ue_rx_sock_descriptor = -1; -extern nfapi_tx_request_pdu_t* tx_request_pdu[1023][10][10]; +extern nfapi_tx_request_pdu_t* tx_request_pdu[1023][NUM_NFPAI_SUBFRAME][10]; //TODO Melissa check these values //extern int timer_subframe; //extern int timer_frame; @@ -403,8 +403,7 @@ void fill_uci_harq_indication_UE_MAC(int Mod_id, // 2.) if receiving ul_config_req for uci ack/nack or ulsch ack/nak in subframe n // go look to see if dl_config_req (with c-rnti) was received in subframe (n - 4) // 3.) if the answer to #2 is yes then send ACK IF NOT send DTX - - if (drop_tb((subframe+6) % 10, rnti)) // TODO: Handle DTX. Also discuss handling PDCCH + if (check_drop_tb(((subframe+6) % 10), rnti)) // TODO: Handle DTX. Also discuss handling PDCCH { pdu->harq_indication_fdd_rel13.harq_tb_n[0] = 2; LOG_I(PHY, "Setting HARQ No ACK - Channel Model\n"); @@ -799,8 +798,7 @@ void dl_config_req_UE_MAC_dci(int sfn, sfn, sf, dci->pdu_size, dlsch->dlsch_pdu.dlsch_pdu_rel8.pdu_index, tx_req_pdu_list->num_pdus); - - if (!drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) + if (!check_drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) { ue_send_sdu(ue_id, 0, sfn, sf, tx_req_pdu_list->pdus[pdu_index].segments[0].segment_data, @@ -819,8 +817,7 @@ void dl_config_req_UE_MAC_dci(int sfn, for (int ue_id = 0; ue_id < num_ue; ue_id++) { if (UE_mac_inst[ue_id].UE_mode[0] == NOT_SYNCHED) continue; - - if (!drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) + if (!check_drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) { ue_decode_si(ue_id, 0, sfn, 0, tx_req_pdu_list->pdus[pdu_index].segments[0].segment_data, @@ -836,8 +833,7 @@ void dl_config_req_UE_MAC_dci(int sfn, LOG_I(MAC, "%s() Received paging message: sfn/sf:%d.%d\n", __func__, sfn, sf); - - if (!drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) + if (!check_drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) { ue_decode_p(ue_id, 0, sfn, 0, tx_req_pdu_list->pdus[pdu_index].segments[0].segment_data, @@ -867,8 +863,7 @@ void dl_config_req_UE_MAC_dci(int sfn, "%s(): Received RAR, PreambleIndex: %d\n", __func__, UE_mac_inst[ue_id].RA_prach_resources.ra_PreambleIndex); - - if (!drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) + if (!check_drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) { ue_process_rar(ue_id, 0, sfn, ra_rnti, //RA-RNTI @@ -1368,6 +1363,7 @@ void *ue_standalone_pnf_task(void *context) dl_config_req.sfn_sf & 15); dl_config_req_valid = true; + read_channel_param(&dl_config_req, (dl_config_req.sfn_sf & 15)); if (tx_req_valid) { if (dl_config_req.sfn_sf != tx_req.sfn_sf) @@ -1378,7 +1374,6 @@ void *ue_standalone_pnf_task(void *context) tx_req_valid = false; break; } - read_channel_param(&dl_config_req, (dl_config_req.sfn_sf & 15)); enqueue_dl_config_req_tx_req(&dl_config_req, &tx_req); dl_config_req_valid = false; tx_req_valid = false; @@ -1936,6 +1931,7 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) } // Store all rnti and mcs for all pdus + LOG_I(MAC, "Adding MCS and RNTI for sf_rnti_mcs[%d]\n", sf); sf_rnti_mcs[sf].pdu_size = dl_config->dl_config_request_body.number_pdu; for (int n = 0; n < sf_rnti_mcs[sf].pdu_size; n++) { @@ -1944,32 +1940,56 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) } } - int drop_tb(int sf, uint16_t rnti) + int check_drop_tb(int sf, uint16_t rnti) { - int sinr_index = 0; - bool lin_interp = false; - bool skip_search = false; + if (sf_rnti_mcs[sf].pdu_size <= 0) + { + LOG_E(MAC, "%s: sf_rnti_mcs[%d].pdu_size = 0\n", __FUNCTION__, sf); + abort(); + } - assert(sf < 10 && sf >= 0); - - uint8_t mcs = 99; for (int n = 0; n < sf_rnti_mcs[sf].pdu_size; n++) + { + if (sf_rnti_mcs[sf].rnti[n] == rnti) + { + return sf_rnti_mcs[sf].drop_flag[n]; + } + } + LOG_I(MAC, "No matching rnti in sf_rnti_mcs.\n"); + return 0; + } + + void drop_tb(int sf, uint16_t rnti) + { + assert(sf < 10 && sf >= 0); + + if (sf_rnti_mcs[sf].pdu_size <= 0) + { + LOG_E(MAC, "%s: sf_rnti_mcs[%d].pdu_size = 0\n", __FUNCTION__, sf); + } + + uint8_t mcs = 99; + int n = 0; + for (n = 0; n < sf_rnti_mcs[sf].pdu_size; n++) { if (sf_rnti_mcs[sf].rnti[n] == rnti) { mcs = sf_rnti_mcs[sf].mcs[n]; + sf_rnti_mcs[sf].drop_flag[n] = 0; break; } } if (mcs == 99) { - LOG_E(MAC, "NO MCS Found\n"); + LOG_E(MAC, "NO MCS Found. %d = sf_rnti_mcs[%d].mcs[%d] \n", mcs, sf, n); abort(); } - // Loop through bler table to find sinr_index - What if EMANE SINR doesn't match any of the table SINR values?? - //float epsilon = 0.0001; + // Loop through bler table to find sinr_index + int sinr_index = 0; + bool lin_interp = false; + bool skip_search = false; int temp_bler = 0; int temp_sinr = ((int)(sf_rnti_mcs[sf].sinr * 10)); int i; @@ -2003,9 +2023,9 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) { sinr_index = i; lin_interp = true; - break; + break; } - + } if (i >= (bler_data[mcs].length - 1)) { @@ -2028,10 +2048,7 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) if (bler_val <= drop_cutoff) { - return 1; - } - else - { - return 0; + sf_rnti_mcs[sf].drop_flag[n] = 1; } + return; } diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.h b/openair2/PHY_INTERFACE/phy_stub_UE.h index b6f3da8fd5..f2fc8ef68e 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.h +++ b/openair2/PHY_INTERFACE/phy_stub_UE.h @@ -52,6 +52,7 @@ typedef struct uint8_t mcs[256]; float sinr; uint16_t pdu_size; + int drop_flag[256]; } sf_rnti_mcs_s; @@ -200,7 +201,8 @@ const char *dl_pdu_type_to_string(uint8_t pdu_type); const char *ul_pdu_type_to_string(uint8_t pdu_type); void read_channel_param(nfapi_dl_config_request_t * dl_config, int sf); -int drop_tb(int sf, uint16_t rnti); +void drop_tb(int sf, uint16_t rnti); +int check_drop_tb(int sf, uint16_t rnti); extern queue_t dl_config_req_tx_req_queue; extern queue_t ul_config_req_queue; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 929da68d87..2d2b06c645 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -756,6 +756,7 @@ int main ( int argc, char **argv ) LOG_I(ENB_APP,"oai_exit=%d\n",oai_exit); // stop threads + #if 0 //Disable clean up because this tends to crash (and unnecessary) if (RC.nb_inst == 0 || !NODE_IS_CU(node_type)) { if(IS_SOFTMODEM_DOFORMS) end_forms(); @@ -797,6 +798,7 @@ int main ( int argc, char **argv ) } } } + #endif terminate_opt(); logClean(); From 48662ed52060c2bc9c3cf509fa7ae2862ebc9669 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 15 Jan 2021 15:39:09 -0800 Subject: [PATCH 2/6] Fixed uci_harq_ind issue by adding drop_tb call Also updated the spelling of global variable NUM_NFAPI_SUBFRAME --- openair2/PHY_INTERFACE/IF_Module.c | 8 ++++---- openair2/PHY_INTERFACE/IF_Module.h | 14 +++++++------- openair2/PHY_INTERFACE/phy_stub_UE.c | 24 ++++++++++++------------ openair2/PHY_INTERFACE/phy_stub_UE.h | 6 +++--- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index 1800708c0c..b18f4eca37 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -98,7 +98,7 @@ void handle_sr(UL_IND_t *UL_info) { oai_nfapi_sr_indication(&UL_info->sr_ind); } } else if(NFAPI_MODE == NFAPI_MODE_VNF) { - for(uint8_t j = 0; j < NUM_NFPAI_SUBFRAME; j++) { + for(uint8_t j = 0; j < NUM_NFAPI_SUBFRAME; j++) { if(UL_RCC_INFO.sr_ind[j].sr_indication_body.number_of_srs > 0) { for (i=0; imodule_id, @@ -139,7 +139,7 @@ void handle_cqi(UL_IND_t *UL_info) { UL_info->cqi_ind.cqi_indication_body.number_of_cqis=0; } } else if (NFAPI_MODE == NFAPI_MODE_VNF) { - for(uint8_t j = 0; j < NUM_NFPAI_SUBFRAME; j++) { + for(uint8_t j = 0; j < NUM_NFAPI_SUBFRAME; j++) { if(UL_RCC_INFO.cqi_ind[j].cqi_indication_body.number_of_cqis > 0) { for (i=0; imodule_id, @@ -184,7 +184,7 @@ void handle_harq(UL_IND_t *UL_info) { UL_info->harq_ind.harq_indication_body.number_of_harqs = 0; } else if(NFAPI_MODE == NFAPI_MODE_VNF) { - for(uint8_t j = 0; j < NUM_NFPAI_SUBFRAME; j++) { + for(uint8_t j = 0; j < NUM_NFAPI_SUBFRAME; j++) { if(UL_RCC_INFO.harq_ind[j].harq_indication_body.number_of_harqs > 0) { for (int i=0; imodule_id, @@ -227,7 +227,7 @@ void handle_ulsch(UL_IND_t *UL_info) { UL_info->rx_ind.rx_indication_body.number_of_pdus = 0; } } else if(NFAPI_MODE == NFAPI_MODE_VNF) { - for(uint8_t k = 0; k < NUM_NFPAI_SUBFRAME; k++) { + for(uint8_t k = 0; k < NUM_NFAPI_SUBFRAME; k++) { if((UL_RCC_INFO.rx_ind[k].rx_indication_body.number_of_pdus>0) && (UL_RCC_INFO.crc_ind[k].crc_indication_body.number_of_crcs>0)) { for (i=0; ipdu_size, dlsch->dlsch_pdu.dlsch_pdu_rel8.pdu_index, tx_req_pdu_list->num_pdus); - if (!check_drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) + if (!drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) { ue_send_sdu(ue_id, 0, sfn, sf, tx_req_pdu_list->pdus[pdu_index].segments[0].segment_data, @@ -817,7 +817,7 @@ void dl_config_req_UE_MAC_dci(int sfn, for (int ue_id = 0; ue_id < num_ue; ue_id++) { if (UE_mac_inst[ue_id].UE_mode[0] == NOT_SYNCHED) continue; - if (!check_drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) + if (!drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) { ue_decode_si(ue_id, 0, sfn, 0, tx_req_pdu_list->pdus[pdu_index].segments[0].segment_data, @@ -833,7 +833,7 @@ void dl_config_req_UE_MAC_dci(int sfn, LOG_I(MAC, "%s() Received paging message: sfn/sf:%d.%d\n", __func__, sfn, sf); - if (!check_drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) + if (!drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) { ue_decode_p(ue_id, 0, sfn, 0, tx_req_pdu_list->pdus[pdu_index].segments[0].segment_data, @@ -863,7 +863,7 @@ void dl_config_req_UE_MAC_dci(int sfn, "%s(): Received RAR, PreambleIndex: %d\n", __func__, UE_mac_inst[ue_id].RA_prach_resources.ra_PreambleIndex); - if (!check_drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) + if (!drop_tb(sf, dci->dci_dl_pdu.dci_dl_pdu_rel8.rnti)) { ue_process_rar(ue_id, 0, sfn, ra_rnti, //RA-RNTI @@ -1940,7 +1940,7 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) } } - int check_drop_tb(int sf, uint16_t rnti) + bool check_drop_tb(int sf, uint16_t rnti) { if (sf_rnti_mcs[sf].pdu_size <= 0) { @@ -1956,10 +1956,10 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) } } LOG_I(MAC, "No matching rnti in sf_rnti_mcs.\n"); - return 0; + return false; } - void drop_tb(int sf, uint16_t rnti) + bool drop_tb(int sf, uint16_t rnti) { assert(sf < 10 && sf >= 0); @@ -1975,7 +1975,7 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) if (sf_rnti_mcs[sf].rnti[n] == rnti) { mcs = sf_rnti_mcs[sf].mcs[n]; - sf_rnti_mcs[sf].drop_flag[n] = 0; + sf_rnti_mcs[sf].drop_flag[n] = false; break; } } @@ -2048,7 +2048,7 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) if (bler_val <= drop_cutoff) { - sf_rnti_mcs[sf].drop_flag[n] = 1; + sf_rnti_mcs[sf].drop_flag[n] = true; } - return; + return sf_rnti_mcs[sf].drop_flag[n]; } diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.h b/openair2/PHY_INTERFACE/phy_stub_UE.h index f2fc8ef68e..5ee23e0049 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.h +++ b/openair2/PHY_INTERFACE/phy_stub_UE.h @@ -52,7 +52,7 @@ typedef struct uint8_t mcs[256]; float sinr; uint16_t pdu_size; - int drop_flag[256]; + bool drop_flag[256]; } sf_rnti_mcs_s; @@ -201,8 +201,8 @@ const char *dl_pdu_type_to_string(uint8_t pdu_type); const char *ul_pdu_type_to_string(uint8_t pdu_type); void read_channel_param(nfapi_dl_config_request_t * dl_config, int sf); -void drop_tb(int sf, uint16_t rnti); -int check_drop_tb(int sf, uint16_t rnti); +bool drop_tb(int sf, uint16_t rnti); +bool check_drop_tb(int sf, uint16_t rnti); extern queue_t dl_config_req_tx_req_queue; extern queue_t ul_config_req_queue; From a1ec989d4785fb4b91f301072599a04dc31ce1d3 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 18 Jan 2021 11:03:42 -0800 Subject: [PATCH 3/6] Added array index checks and local loop variable --- openair2/PHY_INTERFACE/phy_stub_UE.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index 678a2bda42..b01f7bbab5 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -1948,8 +1948,10 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) abort(); } - for (int n = 0; n < sf_rnti_mcs[sf].pdu_size; n++) + int pdu_size = sf_rnti_mcs[sf].pdu_size; + for (int n = 0; n < pdu_size; n++) { + assert(n < sizeof(sf_rnti_mcs[sf].drop_flag)); if (sf_rnti_mcs[sf].rnti[n] == rnti) { return sf_rnti_mcs[sf].drop_flag[n]; @@ -1970,8 +1972,10 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) uint8_t mcs = 99; int n = 0; - for (n = 0; n < sf_rnti_mcs[sf].pdu_size; n++) + int pdu_size = sf_rnti_mcs[sf].pdu_size; + for (n = 0; n < pdu_size; n++) { + assert(n < sizeof(sf_rnti_mcs[sf].drop_flag) && n < sizeof(sf_rnti_mcs[sf].mcs) && n < sizeof(sf_rnti_mcs[sf].rnti)); if (sf_rnti_mcs[sf].rnti[n] == rnti) { mcs = sf_rnti_mcs[sf].mcs[n]; @@ -2045,10 +2049,12 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) double drop_cutoff = ((double) rand() / (RAND_MAX)); assert(drop_cutoff < 1); + bler_val = 0.6; - if (bler_val <= drop_cutoff) + if (bler_val >= drop_cutoff) { sf_rnti_mcs[sf].drop_flag[n] = true; + LOG_D(MAC, "We are dropping this packet. Bler_val = %f, MCS = %"PRIu8", sf = %d\n", bler_val, sf_rnti_mcs[sf].mcs[n], sf); } return sf_rnti_mcs[sf].drop_flag[n]; } From d0e380da1eae5aedcef002253e917665ba2941a6 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 18 Jan 2021 11:39:03 -0800 Subject: [PATCH 4/6] Updated array index check with macro def in log.h --- common/utils/LOG/log.h | 6 ++++++ openair2/PHY_INTERFACE/phy_stub_UE.c | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index b5c7e1b1ab..27d1fee56d 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -54,6 +54,12 @@ #include "T.h" #include /*----------------------------------------------------------------------------*/ +#include +#ifdef NDEBUG +#warning assert is disabled +#endif +#define NUM_ELEMENTS(ARRAY) (sizeof(ARRAY) / sizeof(ARRAY[0])) +#define CHECK_INDEX(ARRAY, INDEX) assert((INDEX) < NUM_ELEMENTS(ARRAY)) #ifdef __cplusplus extern "C" { diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index b01f7bbab5..39242c36b9 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -1949,9 +1949,10 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) } int pdu_size = sf_rnti_mcs[sf].pdu_size; + CHECK_INDEX(sf_rnti_mcs[sf].rnti, pdu_size); + CHECK_INDEX(sf_rnti_mcs[sf].drop_flag, pdu_size); for (int n = 0; n < pdu_size; n++) { - assert(n < sizeof(sf_rnti_mcs[sf].drop_flag)); if (sf_rnti_mcs[sf].rnti[n] == rnti) { return sf_rnti_mcs[sf].drop_flag[n]; @@ -1973,9 +1974,11 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) uint8_t mcs = 99; int n = 0; int pdu_size = sf_rnti_mcs[sf].pdu_size; + CHECK_INDEX(sf_rnti_mcs[sf].rnti, pdu_size); + CHECK_INDEX(sf_rnti_mcs[sf].mcs, pdu_size); + CHECK_INDEX(sf_rnti_mcs[sf].drop_flag, pdu_size); for (n = 0; n < pdu_size; n++) { - assert(n < sizeof(sf_rnti_mcs[sf].drop_flag) && n < sizeof(sf_rnti_mcs[sf].mcs) && n < sizeof(sf_rnti_mcs[sf].rnti)); if (sf_rnti_mcs[sf].rnti[n] == rnti) { mcs = sf_rnti_mcs[sf].mcs[n]; @@ -2049,7 +2052,7 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) double drop_cutoff = ((double) rand() / (RAND_MAX)); assert(drop_cutoff < 1); - bler_val = 0.6; + bler_val = 0.4; if (bler_val >= drop_cutoff) { From 4a763d14cdf031e905e32c19e29ae76c92cbefe9 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 18 Jan 2021 11:53:04 -0800 Subject: [PATCH 5/6] Utilizing local pdu_size variable --- openair2/PHY_INTERFACE/phy_stub_UE.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index 39242c36b9..f12e205085 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -1942,7 +1942,8 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) bool check_drop_tb(int sf, uint16_t rnti) { - if (sf_rnti_mcs[sf].pdu_size <= 0) + int pdu_size = sf_rnti_mcs[sf].pdu_size; + if (pdu_size <= 0) { LOG_E(MAC, "%s: sf_rnti_mcs[%d].pdu_size = 0\n", __FUNCTION__, sf); abort(); @@ -1964,16 +1965,16 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) bool drop_tb(int sf, uint16_t rnti) { + int pdu_size = sf_rnti_mcs[sf].pdu_size; assert(sf < 10 && sf >= 0); - if (sf_rnti_mcs[sf].pdu_size <= 0) + if (pdu_size <= 0) { LOG_E(MAC, "%s: sf_rnti_mcs[%d].pdu_size = 0\n", __FUNCTION__, sf); } uint8_t mcs = 99; int n = 0; - int pdu_size = sf_rnti_mcs[sf].pdu_size; CHECK_INDEX(sf_rnti_mcs[sf].rnti, pdu_size); CHECK_INDEX(sf_rnti_mcs[sf].mcs, pdu_size); CHECK_INDEX(sf_rnti_mcs[sf].drop_flag, pdu_size); From 80fc9b390846552d3389f7bd4a15b442ed3aa035 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 18 Jan 2021 13:06:57 -0800 Subject: [PATCH 6/6] Removed duplicate def of pdu_size --- openair2/PHY_INTERFACE/phy_stub_UE.c | 1 - 1 file changed, 1 deletion(-) diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index f12e205085..21cd68daf5 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -1949,7 +1949,6 @@ char *nfapi_ul_config_req_to_string(nfapi_ul_config_request_t *req) abort(); } - int pdu_size = sf_rnti_mcs[sf].pdu_size; CHECK_INDEX(sf_rnti_mcs[sf].rnti, pdu_size); CHECK_INDEX(sf_rnti_mcs[sf].drop_flag, pdu_size); for (int n = 0; n < pdu_size; n++)