Commit 6a6729bd authored by Robert Schmidt's avatar Robert Schmidt
Browse files

fix various compilaton errors due to merge

parent dfece3ff
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "assertions.h" #include "assertions.h"
#include "enb_app.h" #include "enb_app.h"
#if 0
void handle_reconfiguration(mid_t mod_id) void handle_reconfiguration(mid_t mod_id)
{ {
/* NOTE: this function might be extended by using stop_modem() /* NOTE: this function might be extended by using stop_modem()
...@@ -69,6 +70,7 @@ void handle_reconfiguration(mid_t mod_id) ...@@ -69,6 +70,7 @@ void handle_reconfiguration(mid_t mod_id)
LOG_I(ENB_APP, "lte-softmodem restart succeeded in %d ms\n", diff_ms); LOG_I(ENB_APP, "lte-softmodem restart succeeded in %d ms\n", diff_ms);
} }
} }
#endif
int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy_length) { int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy_length) {
...@@ -109,7 +111,8 @@ int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy ...@@ -109,7 +111,8 @@ int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy
if (parse_enb_id(mod_id, &parser) == -1) { if (parse_enb_id(mod_id, &parser) == -1) {
goto error; goto error;
} else { // succeful parse and setting } else { // succeful parse and setting
handle_reconfiguration(mod_id); /* TODO implement */
//handle_reconfiguration(mod_id);
} }
} else if (strcmp((char *) event.data.scalar.value, "mac") == 0) { } else if (strcmp((char *) event.data.scalar.value, "mac") == 0) {
LOG_D(ENB_APP, "This is intended for the mac system\n"); LOG_D(ENB_APP, "This is intended for the mac system\n");
...@@ -293,8 +296,7 @@ int parse_enb_config_parameters(mid_t mod_id, yaml_parser_t *parser) { ...@@ -293,8 +296,7 @@ int parse_enb_config_parameters(mid_t mod_id, yaml_parser_t *parser) {
yaml_event_delete(&event); yaml_event_delete(&event);
} }
/* reflect in RAN API */ /* TODO: reflect in RAN API */
flexran_set_enb_vars(mod_id, RAN_LTE_OAI);
return 0; return 0;
......
...@@ -800,6 +800,7 @@ typedef struct { ...@@ -800,6 +800,7 @@ typedef struct {
///Contention resolution timer used during random access ///Contention resolution timer used during random access
uint8_t mac_ContentionResolutionTimer; uint8_t mac_ContentionResolutionTimer;
/* TODO Navid MAX_NUM_LCID -> MAX_NUM_CCs? */
uint16_t max_rbs_allowed_slice[MAX_NUM_LCID][MAX_NUM_SLICES]; uint16_t max_rbs_allowed_slice[MAX_NUM_LCID][MAX_NUM_SLICES];
uint8_t max_mcs[MAX_NUM_LCID]; uint8_t max_mcs[MAX_NUM_LCID];
......
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
#include "flexran.pb-c.h" #include "flexran.pb-c.h"
#endif #endif
#include <dlfcn.h> #include <dlfcn.h>
#endif
#include "T.h" #include "T.h"
...@@ -449,7 +448,7 @@ set_ul_DAI(int module_idP, int UE_idP, int CC_idP, int frameP, ...@@ -449,7 +448,7 @@ set_ul_DAI(int module_idP, int UE_idP, int CC_idP, int frameP,
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void void
schedule_dlsch(module_id_ module_idP, schedule_dlsch(module_id_t module_idP,
frame_t frameP, sub_frame_t subframeP, int *mbsfn_flag) frame_t frameP, sub_frame_t subframeP, int *mbsfn_flag)
//------------------------------------------------------------------------------{ //------------------------------------------------------------------------------{
{ {
...@@ -466,7 +465,7 @@ schedule_dlsch(module_id_ module_idP, ...@@ -466,7 +465,7 @@ schedule_dlsch(module_id_ module_idP,
for (i = 0; i < n_active_slices; i++) { for (i = 0; i < n_active_slices; i++) {
if (slice_percentage[i] < 0 ){ if (slice_percentage[i] < 0 ){
LOG_W(MAC, "[eNB %d] frame %d subframe %d:invalid slice %d percentage %f. resetting to zero", LOG_W(MAC, "[eNB %d] frame %d subframe %d:invalid slice %d percentage %f. resetting to zero",
mod_id, frame, subframe, i, slice_percentage[i]); module_idP, frameP, subframeP, i, slice_percentage[i]);
slice_percentage[i]=0; slice_percentage[i]=0;
} }
total_slice_percentage+=slice_percentage[i]; total_slice_percentage+=slice_percentage[i];
...@@ -488,7 +487,7 @@ schedule_dlsch(module_id_ module_idP, ...@@ -488,7 +487,7 @@ schedule_dlsch(module_id_ module_idP,
if (n_active_slices_current != n_active_slices ){ if (n_active_slices_current != n_active_slices ){
if ((n_active_slices > 0) && (n_active_slices <= MAX_NUM_SLICES)) { if ((n_active_slices > 0) && (n_active_slices <= MAX_NUM_SLICES)) {
LOG_N(MAC,"[eNB %d]frame %d subframe %d: number of active DL slices has changed: %d-->%d\n", LOG_N(MAC,"[eNB %d]frame %d subframe %d: number of active DL slices has changed: %d-->%d\n",
mod_id, frame, subframe, n_active_slices_current, n_active_slices); module_idP, frameP, subframeP, n_active_slices_current, n_active_slices);
n_active_slices_current = n_active_slices; n_active_slices_current = n_active_slices;
...@@ -501,7 +500,7 @@ schedule_dlsch(module_id_ module_idP, ...@@ -501,7 +500,7 @@ schedule_dlsch(module_id_ module_idP,
// check if the slice rb share has changed, and log the console // check if the slice rb share has changed, and log the console
if (slice_percentage_current[i] != slice_percentage[i]){ // new slice percentage if (slice_percentage_current[i] != slice_percentage[i]){ // new slice percentage
LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: total percentage %f-->%f, slice RB percentage has changed: %f-->%f\n", LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: total percentage %f-->%f, slice RB percentage has changed: %f-->%f\n",
mod_id, i, frame, subframe, total_slice_percentage_current, total_slice_percentage, slice_percentage_current[i], slice_percentage[i]); module_idP, i, frameP, subframeP, total_slice_percentage_current, total_slice_percentage, slice_percentage_current[i], slice_percentage[i]);
total_slice_percentage_current= total_slice_percentage; total_slice_percentage_current= total_slice_percentage;
slice_percentage_current[i] = slice_percentage[i]; slice_percentage_current[i] = slice_percentage[i];
...@@ -511,10 +510,10 @@ schedule_dlsch(module_id_ module_idP, ...@@ -511,10 +510,10 @@ schedule_dlsch(module_id_ module_idP,
if (slice_maxmcs_current[i] != slice_maxmcs[i]){ if (slice_maxmcs_current[i] != slice_maxmcs[i]){
if ((slice_maxmcs[i] >= 0) && (slice_maxmcs[i] < 29)){ if ((slice_maxmcs[i] >= 0) && (slice_maxmcs[i] < 29)){
LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: slice MAX MCS has changed: %d-->%d\n", LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: slice MAX MCS has changed: %d-->%d\n",
mod_id, i, frame, subframe, slice_maxmcs_current[i], slice_maxmcs[i]); module_idP, i, frameP, subframeP, slice_maxmcs_current[i], slice_maxmcs[i]);
slice_maxmcs_current[i] = slice_maxmcs[i]; slice_maxmcs_current[i] = slice_maxmcs[i];
} else { } else {
LOG_W(MAC,"[eNB %d][SLICE %d][DL] invalid slice max mcs %d, revert the previous value %d\n",mod_id, i, slice_maxmcs[i],slice_maxmcs_current[i]); LOG_W(MAC,"[eNB %d][SLICE %d][DL] invalid slice max mcs %d, revert the previous value %d\n",module_idP, i, slice_maxmcs[i],slice_maxmcs_current[i]);
slice_maxmcs[i]= slice_maxmcs_current[i]; slice_maxmcs[i]= slice_maxmcs_current[i];
} }
} }
...@@ -522,7 +521,7 @@ schedule_dlsch(module_id_ module_idP, ...@@ -522,7 +521,7 @@ schedule_dlsch(module_id_ module_idP,
// check if a new scheduler, and log the console // check if a new scheduler, and log the console
if (update_dl_scheduler_current[i] != update_dl_scheduler[i]){ if (update_dl_scheduler_current[i] != update_dl_scheduler[i]){
LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: DL scheduler for this slice is updated: %s \n", LOG_N(MAC,"[eNB %d][SLICE %d][DL] frame %d subframe %d: DL scheduler for this slice is updated: %s \n",
mod_id, i, frame, subframe, dl_scheduler_type[i]); module_idP, i, frameP, subframeP, dl_scheduler_type[i]);
update_dl_scheduler_current[i] = update_dl_scheduler[i]; update_dl_scheduler_current[i] = update_dl_scheduler[i];
} }
...@@ -531,16 +530,14 @@ schedule_dlsch(module_id_ module_idP, ...@@ -531,16 +530,14 @@ schedule_dlsch(module_id_ module_idP,
if (n_active_slices == n_active_slices_current){ if (n_active_slices == n_active_slices_current){
LOG_W(MAC,"[eNB %d][SLICE %d][DL] invalid total RB share (%f->%f), reduce proportionally the RB share by 0.1\n", LOG_W(MAC,"[eNB %d][SLICE %d][DL] invalid total RB share (%f->%f), reduce proportionally the RB share by 0.1\n",
mod_id,i, module_idP, i, total_slice_percentage_current, total_slice_percentage);
total_slice_percentage_current, total_slice_percentage);
if (slice_percentage[i] >= avg_slice_percentage){ if (slice_percentage[i] >= avg_slice_percentage){
slice_percentage[i]-=0.1; slice_percentage[i]-=0.1;
total_slice_percentage-=0.1; total_slice_percentage-=0.1;
} }
} else { } else {
LOG_W(MAC,"[eNB %d][SLICE %d][DL] invalid total RB share (%f->%f), revert the number of slice to its previous value (%d->%d)\n", LOG_W(MAC,"[eNB %d][SLICE %d][DL] invalid total RB share (%f->%f), revert the number of slice to its previous value (%d->%d)\n",
mod_id,i, module_idP, i, total_slice_percentage_current, total_slice_percentage,
total_slice_percentage_current, total_slice_percentage,
n_active_slices, n_active_slices_current ); n_active_slices, n_active_slices_current );
n_active_slices = n_active_slices_current; n_active_slices = n_active_slices_current;
slice_percentage[i] = slice_percentage_current[i]; slice_percentage[i] = slice_percentage_current[i];
...@@ -548,7 +545,8 @@ schedule_dlsch(module_id_ module_idP, ...@@ -548,7 +545,8 @@ schedule_dlsch(module_id_ module_idP,
} }
// Run each enabled slice-specific schedulers one by one // Run each enabled slice-specific schedulers one by one
slice_sched_dl[i](mod_id, i, frame, subframe, mbsfn_flag,dl_info); /* TODO Navid took out the dl_info additional information */
slice_sched_dl[i](module_idP, i, frameP, subframeP, mbsfn_flag/*, dl_info*/);
} }
} }
...@@ -806,7 +804,7 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP, ...@@ -806,7 +804,7 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP,
*/ */
eNB_UE_stats->dlsch_mcs1 = eNB_UE_stats->dlsch_mcs1 =
cqi_to_mcs[ue_sched_ctl->dl_cqi[CC_id]]; cqi_to_mcs[ue_sched_ctl->dl_cqi[CC_id]];
eNB_UE_stats->dlsch_mcs1 =cmin(eNB_UE_stats->dlsch_mcs1, flexran_slice_maxmcs(slice_idP));//openair_daq_vars.target_ue_dl_mcs); eNB_UE_stats->dlsch_mcs1 =cmin(eNB_UE_stats->dlsch_mcs1, slice_maxmcs[slice_idP]);//openair_daq_vars.target_ue_dl_mcs);
// store stats // store stats
......
...@@ -61,6 +61,8 @@ ...@@ -61,6 +61,8 @@
#define ENABLE_MAC_PAYLOAD_DEBUG #define ENABLE_MAC_PAYLOAD_DEBUG
#define DEBUG_eNB_SCHEDULER 1 #define DEBUG_eNB_SCHEDULER 1
extern int n_active_slices;
int choose(int n, int k) int choose(int n, int k)
{ {
int res = 1; int res = 1;
...@@ -1927,7 +1929,7 @@ int UE_num_active_CC(UE_list_t * listP, int ue_idP) ...@@ -1927,7 +1929,7 @@ int UE_num_active_CC(UE_list_t * listP, int ue_idP)
int UE_PCCID(module_id_t mod_idP, int ue_idP) int UE_PCCID(module_id_t mod_idP, int ue_idP)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
if (RC.mac[mod_idP] == NULL) return 0; if (!RC.mac || !RC.mac[mod_idP]) return 0;
return (RC.mac[mod_idP]->UE_list.pCC_id[ue_idP]); return (RC.mac[mod_idP]->UE_list.pCC_id[ue_idP]);
} }
...@@ -1935,7 +1937,7 @@ int UE_PCCID(module_id_t mod_idP, int ue_idP) ...@@ -1935,7 +1937,7 @@ int UE_PCCID(module_id_t mod_idP, int ue_idP)
rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP) rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
if (RC.mac[mod_idP] == NULL) return 0; if (!RC.mac || !RC.mac[mod_idP]) return 0;
rnti_t rnti = rnti_t rnti =
RC.mac[mod_idP]-> RC.mac[mod_idP]->
UE_list.UE_template[UE_PCCID(mod_idP, ue_idP)][ue_idP].rnti; UE_list.UE_template[UE_PCCID(mod_idP, ue_idP)][ue_idP].rnti;
...@@ -1953,7 +1955,7 @@ rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP) ...@@ -1953,7 +1955,7 @@ rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP)
boolean_t is_UE_active(module_id_t mod_idP, int ue_idP) boolean_t is_UE_active(module_id_t mod_idP, int ue_idP)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
if (RC.mac[mod_idP] == NULL) return 0; if (!RC.mac || !RC.mac[mod_idP]) return 0;
return (RC.mac[mod_idP]->UE_list.active[ue_idP]); return (RC.mac[mod_idP]->UE_list.active[ue_idP]);
} }
......
...@@ -63,8 +63,8 @@ ...@@ -63,8 +63,8 @@
#include "header.pb-c.h" #include "header.pb-c.h"
#include "flexran.pb-c.h" #include "flexran.pb-c.h"
#include "flexran_agent_mac.h" #include "flexran_agent_mac.h"
#include <dlfcn.h>
#endif #endif
#include <dlfcn.h>
#include "T.h" #include "T.h"
...@@ -943,13 +943,13 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header, ...@@ -943,13 +943,13 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header,
* (done below in schedule_ulsch). * (done below in schedule_ulsch).
*/ */
void void
set_msg3_subframe(module_id_t Mod_id, set_msg3_subframe(module_id_t mod_id,
int CC_id, int CC_id,
int frame, int frame,
int subframe, int rnti, int Msg3_frame, int subframe, int rnti, int Msg3_frame,
int Msg3_subframe) int Msg3_subframe)
{ {
eNB_MAC_INST *mac = RC.mac[Mod_id]; eNB_MAC_INST *mac = RC.mac[mod_id];
int i; int i;
for (i = 0; i < NB_RA_PROC_MAX; i++) { for (i = 0; i < NB_RA_PROC_MAX; i++) {
if (mac->common_channels[CC_id].ra[i].state != IDLE && if (mac->common_channels[CC_id].ra[i].state != IDLE &&
...@@ -1086,7 +1086,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1086,7 +1086,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
for (i = 0; i < n_active_slices_uplink; i++) { for (i = 0; i < n_active_slices_uplink; i++) {
if (slice_percentage_uplink[i] < 0 ){ if (slice_percentage_uplink[i] < 0 ){
LOG_W(MAC, "[eNB %d] frame %d subframe %d:invalid slice %d percentage %f. resetting to zero", LOG_W(MAC, "[eNB %d] frame %d subframe %d:invalid slice %d percentage %f. resetting to zero",
mod_id, frame, subframe, i, slice_percentage_uplink[i]); module_idP, frameP, subframeP, i, slice_percentage_uplink[i]);
slice_percentage_uplink[i]=0; slice_percentage_uplink[i]=0;
} }
total_slice_percentage_uplink+=slice_percentage_uplink[i]; total_slice_percentage_uplink+=slice_percentage_uplink[i];
...@@ -1112,7 +1112,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1112,7 +1112,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
if (n_active_slices_current_uplink != n_active_slices_uplink ){ if (n_active_slices_current_uplink != n_active_slices_uplink ){
if ((n_active_slices_uplink > 0) && (n_active_slices_uplink <= MAX_NUM_SLICES)) { if ((n_active_slices_uplink > 0) && (n_active_slices_uplink <= MAX_NUM_SLICES)) {
LOG_N(MAC,"[eNB %d]frame %d subframe %d: number of active UL slices has changed: %d-->%d\n", LOG_N(MAC,"[eNB %d]frame %d subframe %d: number of active UL slices has changed: %d-->%d\n",
mod_id, frame, subframe, n_active_slices_current_uplink, n_active_slices_uplink); module_idP, frameP, subframeP, n_active_slices_current_uplink, n_active_slices_uplink);
n_active_slices_current_uplink = n_active_slices_uplink; n_active_slices_current_uplink = n_active_slices_uplink;
...@@ -1125,7 +1125,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1125,7 +1125,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
// check if the slice rb share has changed, and log the console // check if the slice rb share has changed, and log the console
if (slice_percentage_current_uplink[i] != slice_percentage_uplink[i]){ if (slice_percentage_current_uplink[i] != slice_percentage_uplink[i]){
LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: total percentage %f-->%f, slice RB percentage has changed: %f-->%f\n", LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: total percentage %f-->%f, slice RB percentage has changed: %f-->%f\n",
mod_id, i, frame, subframe, total_slice_percentage_current_uplink, total_slice_percentage_uplink, slice_percentage_current_uplink[i], slice_percentage_uplink[i]); module_idP, i, frameP, subframeP, total_slice_percentage_current_uplink, total_slice_percentage_uplink, slice_percentage_current_uplink[i], slice_percentage_uplink[i]);
total_slice_percentage_current_uplink= total_slice_percentage_uplink; total_slice_percentage_current_uplink= total_slice_percentage_uplink;
slice_percentage_current_uplink[i] = slice_percentage_uplink[i]; slice_percentage_current_uplink[i] = slice_percentage_uplink[i];
...@@ -1135,10 +1135,10 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1135,10 +1135,10 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
if (slice_maxmcs_current_uplink[i] != slice_maxmcs_uplink[i]){ if (slice_maxmcs_current_uplink[i] != slice_maxmcs_uplink[i]){
if ((slice_maxmcs_uplink[i] >= 0) && (slice_maxmcs_uplink[i] <= 16)){ if ((slice_maxmcs_uplink[i] >= 0) && (slice_maxmcs_uplink[i] <= 16)){
LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: slice MAX MCS has changed: %d-->%d\n", LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: slice MAX MCS has changed: %d-->%d\n",
mod_id, i, frame, subframe, slice_maxmcs_current_uplink[i], slice_maxmcs_uplink[i]); module_idP, i, frameP, subframeP, slice_maxmcs_current_uplink[i], slice_maxmcs_uplink[i]);
slice_maxmcs_current_uplink[i] = slice_maxmcs_uplink[i]; slice_maxmcs_current_uplink[i] = slice_maxmcs_uplink[i];
} else { } else {
LOG_W(MAC,"[eNB %d][SLICE %d][UL] invalid slice max mcs %d, revert the previous value %d\n",mod_id, i, slice_maxmcs_uplink[i],slice_maxmcs_current_uplink[i]); LOG_W(MAC,"[eNB %d][SLICE %d][UL] invalid slice max mcs %d, revert the previous value %d\n",module_idP, i, slice_maxmcs_uplink[i],slice_maxmcs_current_uplink[i]);
slice_maxmcs_uplink[i]= slice_maxmcs_current_uplink[i]; slice_maxmcs_uplink[i]= slice_maxmcs_current_uplink[i];
} }
...@@ -1147,7 +1147,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1147,7 +1147,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
// check if a new scheduler, and log the console // check if a new scheduler, and log the console
if (update_ul_scheduler_current[i] != update_ul_scheduler[i]){ if (update_ul_scheduler_current[i] != update_ul_scheduler[i]){
LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: UL scheduler for this slice is updated: %s \n", LOG_N(MAC,"[eNB %d][SLICE %d][UL] frame %d subframe %d: UL scheduler for this slice is updated: %s \n",
mod_id, i, frame, subframe, ul_scheduler_type[i]); module_idP, i, frameP, subframeP, ul_scheduler_type[i]);
update_ul_scheduler_current[i] = update_ul_scheduler[i]; update_ul_scheduler_current[i] = update_ul_scheduler[i];
} }
...@@ -1156,8 +1156,8 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1156,8 +1156,8 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
if (n_active_slices_uplink == n_active_slices_current_uplink){ if (n_active_slices_uplink == n_active_slices_current_uplink){
LOG_W(MAC,"[eNB %d][SLICE %d][UL] invalid total RB share (%f->%f), reduce proportionally the RB share by 0.1\n", LOG_W(MAC,"[eNB %d][SLICE %d][UL] invalid total RB share (%f->%f), reduce proportionally the RB share by 0.1\n",
mod_id,i, module_idP, i, total_slice_percentage_current_uplink,
total_slice_percentage_current_uplink, total_slice_percentage_uplink); total_slice_percentage_uplink);
if (slice_percentage_uplink[i] > avg_slice_percentage_uplink){ if (slice_percentage_uplink[i] > avg_slice_percentage_uplink){
slice_percentage_uplink[i]-=0.1; slice_percentage_uplink[i]-=0.1;
total_slice_percentage_uplink-=0.1; total_slice_percentage_uplink-=0.1;
...@@ -1165,9 +1165,9 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1165,9 +1165,9 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
} else { } else {
// here we can correct the values, e.g. reduce proportionally // here we can correct the values, e.g. reduce proportionally
LOG_W(MAC,"[eNB %d][SLICE %d][UL] invalid total RB share (%f->%f), revert the number of slice to its previous value (%d->%d)\n", LOG_W(MAC,"[eNB %d][SLICE %d][UL] invalid total RB share (%f->%f), revert the number of slice to its previous value (%d->%d)\n",
mod_id,i, module_idP, i, total_slice_percentage_current_uplink,
total_slice_percentage_current_uplink, total_slice_percentage_uplink, total_slice_percentage_uplink, n_active_slices_uplink,
n_active_slices_uplink, n_active_slices_current_uplink); n_active_slices_current_uplink);
n_active_slices_uplink = n_active_slices_current_uplink; n_active_slices_uplink = n_active_slices_current_uplink;
slice_percentage_uplink[i] = slice_percentage_current_uplink[i]; slice_percentage_uplink[i] = slice_percentage_current_uplink[i];
} }
......
...@@ -57,6 +57,8 @@ ...@@ -57,6 +57,8 @@
#define DEBUG_HEADER_PARSING 1 #define DEBUG_HEADER_PARSING 1
//#define DEBUG_PACKET_TRACE 1 //#define DEBUG_PACKET_TRACE 1
extern float slice_percentage[MAX_NUM_SLICES];
//#define ICIC 0 //#define ICIC 0
/* /*
...@@ -267,7 +269,8 @@ assign_rbs_required(module_id_t Mod_id, ...@@ -267,7 +269,8 @@ assign_rbs_required(module_id_t Mod_id,
to_prb(RC.mac[Mod_id]->common_channels[CC_id]. to_prb(RC.mac[Mod_id]->common_channels[CC_id].
mib->message.dl_Bandwidth); mib->message.dl_Bandwidth);
UE_list->ue_sched_ctl.max_allowed_rbs[CC_id][slice_id]= flexran_nb_rbs_allowed_slice(slice_percentage[slice_id],N_RB_DL); /* TODO Navid: field max_rbs_allowed_slice is [MAX_NUM_LCID][MAX_NUM_SLICES] -> Why CC_id? or bug in definition? */
UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_id]= flexran_nb_rbs_allowed_slice(slice_percentage[slice_id],N_RB_DL);
/* calculating required number of RBs for each UE */ /* calculating required number of RBs for each UE */
while (TBS < while (TBS <
...@@ -275,10 +278,13 @@ assign_rbs_required(module_id_t Mod_id, ...@@ -275,10 +278,13 @@ assign_rbs_required(module_id_t Mod_id,
dl_buffer_total) { dl_buffer_total) {
nb_rbs_required[CC_id][UE_id] += min_rb_unit[CC_id]; nb_rbs_required[CC_id][UE_id] += min_rb_unit[CC_id];
if (nb_rbs_required[CC_id][UE_id] > UE_list->ue_sched_ctl.max_allowed_rbs[CC_id][slice_id]) { /* TODO Navid: field max_rbs_allowed_slice is [MAX_NUM_LCID][MAX_NUM_SLICES] -> Why CC_id? or bug in definition? */
if (nb_rbs_required[CC_id][UE_id] > UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_id]) {
TBS = TBS =
get_TBS_DL(eNB_UE_stats->dlsch_mcs1, UE_list->ue_sched_ctl.max_allowed_rbs[CC_id][slice_id]); /* TODO Navid: field max_rbs_allowed_slice is [MAX_NUM_LCID][MAX_NUM_SLICES] -> Why CC_id? or bug in definition? */
nb_rbs_required[CC_id][UE_id] = UE_list->ue_sched_ctl.max_allowed_rbs[CC_id][slice_id]; get_TBS_DL(eNB_UE_stats->dlsch_mcs1, UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_id]);
/* TODO Navid: field max_rbs_allowed_slice is [MAX_NUM_LCID][MAX_NUM_SLICES] -> Why CC_id? */
nb_rbs_required[CC_id][UE_id] = UE_list->UE_sched_ctrl[UE_id].max_rbs_allowed_slice[CC_id][slice_id];
break; break;
} }
...@@ -614,7 +620,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -614,7 +620,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
if (UE_list->active[i] != TRUE) if (UE_list->active[i] != TRUE)
continue; continue;
if (!flexran_slice_member(UE_id, slice_id)) if (!flexran_slice_member(i, slice_id))
continue; continue;
UE_id = i; UE_id = i;
...@@ -724,13 +730,15 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -724,13 +730,15 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
message.dl_Bandwidth) - total_rbs_used[CC_id]; message.dl_Bandwidth) - total_rbs_used[CC_id];
//recalcualte based on the what is left after retransmission //recalcualte based on the what is left after retransmission
ue_sched_ctl.max_allowed_rbs[CC_id][slice_id]= flexran_nb_rbs_allowed_slice(slice_percentage[slice_id],N_RB_DL); ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
/* TODO Navid: as above */
ue_sched_ctl->max_rbs_allowed_slice[CC_id][slice_id]= flexran_nb_rbs_allowed_slice(slice_percentage[slice_id],N_RB_DL);
if (total_ue_count[CC_id] == 0) { if (total_ue_count[CC_id] == 0) {
average_rbs_per_user[CC_id] = 0; average_rbs_per_user[CC_id] = 0;
} else if ((min_rb_unit[CC_id] * total_ue_count[CC_id]) <= (ue_sched_ctl.max_allowed_rbs[CC_id][slice_id])) { } else if ((min_rb_unit[CC_id] * total_ue_count[CC_id]) <= (ue_sched_ctl->max_rbs_allowed_slice[CC_id][slice_id])) {
average_rbs_per_user[CC_id] = average_rbs_per_user[CC_id] =
(uint16_t) floor(ue_sched_ctl.max_allowed_rbs[CC_id][slice_id] / total_ue_count[CC_id]); (uint16_t) floor(ue_sched_ctl->max_rbs_allowed_slice[CC_id][slice_id] / total_ue_count[CC_id]);
} else { } else {
average_rbs_per_user[CC_id] = min_rb_unit[CC_id]; // consider the total number of use that can be scheduled UE average_rbs_per_user[CC_id] = min_rb_unit[CC_id]; // consider the total number of use that can be scheduled UE
} }
...@@ -1390,7 +1398,7 @@ ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1390,7 +1398,7 @@ ulsch_scheduler_pre_processor(module_id_t module_idP,
int N_RB_UL; int N_RB_UL;
LOG_D(MAC, "In ulsch_preprocessor: assign max mcs min rb\n"); LOG_D(MAC, "In ulsch_preprocessor: assign max mcs min rb\n");
// maximize MCS and then allocate required RB according to the buffer occupancy with the limit of max available UL RB // maximize MCS and then allocate required RB according to the buffer occupancy with the limit of max available UL RB
assign_max_mcs_min_rb(module_idP, frameP, subframeP, first_rb); assign_max_mcs_min_rb(module_idP, slice_id, frameP, subframeP, first_rb);
LOG_D(MAC, "In ulsch_preprocessor: sort ue \n"); LOG_D(MAC, "In ulsch_preprocessor: sort ue \n");
// sort ues // sort ues
......
...@@ -217,6 +217,8 @@ void dlsch_scheduler_pre_processor_reset(int module_idP, int UE_id, ...@@ -217,6 +217,8 @@ void dlsch_scheduler_pre_processor_reset(int module_idP, int UE_id,
uint16_t uint16_t
nb_rbs_required_remaining nb_rbs_required_remaining
[MAX_NUM_CCs][NUMBER_OF_UE_MAX], [MAX_NUM_CCs][NUMBER_OF_UE_MAX],
unsigned char total_ue_count[MAX_NUM_CCs],
unsigned char total_rbs_used[MAX_NUM_CCs],
unsigned char unsigned char
rballoc_sub[MAX_NUM_CCs] rballoc_sub[MAX_NUM_CCs]
[N_RBG_MAX], [N_RBG_MAX],
...@@ -665,7 +667,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, slice_id_t slice_id, ...@@ -665,7 +667,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, slice_id_t slice_id,
void store_ulsch_buffer(module_id_t module_idP, int frameP, void store_ulsch_buffer(module_id_t module_idP, int frameP,
sub_frame_t subframeP); sub_frame_t subframeP);
void sort_ue_ul(module_id_t module_idP, int frameP, sub_frame_t subframeP); void sort_ue_ul(module_id_t module_idP, int frameP, sub_frame_t subframeP);
void assign_max_mcs_min_rb(module_id_t module_idP, int frameP, void assign_max_mcs_min_rb(module_id_t module_idP, int slice_id, int frameP,
sub_frame_t subframeP, uint16_t * first_rb); sub_frame_t subframeP, uint16_t * first_rb);
void adjust_bsr_info(int buffer_occupancy, uint16_t TBS, void adjust_bsr_info(int buffer_occupancy, uint16_t TBS,
UE_TEMPLATE * UE_template); UE_TEMPLATE * UE_template);
......
...@@ -2156,7 +2156,7 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt ...@@ -2156,7 +2156,7 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt
int i; int i;
// configure SRB1/SRB2, PhysicalConfigDedicated, MAC_MainConfig for UE // configure SRB1/SRB2, PhysicalConfigDedicated, MAC_MainConfig for UE
eNB_RRC_INST* rrc_inst = &eNB_rrc_inst[ctxt_pP->module_id]; eNB_RRC_INST* rrc_inst = RC.rrc[ctxt_pP->module_id];
struct PhysicalConfigDedicated** physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated; struct PhysicalConfigDedicated** physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated;
struct SRB_ToAddMod *SRB2_config = NULL; struct SRB_ToAddMod *SRB2_config = NULL;
......
...@@ -239,9 +239,7 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -239,9 +239,7 @@ static void* eNB_thread_rxtx( void* param ) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
#ifdef DEBUG_THREADS LOG_D(PHY, " *** Exiting eNB thread RXn_TXnp4\n");
printf(" *** Exiting eNB thread RXn_TXnp4\n");
#endif
eNB_thread_rxtx_status = 0; eNB_thread_rxtx_status = 0;
return &eNB_thread_rxtx_status; return &eNB_thread_rxtx_status;
...@@ -624,8 +622,6 @@ void init_eNB_proc(int inst) { ...@@ -624,8 +622,6 @@ void init_eNB_proc(int inst) {
pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL); pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL);
pthread_mutex_init( &proc->mutex_RU,NULL); pthread_mutex_init( &proc->mutex_RU,NULL);
pthread_mutex_init( &proc->mutex_RU_PRACH,NULL); pthread_mutex_init( &proc->mutex_RU_PRACH,NULL);
pthread_mutex_init( &proc->mutex_synch,NULL);
pthread_mutex_init( &proc->mutex_FH, NULL);
pthread_cond_init( &proc->cond_prach, NULL); pthread_cond_init( &proc->cond_prach, NULL);
pthread_cond_init( &proc->cond_asynch_rxtx, NULL);