Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
openairinterface5G
Commits
df36e3f0
Commit
df36e3f0
authored
Mar 06, 2018
by
Niccolò Iardella
Committed by
Robert Schmidt
Sep 03, 2018
Browse files
Bugfix: value of available RBs per slice could be negative
parent
ee4972cd
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
View file @
df36e3f0
...
...
@@ -417,8 +417,8 @@ schedule_dlsch(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, in
int
i
=
0
;
total_
slice_percentage
=
0
;
avg_
slice_percentage
=
1
.
0
/
n_active_slices
;
slice_percentage
_total
=
0
;
slice_percentage
_avg
=
1
.
0
/
n_active_slices
;
// reset the slice percentage for inactive slices
for
(
i
=
n_active_slices
;
i
<
MAX_NUM_SLICES
;
i
++
)
{
...
...
@@ -430,7 +430,7 @@ schedule_dlsch(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, in
module_idP
,
frameP
,
subframeP
,
i
,
slice_percentage
[
i
]);
slice_percentage
[
i
]
=
0
;
}
total_
slice_percentage
+=
slice_percentage
[
i
];
slice_percentage
_total
+=
slice_percentage
[
i
];
}
for
(
i
=
0
;
i
<
n_active_slices
;
i
++
)
{
...
...
@@ -443,7 +443,7 @@ schedule_dlsch(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, in
LOG_I
(
MAC
,
"update dl scheduler slice %d
\n
"
,
i
);
}
if
(
total_
slice_percentage
<=
1
.
0
){
// the new total RB share is within the range
if
(
slice_percentage
_total
<=
1
.
0
){
// the new total RB share is within the range
// check if the number of slices has changed, and log
if
(
n_active_slices_current
!=
n_active_slices
){
...
...
@@ -462,9 +462,9 @@ schedule_dlsch(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, in
if
(
slice_percentage_current
[
i
]
!=
slice_percentage
[
i
])
{
// new slice percentage
LOG_I
(
MAC
,
"[eNB %d][SLICE %d][DL] frame %d subframe %d: total percentage %f-->%f, slice RB percentage has changed: %f-->%f
\n
"
,
module_idP
,
i
,
frameP
,
subframeP
,
total_
slice_percentage_current
,
total_
slice_percentage
,
module_idP
,
i
,
frameP
,
subframeP
,
slice_percentage_
total_
current
,
slice_percentage
_total
,
slice_percentage_current
[
i
],
slice_percentage
[
i
]);
total_
slice_percentage_current
=
total_
slice_percentage
;
slice_percentage_
total_
current
=
slice_percentage
_total
;
slice_percentage_current
[
i
]
=
slice_percentage
[
i
];
}
...
...
@@ -493,14 +493,14 @@ schedule_dlsch(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, in
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
"
,
module_idP
,
i
,
total_
slice_percentage_current
,
total_
slice_percentage
);
if
(
slice_percentage
[
i
]
>=
avg_
slice_percentage
){
module_idP
,
i
,
slice_percentage_
total_
current
,
slice_percentage
_total
);
if
(
slice_percentage
[
i
]
>=
slice_percentage
_avg
){
slice_percentage
[
i
]
-=
0
.
1
;
total_
slice_percentage
-=
0
.
1
;
slice_percentage
_total
-=
0
.
1
;
}
}
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
"
,
module_idP
,
i
,
total_
slice_percentage_current
,
total_
slice_percentage
,
module_idP
,
i
,
slice_percentage_
total_
current
,
slice_percentage
_total
,
n_active_slices
,
n_active_slices_current
);
n_active_slices
=
n_active_slices_current
;
slice_percentage
[
i
]
=
slice_percentage_current
[
i
];
...
...
@@ -531,22 +531,22 @@ schedule_dlsch(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, in
}
// Check for new sorting policy
if
(
sorting_policy_current
[
i
]
!=
sorting_policy
[
i
])
{
if
(
slice_
sorting_policy_current
[
i
]
!=
slice_
sorting_policy
[
i
])
{
LOG_I
(
MAC
,
"[eNB %d][SLICE %d][DL] frame %d subframe %d: UE sorting policy has changed (%x-->%x)
\n
"
,
module_idP
,
i
,
frameP
,
subframeP
,
sorting_policy_current
[
i
],
sorting_policy
[
i
]);
sorting_policy_current
[
i
]
=
sorting_policy
[
i
];
module_idP
,
i
,
frameP
,
subframeP
,
slice_
sorting_policy_current
[
i
],
slice_
sorting_policy
[
i
]);
slice_
sorting_policy_current
[
i
]
=
slice_
sorting_policy
[
i
];
}
// Check for new accounting policy
if
(
accounting_policy_current
[
i
]
!=
accounting_policy
[
i
])
{
if
(
accounting_policy
[
i
]
>
1
||
accounting_policy
[
i
]
<
0
)
{
if
(
slice_
accounting_policy_current
[
i
]
!=
slice_
accounting_policy
[
i
])
{
if
(
slice_
accounting_policy
[
i
]
>
1
||
slice_
accounting_policy
[
i
]
<
0
)
{
LOG_W
(
MAC
,
"[eNB %d][SLICE %d][DL] frame %d subframe %d: invalid accounting policy (%d), revert to its previous value (%d)
\n
"
,
module_idP
,
i
,
frameP
,
subframeP
,
accounting_policy
[
i
],
accounting_policy_current
[
i
]);
accounting_policy
[
i
]
=
accounting_policy_current
[
i
];
module_idP
,
i
,
frameP
,
subframeP
,
slice_
accounting_policy
[
i
],
slice_
accounting_policy_current
[
i
]);
slice_
accounting_policy
[
i
]
=
slice_
accounting_policy_current
[
i
];
}
else
{
LOG_N
(
MAC
,
"[eNB %d][SLICE %d][DL] frame %d subframe %d: UE sorting policy has changed (%x-->%x)
\n
"
,
module_idP
,
i
,
frameP
,
subframeP
,
accounting_policy_current
[
i
],
accounting_policy
[
i
]);
accounting_policy_current
[
i
]
=
accounting_policy
[
i
];
module_idP
,
i
,
frameP
,
subframeP
,
slice_
accounting_policy_current
[
i
],
slice_
accounting_policy
[
i
]);
slice_
accounting_policy_current
[
i
]
=
slice_
accounting_policy
[
i
];
}
}
...
...
openair2/LAYER2/MAC/eNB_scheduler_dlsch.h
View file @
df36e3f0
...
...
@@ -38,26 +38,34 @@
#define __LAYER2_MAC_ENB_SCHEDULER_DLSCH_H__
// number of active slices for past and current time
int
n_active_slices
=
1
;
int
n_active_slices_current
=
1
;
int
n_active_slices
=
1
;
int
n_active_slices_current
=
1
;
// RB share for each slice for past and current time
float
avg_
slice_percentage
=
0
.
25
;
float
slice_percentage
[
MAX_NUM_SLICES
]
=
{
1
.
0
,
0
.
0
,
0
.
0
,
0
.
0
};
float
slice_percentage_
current
[
MAX_NUM_SLICES
]
=
{
1
.
0
,
0
.
0
,
0
.
0
,
0
.
0
}
;
float
total_
slice_percentage
=
0
;
float
total_
slice_percentage_
current
=
0
;
float
slice_percentage
[
MAX_NUM_SLICES
]
=
{
1
.
0
,
0
.
0
,
0
.
0
,
0
.
0
}
;
float
slice_percentage
_current
[
MAX_NUM_SLICES
]
=
{
1
.
0
,
0
.
0
,
0
.
0
,
0
.
0
};
float
slice_percentage_
total
=
0
;
float
slice_percentage
_total_current
=
0
;
float
slice_percentage_
avg
=
0
.
25
;
// Frequency ranges for slice positioning
int
slice_position
[
MAX_NUM_SLICES
*
2
]
=
{
0
,
N_RBG_MAX
,
0
,
N_RBG_MAX
,
0
,
N_RBG_MAX
,
0
,
N_RBG_MAX
};
int
slice_position_current
[
MAX_NUM_SLICES
*
2
]
=
{
0
,
N_RBG_MAX
,
0
,
N_RBG_MAX
,
0
,
N_RBG_MAX
,
0
,
N_RBG_MAX
};
int
slice_position
[
MAX_NUM_SLICES
*
2
]
=
{
0
,
N_RBG_MAX
,
0
,
N_RBG_MAX
,
0
,
N_RBG_MAX
,
0
,
N_RBG_MAX
};
int
slice_position_current
[
MAX_NUM_SLICES
*
2
]
=
{
0
,
N_RBG_MAX
,
0
,
N_RBG_MAX
,
0
,
N_RBG_MAX
,
0
,
N_RBG_MAX
};
// MAX MCS for each slice for past and current time
int
slice_maxmcs
[
MAX_NUM_SLICES
]
=
{
28
,
28
,
28
,
28
};
int
slice_maxmcs_current
[
MAX_NUM_SLICES
]
=
{
28
,
28
,
28
,
28
};
int
slice_maxmcs
[
MAX_NUM_SLICES
]
=
{
28
,
28
,
28
,
28
};
int
slice_maxmcs_current
[
MAX_NUM_SLICES
]
=
{
28
,
28
,
28
,
28
};
int
update_dl_scheduler
[
MAX_NUM_SLICES
]
=
{
1
,
1
,
1
,
1
};
int
update_dl_scheduler_current
[
MAX_NUM_SLICES
]
=
{
1
,
1
,
1
,
1
};
// The lists of criteria that enforce the sorting policies of the slices
uint32_t
slice_sorting_policy
[
MAX_NUM_SLICES
]
=
{
0x01234
,
0x01234
,
0x01234
,
0x01234
};
uint32_t
slice_sorting_policy_current
[
MAX_NUM_SLICES
]
=
{
0x01234
,
0x01234
,
0x01234
,
0x01234
};
// Accounting policy (just greedy(1) or fair(0) setting for now)
int
slice_accounting_policy
[
MAX_NUM_SLICES
]
=
{
0
,
0
,
0
,
0
};
int
slice_accounting_policy_current
[
MAX_NUM_SLICES
]
=
{
0
,
0
,
0
,
0
};
int
update_dl_scheduler
[
MAX_NUM_SLICES
]
=
{
1
,
1
,
1
,
1
};
int
update_dl_scheduler_current
[
MAX_NUM_SLICES
]
=
{
1
,
1
,
1
,
1
};
// name of available scheduler
char
*
dl_scheduler_type
[
MAX_NUM_SLICES
]
=
...
...
@@ -67,14 +75,6 @@ char *dl_scheduler_type[MAX_NUM_SLICES] =
"schedule_ue_spec"
};
// The lists of criteria that enforce the sorting policies of the slices
uint32_t
sorting_policy
[
MAX_NUM_SLICES
]
=
{
0x01234
,
0x01234
,
0x01234
,
0x01234
};
uint32_t
sorting_policy_current
[
MAX_NUM_SLICES
]
=
{
0x01234
,
0x01234
,
0x01234
,
0x01234
};
// Accounting policy (just greedy(1) or fair(0) setting for now)
int
accounting_policy
[
MAX_NUM_SLICES
]
=
{
0
,
0
,
0
,
0
};
int
accounting_policy_current
[
MAX_NUM_SLICES
]
=
{
0
,
0
,
0
,
0
};
// pointer to the slice specific scheduler
slice_scheduler_dl
slice_sched_dl
[
MAX_NUM_SLICES
]
=
{
0
};
...
...
openair2/LAYER2/MAC/pre_processor.c
View file @
df36e3f0
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment