Commit 439644f3 authored by shahab SHARIAT BAGHERI's avatar shahab SHARIAT BAGHERI Committed by Robert Schmidt

MAC stats Improvement & RAN APIs

parent 3fa3e6b1
...@@ -496,60 +496,76 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, ...@@ -496,60 +496,76 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
goto error; goto error;
protocol__flex_mon_app__init(monapp); protocol__flex_mon_app__init(monapp);
monapp->size_sdus_dl = flexran_get_size_dl_mac_sdus(mod_id, cc_id);
monapp->has_size_sdus_dl = 1;
monapp->size_sdus_ul = flexran_get_size_ul_mac_sdus(mod_id, cc_id); monapp->total_bytes_sdus_dl = flexran_get_total_size_dl_mac_sdus(mod_id, i, cc_id);
monapp->has_size_sdus_ul = 1; monapp->has_total_bytes_sdus_dl = 1;
monapp->total_size_sdus_dl = flexran_get_total_size_dl_mac_sdus(mod_id, i, cc_id); monapp->total_bytes_sdus_ul = flexran_get_total_size_ul_mac_sdus(mod_id, i, cc_id);
monapp->has_total_size_sdus_dl = 1; monapp->has_total_bytes_sdus_ul = 1;
monapp->total_size_sdus_ul = flexran_get_total_size_ul_mac_sdus(mod_id, i, cc_id);
monapp->has_total_size_sdus_ul = 1;
monapp->harq_round = flexran_get_harq_round(mod_id, cc_id, i); monapp->harq_round = flexran_get_harq_round(mod_id, cc_id, i);
monapp->has_harq_round = 1; monapp->has_harq_round = 1;
monapp->dl_tbs = flexran_get_TBS_dl(mod_id, i, cc_id); monapp->tbs_dl = flexran_get_TBS_dl(mod_id, i, cc_id);
monapp->has_dl_tbs = 1; monapp->has_tbs_dl = 1;
monapp->tbs_ul = flexran_get_TBS_ul(mod_id, i, cc_id);
monapp->has_tbs_ul = 1;
monapp->prb_retx_dl = flexran_get_num_prb_retx_dl_per_ue(mod_id, i, cc_id);
monapp->has_prb_retx_dl = 1;
monapp->prb_retx_ul = flexran_get_num_prb_retx_ul_per_ue(mod_id, i, cc_id);
monapp->has_prb_retx_ul = 1;
monapp->prb_dl = flexran_get_num_prb_dl_tx_per_ue(mod_id, i, cc_id);
monapp->has_prb_dl = 1;
monapp->prb_ul = flexran_get_num_prb_ul_rx_per_ue(mod_id, i, cc_id);
monapp->has_prb_ul = 1;
monapp->mcs1_dl = flexran_get_mcs1_dl(mod_id, i, cc_id);
monapp->has_mcs1_dl = 1;
monapp->mcs2_dl = flexran_get_mcs2_dl(mod_id, i, cc_id);
monapp->has_mcs2_dl = 1;
monapp->ul_tbs = flexran_get_TBS_ul(mod_id, i, cc_id); monapp->mcs1_ul = flexran_get_mcs1_ul(mod_id, i, cc_id);
monapp->has_ul_tbs = 1; monapp->has_mcs1_ul = 1;
monapp->prb_retx = flexran_get_num_prb_retx_per_ue(mod_id, i, cc_id); monapp->mcs2_ul = flexran_get_mcs2_ul(mod_id, i, cc_id);
monapp->has_prb_retx = 1; monapp->has_mcs2_ul = 1;
monapp->prb_tx = flexran_get_num_prb_dl_tx_per_ue(mod_id, i, cc_id); monapp->total_prb_dl = flexran_get_total_prb_dl_tx_per_ue(mod_id, i, cc_id);
monapp->has_prb_tx = 1; monapp->has_total_prb_dl = 1;
monapp->prb_rx = flexran_get_num_prb_ul_rx_per_ue(mod_id, i, cc_id); monapp->total_prb_ul = flexran_get_total_prb_ul_rx_per_ue(mod_id, i, cc_id);
monapp->has_prb_rx = 1; monapp->has_total_prb_ul = 1;
monapp->total_prb_tx = flexran_get_total_prb_dl_tx_per_ue(mod_id, i, cc_id); monapp->total_pdu_dl = flexran_get_total_num_pdu_dl(mod_id, i, cc_id);
monapp->has_total_prb_tx = 1; monapp->has_total_pdu_dl = 1;
monapp->total_prb_rx = flexran_get_total_prb_ul_rx_per_ue(mod_id, i, cc_id); monapp->total_pdu_ul = flexran_get_total_num_pdu_ul(mod_id, i, cc_id);
monapp->has_total_prb_rx = 1; monapp->has_total_pdu_ul = 1;
monapp->total_pdu_tx = flexran_get_total_num_pdu_dl(mod_id, i, cc_id); monapp->total_tbs_dl = flexran_get_total_TBS_dl(mod_id, i, cc_id);
monapp->has_total_pdu_tx = 1; monapp->has_total_tbs_dl = 1;
monapp->total_pdu_rx = flexran_get_total_num_pdu_ul(mod_id, i, cc_id); monapp->total_tbs_ul = flexran_get_total_TBS_ul(mod_id, i, cc_id);
monapp->has_total_pdu_rx = 1; monapp->has_total_tbs_dl = 1;
Protocol__FlexRecMacSdu ** mac_sdus; Protocol__FlexMacSdusDl ** mac_sdus;
mac_sdus = malloc(sizeof(Protocol__FlexRecMacSdu) * flexran_get_num_mac_sdu_tx(mod_id, i, cc_id)); mac_sdus = malloc(sizeof(Protocol__FlexMacSdusDl) * flexran_get_num_mac_sdu_tx(mod_id, i, cc_id));
if (mac_sdus == NULL) if (mac_sdus == NULL)
goto error; goto error;
monapp->n_rec_mac_sdu = flexran_get_num_mac_sdu_tx(mod_id, i, cc_id); monapp->n_mac_sdus_dl = flexran_get_num_mac_sdu_tx(mod_id, i, cc_id);
for (j = 0; j < monapp->n_rec_mac_sdu; j++){ for (j = 0; j < monapp->n_mac_sdus_dl; j++){
mac_sdus[j] = malloc(sizeof(Protocol__FlexRecMacSdu)); mac_sdus[j] = malloc(sizeof(Protocol__FlexMacSdusDl));
protocol__flex_rec_mac_sdu__init(mac_sdus[j]); protocol__flex_mac_sdus_dl__init(mac_sdus[j]);
mac_sdus[j]->lcid = flexran_get_mac_sdu_lcid_index(mod_id, i, cc_id, j); mac_sdus[j]->lcid = flexran_get_mac_sdu_lcid_index(mod_id, i, cc_id, j);
mac_sdus[j]->has_lcid = 1; mac_sdus[j]->has_lcid = 1;
...@@ -561,7 +577,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, ...@@ -561,7 +577,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
} }
monapp->rec_mac_sdu = mac_sdus; monapp->mac_sdus_dl = mac_sdus;
ue_report[i]->mon_app = monapp; ue_report[i]->mon_app = monapp;
......
...@@ -276,24 +276,31 @@ message flex_pdcp_stats { ...@@ -276,24 +276,31 @@ message flex_pdcp_stats {
message flex_mon_app { message flex_mon_app {
optional uint32 size_sdus_dl = 1; optional uint32 total_bytes_sdus_dl = 1;
optional uint32 size_sdus_ul = 2; optional uint32 total_bytes_sdus_ul = 2;
optional uint32 total_size_sdus_dl = 3; optional uint32 harq_round = 3;
optional uint32 total_size_sdus_ul = 4; optional uint32 tbs_dl = 4;
optional uint32 harq_round = 5; optional uint32 tbs_ul = 5;
optional uint32 dl_tbs = 6; optional uint32 prb_retx_dl = 6;
optional uint32 ul_tbs = 7; optional uint32 prb_retx_ul = 7;
optional uint32 prb_retx = 8; optional uint32 prb_dl = 8;
optional uint32 prb_tx = 9; optional uint32 prb_ul = 9;
optional uint32 prb_rx = 10; optional uint32 mcs1_dl = 10;
optional uint32 total_prb_tx = 11; optional uint32 mcs2_dl = 11;
optional uint32 total_prb_rx = 12; optional uint32 mcs1_ul = 12;
optional uint32 total_pdu_tx = 13; optional uint32 mcs2_ul = 13;
optional uint32 total_pdu_rx = 14; optional uint32 total_prb_retx_dl = 14;
repeated flex_rec_mac_sdu rec_mac_sdu = 15; optional uint32 total_prb_retx_ul = 15;
} optional uint32 total_prb_dl = 16;
optional uint32 total_prb_ul = 17;
message flex_rec_mac_sdu { optional uint32 total_pdu_dl = 18;
optional uint32 total_pdu_ul = 19;
optional uint32 total_tbs_dl = 20;
optional uint32 total_tbs_ul = 21;
repeated flex_mac_sdus_dl mac_sdus_dl = 22;
}
message flex_mac_sdus_dl {
optional uint32 sdu_length = 1; optional uint32 sdu_length = 1;
optional uint32 lcid = 2; optional uint32 lcid = 2;
......
...@@ -253,12 +253,6 @@ uint32_t flexran_get_mac_sdu_size(mid_t mod_id, mid_t ue_id, int cc_id, int lcid ...@@ -253,12 +253,6 @@ uint32_t flexran_get_mac_sdu_size(mid_t mod_id, mid_t ue_id, int cc_id, int lcid
} }
unsigned char flexran_get_mac_sdu_lcid(mid_t mod_id, mid_t ue_id, int cc_id, int lcid){
if (!mac_is_present(mod_id)) return 0;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].lcid_sdu[lcid];
}
unsigned char flexran_get_mac_sdu_lcid_index(mid_t mod_id, mid_t ue_id, int cc_id, int index){ unsigned char flexran_get_mac_sdu_lcid_index(mid_t mod_id, mid_t ue_id, int cc_id, int index){
if (!mac_is_present(mod_id)) return 0; if (!mac_is_present(mod_id)) return 0;
...@@ -266,7 +260,6 @@ unsigned char flexran_get_mac_sdu_lcid_index(mid_t mod_id, mid_t ue_id, int cc_i ...@@ -266,7 +260,6 @@ unsigned char flexran_get_mac_sdu_lcid_index(mid_t mod_id, mid_t ue_id, int cc_i
} }
uint32_t flexran_get_total_size_dl_mac_sdus(mid_t mod_id, mid_t ue_id, int cc_id){ uint32_t flexran_get_total_size_dl_mac_sdus(mid_t mod_id, mid_t ue_id, int cc_id){
if (!mac_is_present(mod_id)) return 0; if (!mac_is_present(mod_id)) return 0;
...@@ -323,14 +316,59 @@ uint32_t flexran_get_TBS_dl(mid_t mod_id, mid_t ue_id, int cc_id){ ...@@ -323,14 +316,59 @@ uint32_t flexran_get_TBS_dl(mid_t mod_id, mid_t ue_id, int cc_id){
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].TBS; return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].TBS;
} }
uint64_t flexran_get_total_TBS_dl(mid_t mod_id, mid_t ue_id, int cc_id){
if (!mac_is_present(mod_id)) return 0;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].total_pdu_bytes;
}
uint64_t flexran_get_total_TBS_ul(mid_t mod_id, mid_t ue_id, int cc_id){
if (!mac_is_present(mod_id)) return 0;
return /*TODO for uplink*/0;//UE_list->eNB_UE_stats[CC_id][UE_id].total_pdu_bytes;
}
uint8_t flexran_get_mcs1_dl(mid_t mod_id, mid_t ue_id, int cc_id){
if (!mac_is_present(mod_id)) return 0;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].dlsch_mcs1;
}
uint8_t flexran_get_mcs2_dl(mid_t mod_id, mid_t ue_id, int cc_id){
if (!mac_is_present(mod_id)) return 0;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].dlsch_mcs2;
}
uint8_t flexran_get_mcs1_ul(mid_t mod_id, mid_t ue_id, int cc_id){
if (!mac_is_present(mod_id)) return 0;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].ulsch_mcs1;
}
uint8_t flexran_get_mcs2_ul(mid_t mod_id, mid_t ue_id, int cc_id){
if (!mac_is_present(mod_id)) return 0;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].ulsch_mcs2;
}
uint16_t flexran_get_num_prb_retx_per_ue(mid_t mod_id, mid_t ue_id, uint32_t cc_id) { uint16_t flexran_get_num_prb_retx_dl_per_ue(mid_t mod_id, mid_t ue_id, uint32_t cc_id) {
if (!mac_is_present(mod_id)) return 0; if (!mac_is_present(mod_id)) return 0;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].rbs_used_retx; return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].rbs_used_retx;
} }
uint32_t flexran_get_num_prb_retx_ul_per_ue(mid_t mod_id, mid_t ue_id, uint32_t cc_id){
if (!mac_is_present(mod_id)) return 0;
return RC.mac[mod_id]->UE_list.eNB_UE_stats[cc_id][ue_id].rbs_used_retx_rx;
}
uint16_t flexran_get_num_prb_dl_tx_per_ue(mid_t mod_id, mid_t ue_id, uint32_t cc_id){ uint16_t flexran_get_num_prb_dl_tx_per_ue(mid_t mod_id, mid_t ue_id, uint32_t cc_id){
if (!mac_is_present(mod_id)) return 0; if (!mac_is_present(mod_id)) return 0;
......
...@@ -119,9 +119,6 @@ uint32_t flexran_get_mac_sdu_size(mid_t mod_id, mid_t ue_id, int cc_id, int lcid ...@@ -119,9 +119,6 @@ uint32_t flexran_get_mac_sdu_size(mid_t mod_id, mid_t ue_id, int cc_id, int lcid
/*Return number of MAC SDUs obtained in MAC layer*/ /*Return number of MAC SDUs obtained in MAC layer*/
uint32_t flexran_get_num_mac_sdu_tx(mid_t mod_id, mid_t ue_id, int cc_id); uint32_t flexran_get_num_mac_sdu_tx(mid_t mod_id, mid_t ue_id, int cc_id);
/*Get LCID MAC SDU*/
unsigned char flexran_get_mac_sdu_lcid(mid_t mod_id, mid_t ue_id, int cc_id, int lcid);
/*Get mac sdu lcid index*/ /*Get mac sdu lcid index*/
unsigned char flexran_get_mac_sdu_lcid_index(mid_t mod_id, mid_t ue_id, int cc_id, int index); unsigned char flexran_get_mac_sdu_lcid_index(mid_t mod_id, mid_t ue_id, int cc_id, int index);
......
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