From fe6d713988a8c1006e6c552291aea9d1826c13ac Mon Sep 17 00:00:00 2001 From: Andrew Burger Date: Fri, 18 Sep 2020 16:58:16 -0700 Subject: [PATCH] Cleaning up merge request --- nfapi/oai_integration/nfapi_vnf.c | 2 +- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 25 ++++------------------ openair2/COMMON/platform_constants.h | 5 ++++- openair2/LAYER2/MAC/eNB_scheduler.c | 2 +- openair2/PHY_INTERFACE/phy_stub_UE.c | 30 ++++----------------------- 5 files changed, 14 insertions(+), 50 deletions(-) diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index b942c06f9f..845fd39daa 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -1280,7 +1280,7 @@ static bool remove_ul_config_req_pdu(int index, nfapi_ul_config_request_t *ul_co return true; } -#define MAX_DROPPED_INDICIES 10 +#define MAX_DROPPED_INDICIES 500 int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config; diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index 5130dd6e63..6fea90f860 100755 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -4960,7 +4960,6 @@ static uint8_t unpack_rx_indication_body_value(void *tlv, uint8_t **ppReadPacked { nfapi_rx_indication_body_t *value = (nfapi_rx_indication_body_t *)tlv; - // the rxBodyEnd points to the end of the cqi PDU's Is this a problem? -Andrew NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s value->tl.length in unpack: %u \n", __FUNCTION__, value->tl.length); uint8_t *rxBodyEnd = *ppReadPackedMsg + value->tl.length; @@ -4972,9 +4971,6 @@ static uint8_t unpack_rx_indication_body_value(void *tlv, uint8_t **ppReadPacked // pdu end is past buffer end return 0; } - char foo[1024]; - // NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s:%d: %s\n", __FUNCTION__, - // __LINE__, hexdump(*ppReadPackedMsg, end - *ppReadPackedMsg, foo, sizeof(foo))); if (pull16(ppReadPackedMsg, &value->number_of_pdus, end) == 0) return 0; @@ -5006,8 +5002,6 @@ static uint8_t unpack_rx_indication_body_value(void *tlv, uint8_t **ppReadPacked nfapi_tl_t generic_tl; // NFAPI_RX_UE_INFORMATION_TAG - // NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s:%d: %s\n", __FUNCTION__, - // __LINE__, hexdump(*ppReadPackedMsg, end - *ppReadPackedMsg, foo, sizeof(foo))); if (unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) { NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s unpack_tl failed\n", __FUNCTION__); @@ -5021,10 +5015,10 @@ static uint8_t unpack_rx_indication_body_value(void *tlv, uint8_t **ppReadPacked NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s generic_tl.tag wrong\n", __FUNCTION__); return 0; } + nfapi_rx_indication_pdu_t *pdu = &value->rx_pdu_list[i]; + pdu->rx_ue_information.tl = generic_tl; - // NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s:%d: %s\n", __FUNCTION__, - // __LINE__, hexdump(*ppReadPackedMsg, end - *ppReadPackedMsg, foo, sizeof(foo))); if (unpack_rx_ue_information_value(&pdu->rx_ue_information, ppReadPackedMsg, end) == 0) { NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s unpack_rx_ue_info failure\n", __FUNCTION__); @@ -5032,8 +5026,6 @@ static uint8_t unpack_rx_indication_body_value(void *tlv, uint8_t **ppReadPacked } // NFAPI_RX_INDICATION_REL8_TAG - // NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s:%d: %s\n", __FUNCTION__, - // __LINE__, hexdump(*ppReadPackedMsg, end - *ppReadPackedMsg, foo, sizeof(foo))); if (unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) { NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s unpack_tl failed\n", __FUNCTION__); @@ -5048,8 +5040,6 @@ static uint8_t unpack_rx_indication_body_value(void *tlv, uint8_t **ppReadPacked return 0; } pdu->rx_indication_rel8.tl = generic_tl; - // NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s:%d: %s\n", __FUNCTION__, - // __LINE__, hexdump(*ppReadPackedMsg, end - *ppReadPackedMsg, foo, sizeof(foo))); if (unpack_rx_indication_rel8_value(&pdu->rx_indication_rel8, ppReadPackedMsg, end) == 0) { NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s unpack_rx_indication_rel8 failure\n", __FUNCTION__); @@ -5060,8 +5050,6 @@ static uint8_t unpack_rx_indication_body_value(void *tlv, uint8_t **ppReadPacked pdu->rx_indication_rel8.offset); // NFAPI_RX_INDICATION_REL9_TAG - // NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s:%d: %s\n", __FUNCTION__, - // __LINE__, hexdump(*ppReadPackedMsg, end - *ppReadPackedMsg, foo, sizeof(foo))); if (unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) { NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s unpack_tl failed\n", __FUNCTION__); @@ -5076,8 +5064,6 @@ static uint8_t unpack_rx_indication_body_value(void *tlv, uint8_t **ppReadPacked return 0; } pdu->rx_indication_rel9.tl = generic_tl; - // NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s:%d: %s\n", __FUNCTION__, - // __LINE__, hexdump(*ppReadPackedMsg, end - *ppReadPackedMsg, foo, sizeof(foo))); if (unpack_rx_indication_rel9_value(&pdu->rx_indication_rel9, ppReadPackedMsg, end) == 0) { NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s unpack_rx_indication_rel9 failure\n", __FUNCTION__); @@ -5092,19 +5078,16 @@ static uint8_t unpack_rx_indication_body_value(void *tlv, uint8_t **ppReadPacked { uint32_t length = pdu->rx_indication_rel8.length; value->rx_pdu_list[i].data = nfapi_p7_allocate(length, config); - // NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s:%d: %s\n", __FUNCTION__, - // __LINE__, hexdump(*ppReadPackedMsg, end - *ppReadPackedMsg, foo, sizeof(foo))); + if (pullarray8(ppReadPackedMsg, pdu->data, length, length, end) == 0) { NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s pullarray8 failure\n", __FUNCTION__); return 0; } - // NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s:%d: %s\n", __FUNCTION__, - // __LINE__, hexdump(*ppReadPackedMsg, end - *ppReadPackedMsg, foo, sizeof(foo))); + } } - NFAPI_TRACE(NFAPI_TRACE_INFO, "%s Success!\n", __FUNCTION__); return 1; } diff --git a/openair2/COMMON/platform_constants.h b/openair2/COMMON/platform_constants.h index e1dc28a71b..df010b1d6b 100644 --- a/openair2/COMMON/platform_constants.h +++ b/openair2/COMMON/platform_constants.h @@ -84,7 +84,10 @@ #define MAX_eNB 2 #define MAX_gNB 2 #else - #define MAX_MOBILES_PER_ENB 20 // This was maxed at 4 Why? -Andrew + // TODO: Change after gaining stability on 20 UES or less + // Make sure when changing these two fields to also change + // "NUMBER_OF_UE_MAX" constant in targets/COMMON/openairinterface5g_limits.h - Andrew + #define MAX_MOBILES_PER_ENB 20 #define MAX_MOBILES_PER_ENB_NB_IoT 20 #define MAX_MOBILES_PER_GNB 2//16 #define MAX_eNB 2 diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index d43e8fee2e..ac5131174b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -583,7 +583,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, } // If we ever see a difference this big something is very wrong // This threshold is arbitrary - if (delta > 8500 || delta == 0) // 900 frames + if (delta > 8500 || delta == 0) // 850 frames { LOG_I(MAC, "scheduler ignoring outerspace %d.%d -> %d.%d = %d\n", eNB->frame, eNB->subframe, frameP, subframeP, delta); diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index 6ead4c07a3..19dcfa9caa 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -95,8 +95,6 @@ void fill_rx_indication_UE_MAC(module_id_t Mod_id, pdu->rx_indication_rel9.tl.tag = NFAPI_RX_INDICATION_REL9_TAG; pdu->rx_indication_rel9.timing_advance_r9 = 0; - // What is this? - Andrew - // ulsch_buffer is necessary to keep its value. pdu->data = malloc(buflen); memcpy(pdu->data, ulsch_buffer, buflen); LOG_I(MAC, "buflen of rx_ind pdu_data = %u SFN.SF: %d.%d\n", buflen, @@ -951,9 +949,6 @@ int memcpy_dl_config_req(L1_rxtx_proc_t *proc, req->dl_config_request_body.dl_config_pdu_list[i]; } - LOG_I(MAC, "dl_config_req in memcpy Frame: %d Subframe: %d\n", - p->sfn_sf >> 4, p->sfn_sf & 15); - if (!put_queue(&dl_config_req_queue, p)) { free(p); } @@ -1220,8 +1215,6 @@ void *ue_standalone_pnf_task(void *context) } else { - LOG_I(MAC, "dl_config_req fresh off socket Frame: %d Subframe: %d\n", - dl_config_req.sfn_sf >> 4, dl_config_req.sfn_sf & 15); // check to see if dl_config_req is null memcpy_dl_config_req(NULL, NULL, &dl_config_req); } @@ -1347,7 +1340,7 @@ static void print_rx_ind(nfapi_rx_indication_t *p) { int encoded_size = -1; char buffer[1024]; - char dump[1024]; + switch (msg_type) { case NFAPI_RACH_INDICATION: @@ -1362,28 +1355,13 @@ static void print_rx_ind(nfapi_rx_indication_t *p) UL->crc_ind.crc_indication_body.number_of_crcs); break; case NFAPI_RX_ULSCH_INDICATION: - print_rx_ind(&UL->rx_ind); encoded_size = nfapi_p7_message_pack(&UL->rx_ind, buffer, sizeof(buffer), NULL); - LOG_I(MAC, "RX_IND sent to Proxy, Size: %d Frame %d Subframe %d rx_ind.tl.length: %u num_pdus: %u\nHexDUMP %s\n", + LOG_I(MAC, "RX_IND sent to Proxy, Size: %d Frame %d Subframe %d rx_ind.tl.length: %u num_pdus: %u\n", encoded_size, NFAPI_SFNSF2SFN(UL->rx_ind.sfn_sf), NFAPI_SFNSF2SF(UL->rx_ind.sfn_sf), - UL->rx_ind.rx_indication_body.tl.length, UL->rx_ind.rx_indication_body.number_of_pdus, - hexdump(buffer, encoded_size, dump, sizeof(dump))); - // nfapi_rx_indication_t test_ind; - // if (nfapi_p7_message_unpack(buffer, encoded_size, &test_ind, sizeof(test_ind), NULL) < 0) - // { - // LOG_E(MAC, "could not unpack rx_ind right after packing encoded_size: %d\n", encoded_size); - // abort(); - // } - // print_rx_ind(&test_ind); - // char test_buffer[1024]; - // int encoded_size2 = nfapi_p7_message_pack(&test_ind, test_buffer, sizeof(test_buffer), NULL); - // if (encoded_size2 < 0) - // { - // LOG_E(MAC, "could not pack rx_ind right after unpacking encoded_size2: %d\n", encoded_size2); - // } + UL->rx_ind.rx_indication_body.tl.length, UL->rx_ind.rx_indication_body.number_of_pdus); break; case NFAPI_RX_CQI_INDICATION: - encoded_size = nfapi_p7_message_pack(&UL->cqi_ind, buffer, sizeof(buffer), NULL); // Check pdu->ul_cqi_information.channel = 1 + encoded_size = nfapi_p7_message_pack(&UL->cqi_ind, buffer, sizeof(buffer), NULL); LOG_I(MAC, "CQI_IND sent to Proxy, Size: %d num_cqis: %u\n", encoded_size, UL->cqi_ind.cqi_indication_body.number_of_cqis); break;