Commit 4f1d5434 authored by Melissa Elkadi's avatar Melissa Elkadi

Adding hexdumps to see dc/p bit in PDU

At this point we can see the UDP uplink data
getting to the GTP layer of the gNB. This
only works if you change the memcpy in serialize_sdu()
to not have the encoded.byte
parent 745241bd
...@@ -94,7 +94,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response ...@@ -94,7 +94,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
rx_ind->pdu_list[j].ul_cqi = 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]; char buffer[1024];
hexdump(rx_ind->pdu_list[j].pdu, rx_ind->pdu_list[j].pdu_length, buffer, sizeof(buffer)); hexdump(rx_ind->pdu_list[j].pdu, rx_ind->pdu_list[j].pdu_length, buffer, sizeof(buffer));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s before queuing rx_ind\n", LOG_D(MAC, "Melissa Elkadi, this is hexdump of pdu %s before queuing rx_ind\n",
buffer); buffer);
} }
......
...@@ -1841,7 +1841,10 @@ nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP, ...@@ -1841,7 +1841,10 @@ nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
buflen_remain-MAX_RLC_SDU_SUBHEADER_SIZE, buflen_remain-MAX_RLC_SDU_SUBHEADER_SIZE,
(char *)&ulsch_sdus[sdu_length_total],0, (char *)&ulsch_sdus[sdu_length_total],0,
0); 0);
char buffer[1024];
hexdump((char *)&ulsch_sdus[sdu_length_total], buflen_remain, buffer, sizeof(buffer));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after receving in MAC layer\n",
buffer);
AssertFatal(buflen_remain >= sdu_lengths[num_sdus], AssertFatal(buflen_remain >= sdu_lengths[num_sdus],
"LCID=%d RLC has segmented %d bytes but MAC has max=%d\n", "LCID=%d RLC has segmented %d bytes but MAC has max=%d\n",
lcid, sdu_lengths[num_sdus], buflen_remain); lcid, sdu_lengths[num_sdus], buflen_remain);
...@@ -1868,8 +1871,9 @@ nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP, ...@@ -1868,8 +1871,9 @@ nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
buflen - (total_rlc_pdu_header_len + sdu_length_total + MAX_RLC_SDU_SUBHEADER_SIZE); buflen - (total_rlc_pdu_header_len + sdu_length_total + MAX_RLC_SDU_SUBHEADER_SIZE);
} }
char buffer[1024]; char buffer[1024];
hexdump(&ulsch_sdus[sdu_length_total], lcid_buffer_occupancy_new, buffer, sizeof(buffer)); hexdump(&ulsch_sdus[sdu_length_total], buflen_remain, buffer, sizeof(buffer));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s \n", buffer); LOG_I(MAC, "Melissa Elkadi, total_rlc_pdu_header_len %d and this is hexdump of pdu %s \n",
total_rlc_pdu_header_len, buffer);
} }
} }
......
...@@ -283,7 +283,7 @@ void nr_process_mac_pdu( ...@@ -283,7 +283,7 @@ void nr_process_mac_pdu(
1, 1,
NULL); NULL);
char buf[1024]; char buf[1024];
hexdump((char *) (pdu_ptr + mac_subheader_len), mac_sdu_len, buff, sizeof(buf)); hexdump((char *) (pdu_ptr + mac_subheader_len), mac_sdu_len, buf, sizeof(buf));
LOG_I(MAC, "Melissa Elkadi, after passing to rlc this is hexdump of pdu %s \n", buf); LOG_I(MAC, "Melissa Elkadi, after passing to rlc this is hexdump of pdu %s \n", buf);
/* Updated estimated buffer when receiving data */ /* Updated estimated buffer when receiving data */
if (sched_ctrl->estimated_ul_buffer >= mac_sdu_len) if (sched_ctrl->estimated_ul_buffer >= mac_sdu_len)
......
...@@ -58,6 +58,10 @@ void nr_pdcp_entity_drb_am_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int ...@@ -58,6 +58,10 @@ void nr_pdcp_entity_drb_am_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int
nr_pdcp_entity_drb_am_t *entity = (nr_pdcp_entity_drb_am_t *)_entity; nr_pdcp_entity_drb_am_t *entity = (nr_pdcp_entity_drb_am_t *)_entity;
int sn; int sn;
char buf[size+3]; char buf[size+3];
char buf_mel[1024];
hexdump(buffer, size, buf_mel, sizeof(buf_mel));
LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s recevied in PDCP layer directly\n",
__FUNCTION__, buf_mel);
sn = entity->common.next_nr_pdcp_tx_sn; sn = entity->common.next_nr_pdcp_tx_sn;
...@@ -71,6 +75,10 @@ void nr_pdcp_entity_drb_am_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int ...@@ -71,6 +75,10 @@ void nr_pdcp_entity_drb_am_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int
buf[1] = (sn >> 8) & 0xff; buf[1] = (sn >> 8) & 0xff;
buf[2] = sn & 0xff; buf[2] = sn & 0xff;
memcpy(buf+3, buffer, size); memcpy(buf+3, buffer, size);
char buf_melissa[1024];
hexdump(buf+3, size, buf_melissa, sizeof(buf_melissa));
LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s copied into buf+3 in PDCP. And this is the sdu_id %d\n",
__FUNCTION__, buf_melissa, sdu_id);
if (entity->common.has_ciphering) if (entity->common.has_ciphering)
entity->common.cipher(entity->common.security_context, (unsigned char *)buf+3, size, entity->common.cipher(entity->common.security_context, (unsigned char *)buf+3, size,
...@@ -78,6 +86,10 @@ void nr_pdcp_entity_drb_am_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int ...@@ -78,6 +86,10 @@ void nr_pdcp_entity_drb_am_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int
entity->common.deliver_pdu(entity->common.deliver_pdu_data, entity->common.deliver_pdu(entity->common.deliver_pdu_data,
(nr_pdcp_entity_t *)entity, buf, size+3, sdu_id); (nr_pdcp_entity_t *)entity, buf, size+3, sdu_id);
char buf_meli[1024];
hexdump(buf, size + 3, buf_meli, sizeof(buf_meli));
LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s After delivering to RLC\n",
__FUNCTION__, buf_meli);
} }
void nr_pdcp_entity_drb_am_set_integrity_key(nr_pdcp_entity_t *_entity, char *key) void nr_pdcp_entity_drb_am_set_integrity_key(nr_pdcp_entity_t *_entity, char *key)
......
...@@ -265,6 +265,9 @@ static void *ue_tun_read_thread(void *_) ...@@ -265,6 +265,9 @@ static void *ue_tun_read_thread(void *_)
} }
LOG_D(PDCP, "%s(): nas_sock_fd read returns len %d\n", __func__, len); LOG_D(PDCP, "%s(): nas_sock_fd read returns len %d\n", __func__, len);
char buffer[1024];
hexdump(rx_buf, len, buffer, sizeof(buffer));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s from tunnel interface\n", buffer);
nr_pdcp_manager_lock(nr_pdcp_ue_manager); nr_pdcp_manager_lock(nr_pdcp_ue_manager);
rnti = nr_pdcp_get_first_rnti(nr_pdcp_ue_manager); rnti = nr_pdcp_get_first_rnti(nr_pdcp_ue_manager);
...@@ -940,7 +943,10 @@ static boolean_t pdcp_data_req_drb( ...@@ -940,7 +943,10 @@ static boolean_t pdcp_data_req_drb(
__FILE__, __LINE__, __FUNCTION__, rnti, rb_id); __FILE__, __LINE__, __FUNCTION__, rnti, rb_id);
return 0; return 0;
} }
char buffer[1024];
hexdump((char *)sdu_buffer, sdu_buffer_size, buffer, sizeof(buffer));
LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s from tunnel interface in PDCP layer\n",
__FUNCTION__, buffer);
rb->recv_sdu(rb, (char *)sdu_buffer, sdu_buffer_size, muiP); rb->recv_sdu(rb, (char *)sdu_buffer, sdu_buffer_size, muiP);
nr_pdcp_manager_unlock(nr_pdcp_ue_manager); nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
......
...@@ -552,7 +552,10 @@ void nr_rlc_entity_am_recv_pdu(nr_rlc_entity_t *_entity, ...@@ -552,7 +552,10 @@ void nr_rlc_entity_am_recv_pdu(nr_rlc_entity_t *_entity,
int control_e2; int control_e2;
int control_e3; int control_e3;
unsigned char sn_set[32768]; /* used to dec retx_count only once per sdu */ unsigned char sn_set[32768]; /* used to dec retx_count only once per sdu */
char buf_3[1024];
hexdump(buffer, size, buf_3, sizeof(buf_3));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_3, __FUNCTION__, __LINE__);
nr_rlc_pdu_decoder_init(&decoder, buffer, size); nr_rlc_pdu_decoder_init(&decoder, buffer, size);
dc = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); dc = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder);
LOG_I(RLC, "Melissa Elkadi, we are here %s(): %d. dc = %d\n", __FUNCTION__, __LINE__, dc); LOG_I(RLC, "Melissa Elkadi, we are here %s(): %d. dc = %d\n", __FUNCTION__, __LINE__, dc);
...@@ -815,9 +818,20 @@ static int serialize_sdu(nr_rlc_entity_am_t *entity, ...@@ -815,9 +818,20 @@ static int serialize_sdu(nr_rlc_entity_am_t *entity,
nr_rlc_pdu_encoder_put_bits(&encoder, 1, 1); /* D/C: 1 = data */ nr_rlc_pdu_encoder_put_bits(&encoder, 1, 1); /* D/C: 1 = data */
nr_rlc_pdu_encoder_put_bits(&encoder, 0, 1); /* P: reserve, set later */ nr_rlc_pdu_encoder_put_bits(&encoder, 0, 1); /* P: reserve, set later */
char buf_1[1024];
hexdump(sdu->sdu->data, sdu->size, buf_1, sizeof(buf_1));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_1, __FUNCTION__, __LINE__);
nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_first,1);/* 1st bit of SI */ nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_first,1);/* 1st bit of SI */
char buf_2[1024];
hexdump(sdu->sdu->data, sdu->size, buf_2, sizeof(buf_2));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_2, __FUNCTION__, __LINE__);
nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_last,1); /* 2nd bit of SI */ nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_last,1); /* 2nd bit of SI */
char buf_3[1024];
hexdump(sdu->sdu->data, sdu->size, buf_3, sizeof(buf_3));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_3, __FUNCTION__, __LINE__);
if (entity->sn_field_length == 18) if (entity->sn_field_length == 18)
nr_rlc_pdu_encoder_put_bits(&encoder, 0, 2); /* R */ nr_rlc_pdu_encoder_put_bits(&encoder, 0, 2); /* R */
...@@ -833,7 +847,10 @@ static int serialize_sdu(nr_rlc_entity_am_t *entity, ...@@ -833,7 +847,10 @@ static int serialize_sdu(nr_rlc_entity_am_t *entity,
if (p) if (p)
include_poll(entity, buffer); include_poll(entity, buffer);
char buf[1024];
hexdump(buffer + encoder.byte, sdu->size, buf, sizeof(buf));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after calling generate_pdu in %s\n",
buf, __FUNCTION__);
return encoder.byte + sdu->size; return encoder.byte + sdu->size;
} }
...@@ -1557,19 +1574,25 @@ int nr_rlc_entity_am_generate_pdu(nr_rlc_entity_t *_entity, ...@@ -1557,19 +1574,25 @@ int nr_rlc_entity_am_generate_pdu(nr_rlc_entity_t *_entity,
{ {
nr_rlc_entity_am_t *entity = (nr_rlc_entity_am_t *)_entity; nr_rlc_entity_am_t *entity = (nr_rlc_entity_am_t *)_entity;
int ret; int ret;
LOG_I(MAC, "Melissa Elkadi, in %s(): %d\n", __FUNCTION__, __LINE__);
if (status_to_report(entity)) { if (status_to_report(entity)) {
LOG_I(MAC, "Melissa Elkadi, in %s(): %d\n", __FUNCTION__, __LINE__);
ret = generate_status(entity, buffer, size); ret = generate_status(entity, buffer, size);
if (ret != 0) if (ret != 0)
return ret; return ret;
} }
if (entity->retransmit_list != NULL) { if (entity->retransmit_list != NULL) {
LOG_I(MAC, "Melissa Elkadi, in %s(): %d\n", __FUNCTION__, __LINE__);
ret = generate_retx_pdu(entity, buffer, size); ret = generate_retx_pdu(entity, buffer, size);
if (ret != 0) if (ret != 0)
return ret; return ret;
} }
char buf[1024];
hexdump(buffer, size, buf, sizeof(buf));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right before calling generate_pdu in %s\n",
buf, __FUNCTION__);
return generate_tx_pdu(entity, buffer, size); return generate_tx_pdu(entity, buffer, size);
} }
......
...@@ -104,6 +104,7 @@ int nr_rlc_entity_tm_generate_pdu(nr_rlc_entity_t *_entity, ...@@ -104,6 +104,7 @@ int nr_rlc_entity_tm_generate_pdu(nr_rlc_entity_t *_entity,
char *buffer, int size) char *buffer, int size)
{ {
nr_rlc_entity_tm_t *entity = (nr_rlc_entity_tm_t *)_entity; nr_rlc_entity_tm_t *entity = (nr_rlc_entity_tm_t *)_entity;
LOG_I(MAC, "Melissa Elkadi, in %s(): %d\n", __FUNCTION__, __LINE__);
return generate_tx_pdu(entity, buffer, size); return generate_tx_pdu(entity, buffer, size);
} }
......
...@@ -353,9 +353,20 @@ static int serialize_sdu(nr_rlc_entity_um_t *entity, ...@@ -353,9 +353,20 @@ static int serialize_sdu(nr_rlc_entity_um_t *entity,
/* generate header */ /* generate header */
nr_rlc_pdu_encoder_init(&encoder, buffer, bufsize); nr_rlc_pdu_encoder_init(&encoder, buffer, bufsize);
char buf_1[1024];
hexdump(sdu->sdu->data, sdu->size, buf_1, sizeof(buf_1));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_1, __FUNCTION__, __LINE__);
nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_first,1);/* 1st bit of SI */ nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_first,1);/* 1st bit of SI */
char buf_2[1024];
hexdump(sdu->sdu->data, sdu->size, buf_2, sizeof(buf_2));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_2, __FUNCTION__, __LINE__);
nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_last,1); /* 2nd bit of SI */ nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_last,1); /* 2nd bit of SI */
char buf_3[1024];
hexdump(sdu->sdu->data, sdu->size, buf_3, sizeof(buf_3));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_3, __FUNCTION__, __LINE__);
/* SN, if required */ /* SN, if required */
if (sdu->is_first == 1 && sdu->is_last == 1) { if (sdu->is_first == 1 && sdu->is_last == 1) {
nr_rlc_pdu_encoder_put_bits(&encoder, 0, 6); /* R */ nr_rlc_pdu_encoder_put_bits(&encoder, 0, 6); /* R */
...@@ -369,9 +380,23 @@ static int serialize_sdu(nr_rlc_entity_um_t *entity, ...@@ -369,9 +380,23 @@ static int serialize_sdu(nr_rlc_entity_um_t *entity,
if (!sdu->is_first) if (!sdu->is_first)
nr_rlc_pdu_encoder_put_bits(&encoder, sdu->so, 16); /* SO */ nr_rlc_pdu_encoder_put_bits(&encoder, sdu->so, 16); /* SO */
char buf_sdu[1024];
hexdump(sdu->sdu->data, sdu->size, buf_sdu, sizeof(buf_sdu));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of sdu->data %s in %s\n",
buf_sdu, __FUNCTION__);
/* data */ /* data */
memcpy(buffer + encoder.byte, sdu->sdu->data + sdu->so, sdu->size); memcpy(buffer + encoder.byte, sdu->sdu->data + sdu->so, sdu->size);
char buf_5[1024];
hexdump(buffer, sdu->size, buf_5, sizeof(buf_5));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after memcpy of just buffer %s\n",
buf_5, __FUNCTION__);
char buf[1024];
hexdump(buffer + encoder.byte, sdu->size, buf, sizeof(buf));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after memcpy sdu into buffer in %s\n",
buf, __FUNCTION__);
return encoder.byte + sdu->size; return encoder.byte + sdu->size;
} }
...@@ -479,9 +504,15 @@ static int generate_tx_pdu(nr_rlc_entity_um_t *entity, char *buffer, int size) ...@@ -479,9 +504,15 @@ static int generate_tx_pdu(nr_rlc_entity_um_t *entity, char *buffer, int size)
/* update tx_next if the SDU is an SDU segment and is the last */ /* update tx_next if the SDU is an SDU segment and is the last */
if (!sdu->is_first && sdu->is_last) if (!sdu->is_first && sdu->is_last)
entity->tx_next = (entity->tx_next + 1) % entity->sn_modulus; entity->tx_next = (entity->tx_next + 1) % entity->sn_modulus;
char buf[1024];
hexdump(buffer, sdu->size, buf, sizeof(buf));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right before calling serialize_sdu in %s\n",
buf, __FUNCTION__);
ret = serialize_sdu(entity, sdu, buffer, size); ret = serialize_sdu(entity, sdu, buffer, size);
char buf_1[1024];
hexdump(buffer, size, buf_1, sizeof(buf_1));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after calling serialize_sdu in %s\n",
buf_1, __FUNCTION__);
entity->tx_size -= sdu->size; entity->tx_size -= sdu->size;
nr_rlc_free_sdu_segment(sdu); nr_rlc_free_sdu_segment(sdu);
...@@ -523,6 +554,7 @@ int nr_rlc_entity_um_generate_pdu(nr_rlc_entity_t *_entity, ...@@ -523,6 +554,7 @@ int nr_rlc_entity_um_generate_pdu(nr_rlc_entity_t *_entity,
char *buffer, int size) char *buffer, int size)
{ {
nr_rlc_entity_um_t *entity = (nr_rlc_entity_um_t *)_entity; nr_rlc_entity_um_t *entity = (nr_rlc_entity_um_t *)_entity;
LOG_I(MAC, "Melissa Elkadi, in %s(): %d\n", __FUNCTION__, __LINE__);
return generate_tx_pdu(entity, buffer, size); return generate_tx_pdu(entity, buffer, size);
} }
......
...@@ -197,6 +197,10 @@ tbs_size_t mac_rlc_data_req( ...@@ -197,6 +197,10 @@ tbs_size_t mac_rlc_data_req(
rb->set_time(rb, nr_rlc_current_time); rb->set_time(rb, nr_rlc_current_time);
maxsize = tb_sizeP; maxsize = tb_sizeP;
ret = rb->generate_pdu(rb, buffer_pP, maxsize); ret = rb->generate_pdu(rb, buffer_pP, maxsize);
char buffer[1024];
hexdump(buffer_pP, ret, buffer, sizeof(buffer));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after calling generate_pdu in %s\n",
buffer, __FUNCTION__);
} else { } else {
LOG_E(RLC, "%s:%d:%s: fatal: data req for unknown RB, channel_idP: %d\n", __FILE__, __LINE__, __FUNCTION__, channel_idP); LOG_E(RLC, "%s:%d:%s: fatal: data req for unknown RB, channel_idP: %d\n", __FILE__, __LINE__, __FUNCTION__, channel_idP);
exit(1); exit(1);
......
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