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

FlexRAN: set values of removed slices to 0

parent 088b1d5a
......@@ -1487,6 +1487,7 @@ int flexran_remove_dl_slice(mid_t mod_id, int slice_idx)
/* move last element to the position of the removed one */
if (slice_idx != sli->n_dl)
memcpy(&sli->dl[slice_idx], &sli->dl[sli->n_dl], sizeof(sli->dl[sli->n_dl]));
memset(&sli->dl[sli->n_dl], 0, sizeof(sli->dl[sli->n_dl]));
/* all UEs that have been in the old slice are put into slice index 0 */
int *assoc_list = RC.mac[mod_id]->UE_list.assoc_dl_slice_idx;
......@@ -1763,6 +1764,7 @@ int flexran_remove_ul_slice(mid_t mod_id, int slice_idx)
/* move last element to the position of the removed one */
if (slice_idx != sli->n_ul)
memcpy(&sli->ul[slice_idx], &sli->ul[sli->n_ul], sizeof(sli->ul[sli->n_ul]));
memset(&sli->ul[sli->n_ul], 0, sizeof(sli->ul[sli->n_ul]));
/* all UEs that have been in the old slice are put into slice index 0 */
int *assoc_list = RC.mac[mod_id]->UE_list.assoc_ul_slice_idx;
......
......@@ -418,10 +418,6 @@ schedule_dlsch(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, in
sli->avg_pct_dl = 1.0 / sli->n_dl;
//sli->slice_counter = sli->n_dl;
// reset the slice percentage for inactive slices
for (i = sli->n_dl; i < MAX_NUM_SLICES; i++) {
sli->dl[i].pct = 0;
}
for (i = 0; i < sli->n_dl; i++) {
if (sli->dl[i].pct < 0) {
LOG_W(MAC, "[eNB %d][SLICE %d][DL] frame %d subframe %d: invalid percentage %f. resetting to zero",
......
......@@ -1043,10 +1043,6 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
sli->tot_pct_ul = 0;
sli->avg_pct_ul = 1.0 / sli->n_ul;
// reset the slice percentage for inactive slices
for (i = sli->n_ul; i< MAX_NUM_SLICES; i++) {
sli->ul[i].pct = 0;
}
for (i = 0; i < sli->n_ul; i++) {
if (sli->ul[i].pct < 0 ){
LOG_W(MAC,
......
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