Commit 048c4d29 authored by Robert Schmidt's avatar Robert Schmidt
Browse files

add slice association in UE_list, test against it in slice_membership()

parent 58c2a006
...@@ -763,7 +763,7 @@ schedule_ue_spec(module_id_t module_idP, slice_id_t slice_idP, ...@@ -763,7 +763,7 @@ schedule_ue_spec(module_id_t module_idP, slice_id_t slice_idP,
continue_flag = 1; continue_flag = 1;
} }
if (!ue_slice_membership(UE_id, slice_idP, RC.mac[module_idP]->slice_info.n_dl)) if (!ue_dl_slice_membership(module_idP, UE_id, slice_idP))
continue; continue;
if (continue_flag != 1) { if (continue_flag != 1) {
......
...@@ -1961,6 +1961,9 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP, int harq_pidP ...@@ -1961,6 +1961,9 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP, int harq_pidP
sizeof(eNB_UE_STATS)); sizeof(eNB_UE_STATS));
UE_list->UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 0; UE_list->UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 0;
/* default slice in case there was something different */
UE_list->assoc_dl_slice[UE_id] = 0;
UE_list->assoc_ul_slice[UE_id] = 0;
UE_list->UE_sched_ctrl[UE_id].ta_update = 31; UE_list->UE_sched_ctrl[UE_id].ta_update = 31;
...@@ -4539,14 +4542,24 @@ uint16_t nb_rbs_allowed_slice(float rb_percentage, int total_rbs) ...@@ -4539,14 +4542,24 @@ uint16_t nb_rbs_allowed_slice(float rb_percentage, int total_rbs)
return (uint16_t) floor(rb_percentage * total_rbs); return (uint16_t) floor(rb_percentage * total_rbs);
} }
int ue_slice_membership(int UE_id, int slice_id, int n_active_slices) int ue_dl_slice_membership(module_id_t mod_id, int UE_id, slice_id_t slice_id)
{ {
if ((slice_id < 0) || (slice_id > n_active_slices)) if ((slice_id < 0)
|| (slice_id >= RC.mac[mod_id]->slice_info.n_dl)) {
LOG_W(MAC, "out of range slice id %d\n", slice_id); LOG_W(MAC, "out of range slice id %d\n", slice_id);
return 0;
}
return RC.mac[mod_id]->UE_list.active[UE_id] == TRUE
&& RC.mac[mod_id]->UE_list.assoc_dl_slice[UE_id] == slice_id;
}
int ue_ul_slice_membership(module_id_t mod_id, int UE_id, slice_id_t slice_id)
if ((UE_id % n_active_slices) == slice_id) { {
return 1; // this ue is a member of this slice if ((slice_id < 0)
|| (slice_id >= RC.mac[mod_id]->slice_info.n_ul)) {
LOG_W(MAC, "out of range slice id %d\n", slice_id);
return 0;
} }
return 0; return RC.mac[mod_id]->UE_list.active[UE_id] == TRUE
&& RC.mac[mod_id]->UE_list.assoc_ul_slice[UE_id] == slice_id;
} }
...@@ -1214,7 +1214,7 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1214,7 +1214,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
for (UE_id = UE_list->head_ul; UE_id >= 0; for (UE_id = UE_list->head_ul; UE_id >= 0;
UE_id = UE_list->next_ul[UE_id]) { UE_id = UE_list->next_ul[UE_id]) {
if (!ue_slice_membership(UE_id, slice_id, sli->n_ul)) if (!ue_ul_slice_membership(module_idP, UE_id, slice_id))
continue; continue;
// don't schedule if Msg4 is not received yet // don't schedule if Msg4 is not received yet
......
...@@ -1104,6 +1104,9 @@ typedef struct { ...@@ -1104,6 +1104,9 @@ typedef struct {
uint16_t sorting_criteria[MAX_NUM_SLICES][CR_NUM]; uint16_t sorting_criteria[MAX_NUM_SLICES][CR_NUM];
uint16_t first_rb_offset[NFAPI_CC_MAX][MAX_NUM_SLICES]; uint16_t first_rb_offset[NFAPI_CC_MAX][MAX_NUM_SLICES];
slice_id_t assoc_dl_slice[MAX_MOBILES_PER_ENB];
slice_id_t assoc_ul_slice[MAX_MOBILES_PER_ENB];
} UE_list_t; } UE_list_t;
/*! \brief deleting control information*/ /*! \brief deleting control information*/
......
...@@ -1262,7 +1262,8 @@ void pre_scd_nb_rbs_required( module_id_t module_idP, ...@@ -1262,7 +1262,8 @@ void pre_scd_nb_rbs_required( module_id_t module_idP,
/*Slice related functions */ /*Slice related functions */
uint16_t nb_rbs_allowed_slice(float rb_percentage, int total_rbs); uint16_t nb_rbs_allowed_slice(float rb_percentage, int total_rbs);
int ue_slice_membership(int UE_id, int slice_id, int n_active_slices); int ue_dl_slice_membership(module_id_t mod_id, int UE_id, slice_id_t slice_id);
int ue_ul_slice_membership(module_id_t mod_id, int UE_id, slice_id_t slice_id);
/* from here: prototypes to get rid of compilation warnings: doc to be written by function author */ /* from here: prototypes to get rid of compilation warnings: doc to be written by function author */
uint8_t ul_subframe2_k_phich(COMMON_channels_t * cc, sub_frame_t ul_subframe); uint8_t ul_subframe2_k_phich(COMMON_channels_t * cc, sub_frame_t ul_subframe);
......
...@@ -102,7 +102,7 @@ store_dlsch_buffer(module_id_t Mod_id, ...@@ -102,7 +102,7 @@ store_dlsch_buffer(module_id_t Mod_id,
if (UE_list->active[UE_id] != TRUE) if (UE_list->active[UE_id] != TRUE)
continue; continue;
if (!ue_slice_membership(UE_id, slice_id, RC.mac[Mod_id]->slice_info.n_dl)) if (!ue_dl_slice_membership(Mod_id, UE_id, slice_id))
continue; continue;
UE_template = &UE_list->UE_template[UE_PCCID(Mod_id, UE_id)][UE_id]; UE_template = &UE_list->UE_template[UE_PCCID(Mod_id, UE_id)][UE_id];
...@@ -192,7 +192,7 @@ assign_rbs_required(module_id_t Mod_id, ...@@ -192,7 +192,7 @@ assign_rbs_required(module_id_t Mod_id,
// clear rb allocations across all CC_id // clear rb allocations across all CC_id
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
if (UE_list->active[UE_id] != TRUE) continue; if (UE_list->active[UE_id] != TRUE) continue;
if (!ue_slice_membership(UE_id, slice_id, sli->n_dl)) continue; if (!ue_dl_slice_membership(Mod_id, UE_id, slice_id)) continue;
pCCid = UE_PCCID(Mod_id, UE_id); pCCid = UE_PCCID(Mod_id, UE_id);
//update CQI information across component carriers //update CQI information across component carriers
...@@ -478,7 +478,7 @@ void sort_UEs(module_id_t Mod_idP, slice_id_t slice_id, int frameP, sub_frame_t ...@@ -478,7 +478,7 @@ void sort_UEs(module_id_t Mod_idP, slice_id_t slice_id, int frameP, sub_frame_t
if (UE_list->active[i] == FALSE) continue; if (UE_list->active[i] == FALSE) continue;
if (UE_RNTI(Mod_idP, i) == NOT_A_RNTI) continue; if (UE_RNTI(Mod_idP, i) == NOT_A_RNTI) continue;
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) continue; if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) continue;
if (!ue_slice_membership(i, slice_id, RC.mac[Mod_idP]->slice_info.n_dl)) continue; if (!ue_dl_slice_membership(Mod_idP, i, slice_id)) continue;
list[list_size] = i; list[list_size] = i;
list_size++; list_size++;
...@@ -582,7 +582,7 @@ void dlsch_scheduler_pre_processor_partitioning(module_id_t Mod_id, ...@@ -582,7 +582,7 @@ void dlsch_scheduler_pre_processor_partitioning(module_id_t Mod_id,
if (UE_RNTI(Mod_id, UE_id) == NOT_A_RNTI) continue; if (UE_RNTI(Mod_id, UE_id) == NOT_A_RNTI) continue;
if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue;
if (!ue_slice_membership(UE_id, slice_id, RC.mac[Mod_id]->slice_info.n_dl)) continue; if (!ue_dl_slice_membership(Mod_id, UE_id, slice_id)) continue;
ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
...@@ -620,7 +620,6 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, ...@@ -620,7 +620,6 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
uint8_t ue_retx_flag[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB]; uint8_t ue_retx_flag[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
slice_info_t *sli = &RC.mac[Mod_id]->slice_info;
UE_sched_ctrl *ue_sched_ctl; UE_sched_ctrl *ue_sched_ctl;
COMMON_channels_t *cc; COMMON_channels_t *cc;
...@@ -641,7 +640,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, ...@@ -641,7 +640,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
rnti = UE_RNTI(Mod_id, UE_id); rnti = UE_RNTI(Mod_id, UE_id);
if (rnti == NOT_A_RNTI) continue; if (rnti == NOT_A_RNTI) continue;
if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue;
if (!ue_slice_membership(UE_id, slice_id, sli->n_dl)) continue; if (!ue_dl_slice_membership(Mod_id, UE_id, slice_id)) continue;
for (i = 0; i < UE_num_active_CC(UE_list, UE_id); ++i) { for (i = 0; i < UE_num_active_CC(UE_list, UE_id); ++i) {
CC_id = UE_list->ordered_CCids[i][UE_id]; CC_id = UE_list->ordered_CCids[i][UE_id];
...@@ -681,7 +680,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, ...@@ -681,7 +680,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
rnti = UE_RNTI(Mod_id, UE_id); rnti = UE_RNTI(Mod_id, UE_id);
if (rnti == NOT_A_RNTI) continue; if (rnti == NOT_A_RNTI) continue;
if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue;
if (!ue_slice_membership(UE_id, slice_id, sli->n_dl)) continue; if (!ue_dl_slice_membership(Mod_id, UE_id, slice_id)) continue;
for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) { for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) {
CC_id = UE_list->ordered_CCids[i][UE_id]; CC_id = UE_list->ordered_CCids[i][UE_id];
...@@ -701,7 +700,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, ...@@ -701,7 +700,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
if (rnti == NOT_A_RNTI) continue; if (rnti == NOT_A_RNTI) continue;
if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue;
if (!ue_slice_membership(UE_id, slice_id, sli->n_dl)) continue; if (!ue_dl_slice_membership(Mod_id, UE_id, slice_id)) continue;
for (i = 0; i < UE_num_active_CC(UE_list, UE_id); ++i) { for (i = 0; i < UE_num_active_CC(UE_list, UE_id); ++i) {
...@@ -726,7 +725,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, ...@@ -726,7 +725,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
rnti = UE_RNTI(Mod_id, UE_id); rnti = UE_RNTI(Mod_id, UE_id);
if (rnti == NOT_A_RNTI) continue; if (rnti == NOT_A_RNTI) continue;
if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue;
if (!ue_slice_membership(UE_id, slice_id, sli->n_dl)) continue; if (!ue_dl_slice_membership(Mod_id, UE_id, slice_id)) continue;
for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) { for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) {
CC_id = UE_list->ordered_CCids[i][UE_id]; CC_id = UE_list->ordered_CCids[i][UE_id];
...@@ -745,7 +744,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, ...@@ -745,7 +744,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
rnti = UE_RNTI(Mod_id, UE_id); rnti = UE_RNTI(Mod_id, UE_id);
if (rnti == NOT_A_RNTI) continue; if (rnti == NOT_A_RNTI) continue;
if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue;
if (!ue_slice_membership(UE_id, slice_id, sli->n_dl)) continue; if (!ue_dl_slice_membership(Mod_id, UE_id, slice_id)) continue;
for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) { for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) {
CC_id = UE_list->ordered_CCids[i][UE_id]; CC_id = UE_list->ordered_CCids[i][UE_id];
...@@ -780,7 +779,6 @@ void dlsch_scheduler_pre_processor_positioning(module_id_t Mod_id, ...@@ -780,7 +779,6 @@ void dlsch_scheduler_pre_processor_positioning(module_id_t Mod_id,
int N_RBG[NFAPI_CC_MAX]; int N_RBG[NFAPI_CC_MAX];
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
slice_info_t *sli = &RC.mac[Mod_id]->slice_info;
decode_slice_positioning(Mod_id, slice_id, slice_allocation_mask); decode_slice_positioning(Mod_id, slice_id, slice_allocation_mask);
...@@ -794,7 +792,7 @@ void dlsch_scheduler_pre_processor_positioning(module_id_t Mod_id, ...@@ -794,7 +792,7 @@ void dlsch_scheduler_pre_processor_positioning(module_id_t Mod_id,
if (UE_RNTI(Mod_id, UE_id) == NOT_A_RNTI) continue; if (UE_RNTI(Mod_id, UE_id) == NOT_A_RNTI) continue;
if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue;
if (!ue_slice_membership(UE_id, slice_id, sli->n_dl)) continue; if (!ue_dl_slice_membership(Mod_id, UE_id, slice_id)) continue;
for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) { for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) {
CC_id = UE_list->ordered_CCids[i][UE_id]; CC_id = UE_list->ordered_CCids[i][UE_id];
...@@ -1020,7 +1018,7 @@ void dlsch_scheduler_pre_processor_intraslice_sharing(module_id_t Mod_id, ...@@ -1020,7 +1018,7 @@ void dlsch_scheduler_pre_processor_intraslice_sharing(module_id_t Mod_id,
if (UE_RNTI(Mod_id, UE_id) == NOT_A_RNTI) continue; if (UE_RNTI(Mod_id, UE_id) == NOT_A_RNTI) continue;
if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue;
if (!ue_slice_membership(UE_id, slice_id, sli->n_dl)) continue; if (!ue_dl_slice_membership(Mod_id, UE_id, slice_id)) continue;
for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) { for (i = 0; i < UE_num_active_CC(UE_list, UE_id); i++) {
CC_id = UE_list->ordered_CCids[i][UE_id]; CC_id = UE_list->ordered_CCids[i][UE_id];
...@@ -1405,7 +1403,6 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP, ...@@ -1405,7 +1403,6 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP,
rnti_t rnti; rnti_t rnti;
UE_list_t *UE_list; UE_list_t *UE_list;
slice_info_t *sli = &RC.mac[module_idP]->slice_info;
UE_sched_ctrl *ue_sched_ctl; UE_sched_ctrl *ue_sched_ctl;
uint8_t *vrb_map; uint8_t *vrb_map;
COMMON_channels_t *cc; COMMON_channels_t *cc;
...@@ -1435,7 +1432,7 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP, ...@@ -1435,7 +1432,7 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP,
if (UE_list->active[UE_id] != TRUE) if (UE_list->active[UE_id] != TRUE)
continue; continue;
if (!ue_slice_membership(UE_id, slice_id, sli->n_dl)) if (!ue_dl_slice_membership(module_idP, UE_id, slice_id))
continue; continue;
vrb_map = RC.mac[module_idP]->common_channels[CC_id].vrb_map; vrb_map = RC.mac[module_idP]->common_channels[CC_id].vrb_map;
...@@ -1709,7 +1706,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1709,7 +1706,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
// This is the actual CC_id in the list // This is the actual CC_id in the list
CC_id = UE_list->ordered_ULCCids[n][i]; CC_id = UE_list->ordered_ULCCids[n][i];
UE_template = &UE_list->UE_template[CC_id][i]; UE_template = &UE_list->UE_template[CC_id][i];
if (!ue_slice_membership(i, slice_id, sli->n_ul)) if (!ue_ul_slice_membership(module_idP, i, slice_id))
continue; continue;
if (UE_template->pre_allocated_nb_rb_ul[slice_id] > 0) { if (UE_template->pre_allocated_nb_rb_ul[slice_id] > 0) {
total_ue_count[CC_id] += 1; total_ue_count[CC_id] += 1;
...@@ -1730,7 +1727,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1730,7 +1727,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
continue; continue;
if (!ue_slice_membership(UE_id, slice_id, sli->n_ul)) if (!ue_ul_slice_membership(module_idP, UE_id, slice_id))
continue; continue;
LOG_D(MAC, "In ulsch_preprocessor: handling UE %d/%x\n", UE_id, LOG_D(MAC, "In ulsch_preprocessor: handling UE %d/%x\n", UE_id,
...@@ -1787,7 +1784,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1787,7 +1784,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
continue; continue;
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
continue; continue;
if (!ue_slice_membership(i, slice_id, sli->n_ul)) if (!ue_ul_slice_membership(module_idP, i, slice_id))
continue; continue;
...@@ -1828,7 +1825,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -1828,7 +1825,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
continue; continue;
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
continue; continue;
if (!ue_slice_membership(i, slice_id, sli->n_ul)) if (!ue_ul_slice_membership(module_idP, i, slice_id))
continue; continue;
UE_id = i; UE_id = i;
...@@ -1905,7 +1902,7 @@ assign_max_mcs_min_rb(module_id_t module_idP, int slice_id, int frameP, ...@@ -1905,7 +1902,7 @@ assign_max_mcs_min_rb(module_id_t module_idP, int slice_id, int frameP,
continue; continue;
if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
continue; continue;
if (!ue_slice_membership(i, slice_id, sli->n_ul)) if (!ue_ul_slice_membership(module_idP, i, slice_id))
continue; continue;
if (UE_list->UE_sched_ctrl[i].phr_received == 1) { if (UE_list->UE_sched_ctrl[i].phr_received == 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