Commit 7d505e70 authored by Melissa Elkadi's avatar Melissa Elkadi

Updated PDSCH pdu copy from tx_data_req

Also, finally committing the critical logs for IP traffic.
parent 952e2cd1
......@@ -1919,7 +1919,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
mac_subheader_len = 2;
}
LOG_D(MAC, "[UE %d] Frame %d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, gNB_index, mac_sdu_len);
LOG_I(MAC, "Melissa Elkadi [UE %d] Frame %d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, gNB_index, mac_sdu_len);
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
LOG_T(MAC, "[UE %d] First 32 bytes of DLSCH : \n", module_idP);
......@@ -1992,7 +1992,8 @@ uint16_t nr_generate_ulsch_pdu(uint8_t *sdus_payload,
// Generating UL MAC subPDUs including MAC SDU and subheader
for (i = 0; i < num_sdus; i++) {
LOG_D(MAC, "[UE] Generating UL MAC subPDUs for SDU with lenght %d ( num_sdus %d )\n", sdu_lengths[i], num_sdus);
LOG_I(MAC, "Melissa Elkadi [UE] Generating UL MAC subPDUs for SDU with length %d ( num_sdus %d ) and LCID %d\n",
sdu_lengths[i], num_sdus, sdu_lcids[i]);
if (sdu_lcids[i] != UL_SCH_LCID_CCCH){
if (sdu_lengths[i] < 128) {
......
......@@ -1816,8 +1816,8 @@ nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
buflen_remain =
buflen - (total_rlc_pdu_header_len + sdu_length_total + MAX_RLC_SDU_SUBHEADER_SIZE);
LOG_D(MAC,
"[UE %d] Frame %d : UL-DXCH -> ULSCH, RLC %d has %d bytes to "
LOG_I(MAC,
"Melissa Elkadi [UE %d] Frame %d : UL-DXCH -> ULSCH, RLC %d has %d bytes to "
"send (Transport Block size %d SDU Length Total %d , mac header len %d, buflen_remain %d )\n", //BSR byte before Tx=%d
module_idP, frameP, lcid, lcid_buffer_occupancy_new,
buflen, sdu_length_total,
......
......@@ -1032,8 +1032,8 @@ void nr_schedule_ue_spec(module_id_t module_id,
0,
0);
LOG_D(MAC,
"%4d.%2d RNTI %04x: %d bytes from DTCH %d (ndata %d, remaining size %d)\n",
LOG_I(MAC,
"Melissa Elkadi %4d.%2d RNTI %04x: %d bytes from DTCH %d (ndata %d, remaining size %d)\n",
frame,
slot,
rnti,
......
......@@ -259,7 +259,7 @@ void nr_process_mac_pdu(
mac_subheader_len = 2;
}
LOG_D(MAC, "[UE %d] Frame %d : ULSCH -> UL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len);
LOG_I(MAC, "Melissa Elkadi [UE %d] Frame %d : ULSCH -> UL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len);
int UE_id = find_nr_UE_id(module_idP, rnti);
RC.nrmac[module_idP]->UE_info.mac_stats[UE_id].lc_bytes_rx[rx_lcid] += mac_sdu_len;
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
......
......@@ -444,7 +444,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ue->rnti;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4;
LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size);
LOG_I(PDCP, "Melissa Elkadi %s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size);
//for (i = 0; i < size; i++) printf(" %2.2x", (unsigned char)buf[i]);
//printf("\n");
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
......@@ -627,9 +627,11 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s,
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, rnti);
if (ue->drb[drb_id-1] != NULL) {
LOG_D(PDCP, "%s:%d:%s: warning DRB %d already exist for ue %d, do nothing\n",
LOG_I(PDCP, "Melissa Elkadi %s:%d:%s: warning DRB %d already exist for ue %d, do nothing\n",
__FILE__, __LINE__, __FUNCTION__, drb_id, rnti);
} else {
LOG_I(PDCP, "%s:%d:%s: Melissa Elkadi, we will call deliver_sdu_drb\n", __FILE__, __LINE__, __FUNCTION__);
pdcp_drb = new_nr_pdcp_entity_drb_am(is_gnb, drb_id,
deliver_sdu_drb, ue, deliver_pdu_drb, ue,
sn_size_dl, t_reordering, discard_timer,
......
......@@ -282,20 +282,31 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi
{
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++)
{
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, i);
uint8_t *pdu = malloc(length);
dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.pdu = pdu;
for (int j = 0; j < pdu_list->num_TLV; j++)
{
const uint32_t *ptr;
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!
ptr = pdu_list->TLVs[j].value.ptr;
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 {
dl_info->rx_ind->rx_indication_body[i].pdu_type = FAPI_NR_RX_PDU_TYPE_DLSCH;
}
ptr = pdu_list->TLVs[j].value.direct;
memcpy(pdu, ptr, pdu_list->TLVs[j].length);
pdu += pdu_list->TLVs[j].length;
}
dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.pdu_length = 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 {
dl_info->rx_ind->rx_indication_body[i].pdu_type = FAPI_NR_RX_PDU_TYPE_DLSCH;
}
}
dl_info->slot = tx_data_request->Slot;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment