diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index e6f32b1405..7d16783416 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1275,7 +1275,6 @@ void nr_schedule_ue_spec(module_id_t module_id, header->LCID = DL_SCH_LCID_PADDING; buf += sizeof(NR_MAC_SUBHEADER_LONG); header->L = htons(bufEnd-buf); - dlsch_total_bytes += bufEnd-buf; for (; ((intptr_t)buf) % 4; buf++) *buf = lrand48() & 0xff; @@ -1306,6 +1305,7 @@ void nr_schedule_ue_spec(module_id_t module_id, UE->mac_stats.dl.total_rbs += sched_pdsch->rbSize; UE->mac_stats.dl.num_mac_sdu += sdus; UE->mac_stats.dl.current_rbs = sched_pdsch->rbSize; + UE->mac_stats.dl.total_sdu_bytes += dlsch_total_bytes; /* save retransmission information */ harq->sched_pdsch = *sched_pdsch; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 3c314c6c86..6ed327e125 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -325,6 +325,7 @@ int nr_process_mac_pdu(instance_t module_idP, if (UE_idx->CellGroup) { LOG_D(NR_MAC, "Frame %d : ULSCH -> UL-DCCH %d (gNB %ld, %d bytes), rnti: 0x%04x \n", frameP, rx_lcid, module_idP, mac_len, crnti); + UE->mac_stats.ul.total_sdu_bytes += mac_len; mac_rlc_data_ind(module_idP, crnti, module_idP, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 1cd0f89736..b8517da55e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -614,6 +614,7 @@ typedef struct NR_mac_dir_stats { uint64_t errors; uint64_t total_bytes; uint32_t current_bytes; + uint64_t total_sdu_bytes; uint32_t total_rbs; uint32_t total_rbs_retx; uint32_t num_mac_sdu;