From 5751a0a43551698a02f15572428cc31c11dcd5b7 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 3 Aug 2021 13:25:45 -0700 Subject: [PATCH] Not sending random data to gNB, sending IP The IP traffic still does not work. But we are updating the NR UE scheduler to ensure we are are sending true IP traffic. Also, we were getting an assert(); as well, and there was no logs, so we fix that in this commit as well. --- executables/nr-softmodem.c | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 6 +++--- openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c | 2 +- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 4 +++- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 5 +++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 0f7ccfb6e6..d88ca03ad2 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -710,7 +710,7 @@ int main( int argc, char **argv ) #ifdef PDCP_USE_NETLINK -if(!IS_SOFTMODEM_NOS1) +if(IS_SOFTMODEM_NOS1) netlink_init(); #if defined(PDCP_USE_NETLINK_QUEUES) pdcp_netlink_init(); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index b795b8c7a8..a4089858dd 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -897,7 +897,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in uint16_t TBS_bytes = ulcfg_pdu->pusch_config_pdu.pusch_data.tb_size; // Push data from MAC to PHY only when NDI toggles - if ((mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] != ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator)){ + if (mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] != ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator){ // Getting IP traffic to be transmitted data_existing = nr_ue_get_sdu(mod_id, cc_id, @@ -911,7 +911,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] = ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator; //Random traffic to be transmitted if there is no IP traffic available for this Tx opportunity - if (!IS_SOFTMODEM_NOS1 || !data_existing) { + if (IS_SOFTMODEM_NOS1 || !data_existing) { //Use zeros for the header bytes in noS1 mode, in order to make sure that the LCID is not valid //and block this traffic from being forwarded to the upper layers at the gNB LOG_D(PHY, "In %s: Random data to be transmitted: TBS_bytes %d \n", __FUNCTION__, TBS_bytes); @@ -1832,7 +1832,7 @@ nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP, ENB_FLAG_NO, MBMS_FLAG_NO, lcid, - buflen_remain, + buflen_remain-MAX_RLC_SDU_SUBHEADER_SIZE, (char *)&ulsch_sdus[sdu_length_total],0, 0); diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c index 62881c184e..a5c2c5ab8b 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c @@ -31,7 +31,7 @@ void nr_pdcp_entity_drb_am_recv_pdu(nr_pdcp_entity_t *_entity, char *buffer, int nr_pdcp_entity_drb_am_t *entity = (nr_pdcp_entity_drb_am_t *)_entity; int sn; - if (size < 3) abort(); + AssertFatal(size >= 3, "Size < 3. Size = %d", size); if (!(buffer[0] & 0x80)) LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__); diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index b71dc1fc4b..fc0f2e5c7f 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -411,9 +411,11 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, uint8_t *gtpu_buffer_p; int rb_id; int i; + LOG_I(PDCP, "Melissa Elkadi we got here %s\n", __FUNCTION__); - if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->nsa){ + if(!IS_SOFTMODEM_NOS1 || get_softmodem_params()->nsa){ len = write(nas_sock_fd[0], buf, size); + LOG_I(PDCP, "Melissa Elkadi Writing %d bytes to tunnel interface\n", len); if (len != size) { LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__); } diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index c6a72f078f..338d1e160b 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -286,13 +286,14 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi { if (pdu_list->TLVs[j].tag) dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.pdu = (void*) pdu_list->TLVs[j].value.ptr; // Melissa, fix me! - else if (!pdu_list->TLVs[j].tag) + else dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.pdu = (void*) pdu_list->TLVs[j].value.direct; // Melissa, fix me! dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.pdu_length = pdu_list->TLVs[j].length; + LOG_D(NR_PHY, "%s: num_tlv %d and length %d\n", __FUNCTION__, pdu_list->num_TLV, pdu_list->TLVs[j].length); if (tx_data_request->Slot == 7) { //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 if (tx_data_request->Slot != 7 && get_softmodem_params()->nsa) { + else { dl_info->rx_ind->rx_indication_body[i].pdu_type = FAPI_NR_RX_PDU_TYPE_DLSCH; } }