Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AIEngine
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-AIEngine
Commits
30feed86
Commit
30feed86
authored
Jan 26, 2021
by
wangdong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addmod_complete
parent
dc6e10f6
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
509 additions
and
149 deletions
+509
-149
openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c
.../ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c
+1
-0
openair2/ENB_APP/MESSAGES/V2/config_common.proto
openair2/ENB_APP/MESSAGES/V2/config_common.proto
+1
-0
openair2/ENB_APP/flexran_agent_ran_api.c
openair2/ENB_APP/flexran_agent_ran_api.c
+15
-22
openair2/LAYER2/MAC/slicing/slicing.c
openair2/LAYER2/MAC/slicing/slicing.c
+476
-127
openair2/LAYER2/MAC/slicing/slicing.h
openair2/LAYER2/MAC/slicing/slicing.h
+16
-0
No files found.
openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c
View file @
30feed86
...
...
@@ -1035,6 +1035,7 @@ void update_or_remove_dl(mid_t mod_id, Protocol__FlexSlice *s) {
}
else
{
LOG_I
(
FLEXRAN_AGENT
,
"updating DL slice ID %d
\n
"
,
s
->
id
);
const
int
rc
=
flexran_create_dl_slice
(
mod_id
,
s
);
//pack
if
(
rc
<
0
){
LOG_W
(
FLEXRAN_AGENT
,
"error while update slice ID %d: flexran_create_dl_slice() -> %d
\n
"
,
...
...
openair2/ENB_APP/MESSAGES/V2/config_common.proto
View file @
30feed86
...
...
@@ -84,6 +84,7 @@ message flex_slice_scn19 {
optional
uint32
tau
=
7
;
optional
uint32
delay
=
8
;
optional
string
type
=
9
;
optional
uint32
typeid
=
10
;
}
...
...
openair2/ENB_APP/flexran_agent_ran_api.c
View file @
30feed86
...
...
@@ -3142,6 +3142,8 @@ int flexran_create_dl_slice(mid_t mod_id, const Protocol__FlexSlice *s) {
params
=
malloc
(
sizeof
(
scn19_slice_param_t
));
if
(
!
params
)
return
0
;
((
scn19_slice_param_t
*
)
params
)
->
type
=
s
->
scn19
->
type
;
if
(
s
->
scn19
->
has_typeid_
)
((
scn19_slice_param_t
*
)
params
)
->
typeid
=
s
->
scn19
->
typeid_
;
if
(
s
->
scn19
->
has_poshigh
){
((
scn19_slice_param_t
*
)
params
)
->
posLow
=
s
->
scn19
->
poslow
;
((
scn19_slice_param_t
*
)
params
)
->
posHigh
=
s
->
scn19
->
poshigh
;
...
...
@@ -3149,7 +3151,7 @@ int flexran_create_dl_slice(mid_t mod_id, const Protocol__FlexSlice *s) {
((
scn19_slice_param_t
*
)
params
)
->
posLow
=
NULL
;
((
scn19_slice_param_t
*
)
params
)
->
posHigh
=
NULL
;
}
if
(
s
->
scn19
->
has_kpsrequired
){
if
(
s
->
scn19
->
kpsreference
){
((
scn19_slice_param_t
*
)
params
)
->
kpsRequired
=
s
->
scn19
->
kpsrequired
;
((
scn19_slice_param_t
*
)
params
)
->
kpsReference
=
s
->
scn19
->
kpsreference
;
}
else
{
...
...
@@ -3157,6 +3159,7 @@ int flexran_create_dl_slice(mid_t mod_id, const Protocol__FlexSlice *s) {
((
scn19_slice_param_t
*
)
params
)
->
kpsReference
=
NULL
;
}
if
(
s
->
scn19
->
has_tau
){
((
scn19_slice_param_t
*
)
params
)
->
kpsRequired
=
s
->
scn19
->
kpsrequired
;
((
scn19_slice_param_t
*
)
params
)
->
tmax
=
s
->
scn19
->
tmax
;
((
scn19_slice_param_t
*
)
params
)
->
logdelta
=
s
->
scn19
->
logdelta
;
((
scn19_slice_param_t
*
)
params
)
->
tau
=
s
->
scn19
->
tau
;
...
...
@@ -3183,6 +3186,7 @@ int flexran_create_dl_slice(mid_t mod_id, const Protocol__FlexSlice *s) {
return
-
15
;
}
}
return
dl
->
addmod_slice
(
dl
->
slices
,
s
->
id
,
l
,
algo
,
params
);
}
...
...
@@ -3231,39 +3235,28 @@ void flexran_get_dl_slice(mid_t mod_id,
protocol__flex_slice_scn19__init
(
slice
->
scn19
);
// slice->scn19->has_type = 1;
slice
->
scn19
->
type
=
((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
type
;
if
(((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
kpsRequired
!=
NULL
){
slice
->
scn19
->
typeid_
=
((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
typeid
;
if
(
strcmp
(
slice
->
scn19
->
type
,
"dynamic"
)
==
0
){
slice
->
scn19
->
has_kpsrequired
=
1
;
slice
->
scn19
->
kpsrequired
=
((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
kpsRequired
;
}
if
(((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
kpsReference
!=
NULL
){
slice
->
scn19
->
has_kpsreference
=
1
;
slice
->
scn19
->
kpsre
quired
=
((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
kpsRequired
;
slice
->
scn19
->
kpsre
ference
=
((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
kpsReference
;
}
if
(
((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
posLow
!=
NULL
){
if
(
strcmp
(
slice
->
scn19
->
type
,
"static"
)
==
0
){
slice
->
scn19
->
has_poslow
=
1
;
slice
->
scn19
->
poslow
=
((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
posLow
;
}
if
(((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
posHigh
!=
NULL
){
slice
->
scn19
->
has_poshigh
=
1
;
slice
->
scn19
->
poshigh
=
((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
posHigh
;
}
if
(((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
posHigh
!=
NULL
){
slice
->
scn19
->
has_poshigh
=
1
;
slice
->
scn19
->
poshigh
=
((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
posHigh
;
}
if
(((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
tmax
!=
NULL
){
if
(
strcmp
(
slice
->
scn19
->
type
,
"ondemand"
)
==
0
){
slice
->
scn19
->
has_kpsrequired
=
1
;
slice
->
scn19
->
kpsrequired
=
((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
kpsRequired
;
slice
->
scn19
->
has_tmax
=
1
;
slice
->
scn19
->
tmax
=
((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
tmax
;
}
if
(((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
logdelta
!=
NULL
){
slice
->
scn19
->
has_logdelta
=
1
;
slice
->
scn19
->
logdelta
=
((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
logdelta
;
}
if
(((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
tau
!=
NULL
){
slice
->
scn19
->
has_tau
=
1
;
slice
->
scn19
->
tau
=
((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
tau
;
}
if
(((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
delay
!=
NULL
){
slice
->
scn19
->
has_delay
=
1
;
slice
->
scn19
->
delay
=
((
scn19_slice_param_t
*
)
s_
->
algo_data
)
->
delay
;
}
...
...
openair2/LAYER2/MAC/slicing/slicing.c
View file @
30feed86
...
...
@@ -122,10 +122,14 @@ int addmod_static_slice_dl(slice_info_t *si,
char
*
label
,
void
*
algo
,
void
*
slice_params_dl
)
{
LOG_I
(
FLEXRAN_AGENT
,
"Begin addmod_static_slice_dl in Static Slicing Implementation
\n
"
);
scn19_slice_param_t
*
dl
=
slice_params_dl
;
LOG_I
(
FLEXRAN_AGENT
,
"slice type %s
\t
\n
"
,
dl
->
type
);
if
(
dl
->
typeid
==
1
){
LOG_I
(
FLEXRAN_AGENT
,
"Begin addmod_static_slice_dl in Static Slicing Implementation
\n
"
);
if
(
dl
&&
dl
->
posLow
>
dl
->
posHigh
)
RET_FAIL
(
-
1
,
"%s(): slice id %d posLow > posHigh
\n
"
,
__func__
,
id
);
...
...
@@ -133,10 +137,11 @@ int addmod_static_slice_dl(slice_info_t *si,
uint8_t
rbgMap
[
25
]
=
{
0
};
int
index
=
_exists_slice
(
si
->
num
,
si
->
s
,
id
);
if
(
index
>=
0
)
{
LOG_I
(
FLEXRAN_AGENT
,
"Updating addmod_static_slice_dl in Static Slicing Implementation %d
\n
"
);
LOG_I
(
FLEXRAN_AGENT
,
"Updating addmod_static_slice_dl in Static Slicing Implementation
\n
"
);
for
(
int
s
=
0
;
s
<
si
->
num
;
++
s
)
{
static_slice_param_t
*
sd
=
dl
&&
si
->
s
[
s
]
->
id
==
id
?
dl
:
si
->
s
[
s
]
->
algo_data
;
scn19_slice_param_t
*
sd
=
dl
&&
si
->
s
[
s
]
->
id
==
id
?
dl
:
si
->
s
[
s
]
->
algo_data
;
if
(
sd
->
typeid
!=
1
)
continue
;
for
(
int
i
=
sd
->
posLow
;
i
<=
sd
->
posHigh
;
++
i
)
{
if
(
rbgMap
[
i
])
RET_FAIL
(
-
33
,
"%s(): overlap of slices detected at RBG %d
\n
"
,
__func__
,
i
);
...
...
@@ -159,6 +164,8 @@ int addmod_static_slice_dl(slice_info_t *si,
free
(
s
->
algo_data
);
s
->
algo_data
=
dl
;
}
LOG_I
(
FLEXRAN_AGENT
,
"Updating %d
\n
"
,
index
);
return
index
;
}
...
...
@@ -168,7 +175,8 @@ int addmod_static_slice_dl(slice_info_t *si,
if
(
si
->
num
>=
MAX_STATIC_SLICES
)
RET_FAIL
(
-
2
,
"%s(): cannot have more than %d slices
\n
"
,
__func__
,
MAX_STATIC_SLICES
);
for
(
int
s
=
0
;
s
<
si
->
num
;
++
s
)
{
static_slice_param_t
*
sd
=
si
->
s
[
s
]
->
algo_data
;
scn19_slice_param_t
*
sd
=
si
->
s
[
s
]
->
algo_data
;
if
(
sd
->
typeid
!=
1
)
continue
;
for
(
int
i
=
sd
->
posLow
;
i
<=
sd
->
posHigh
;
++
i
)
rbgMap
[
i
]
=
1
;
}
...
...
@@ -189,9 +197,167 @@ int addmod_static_slice_dl(slice_info_t *si,
if
(
!
ns
->
dl_algo
.
data
)
ns
->
dl_algo
.
data
=
ns
->
dl_algo
.
setup
();
ns
->
algo_data
=
dl
;
LOG_I
(
FLEXRAN_AGENT
,
"End addmod_static_slice_dl in Static Slicing Implementation %d
\n
"
);
LOG_I
(
FLEXRAN_AGENT
,
"End addmod_static_slice_dl in Static Slicing Implementation
\n
"
);
return
si
->
num
-
1
;
}
if
(
dl
->
typeid
==
2
){
LOG_I
(
FLEXRAN_AGENT
,
"Begin addmod_dynamic_slice_dl in dynamic dynamic Implementation
\n
"
);
if
(
dl
&&
dl
->
kpsRequired
>
dl
->
kpsReference
)
RET_FAIL
(
-
1
,
"%s(): slice id %d kpsRequired > kpsReference
\n
"
,
__func__
,
id
);
uint8_t
rbgMap
[
25
]
=
{
0
};
int
index
=
_exists_slice
(
si
->
num
,
si
->
s
,
id
);
if
(
index
>=
0
)
{
LOG_I
(
FLEXRAN_AGENT
,
"Updating addmod_dynamic_slice_dl in dynamic dynamic Implementation
\n
"
);
for
(
int
s
=
0
;
s
<
si
->
num
;
++
s
)
{
scn19_slice_param_t
*
sd
=
dl
&&
si
->
s
[
s
]
->
id
==
id
?
dl
:
si
->
s
[
s
]
->
algo_data
;
for
(
int
i
=
sd
->
posLow
;
i
<=
sd
->
posHigh
;
++
i
)
{
if
(
rbgMap
[
i
])
RET_FAIL
(
-
33
,
"%s(): overlap of slices detected at RBG %d
\n
"
,
__func__
,
i
);
rbgMap
[
i
]
=
1
;
}
}
/* no problem, can allocate */
slice_t
*
s
=
si
->
s
[
index
];
if
(
label
)
{
if
(
s
->
label
)
free
(
s
->
label
);
s
->
label
=
label
;
}
if
(
algo
)
{
s
->
dl_algo
.
unset
(
&
s
->
dl_algo
.
data
);
s
->
dl_algo
=
*
(
default_sched_dl_algo_t
*
)
algo
;
if
(
!
s
->
dl_algo
.
data
)
s
->
dl_algo
.
data
=
s
->
dl_algo
.
setup
();
}
if
(
dl
)
{
free
(
s
->
algo_data
);
s
->
algo_data
=
dl
;
}
return
index
;
}
if
(
!
dl
)
RET_FAIL
(
-
100
,
"%s(): no parameters for new slice %d, aborting
\n
"
,
__func__
,
id
);
if
(
si
->
num
>=
MAX_DYNAMIC_SLICES
)
RET_FAIL
(
-
2
,
"%s(): cannot have more than %d slices
\n
"
,
__func__
,
MAX_DYNAMIC_SLICES
);
// for (int s = 0; s < si->num; ++s) {
// scn19_slice_param_t *sd = si->s[s]->algo_data;
// sd->fexp = sd->kpsRequired;
// sd->rbs = 0;
// sd->eff = (sd->kpsReference / RB_NUMS)
// }
dl
->
fexp
=
dl
->
kpsRequired
;
dl
->
rbs
=
0
;
dl
->
eff
=
(
dl
->
kpsReference
/
RB_NUMS
);
if
(
!
algo
)
RET_FAIL
(
-
14
,
"%s(): no scheduler algorithm provided
\n
"
,
__func__
);
slice_t
*
ns
=
_add_slice
(
&
si
->
num
,
si
->
s
);
if
(
!
ns
)
RET_FAIL
(
-
4
,
"%s(): could not create new slice
\n
"
,
__func__
);
ns
->
id
=
id
;
ns
->
label
=
label
;
ns
->
dl_algo
=
*
(
default_sched_dl_algo_t
*
)
algo
;
if
(
!
ns
->
dl_algo
.
data
)
ns
->
dl_algo
.
data
=
ns
->
dl_algo
.
setup
();
ns
->
algo_data
=
dl
;
LOG_I
(
FLEXRAN_AGENT
,
"End addmod_dynamic_slice_dl in dynamic dynamic Implementation
\n
"
);
return
si
->
num
-
1
;
}
//ondemand
if
(
dl
->
typeid
==
3
){
LOG_I
(
FLEXRAN_AGENT
,
"Begin addmod_ondemand_slice_dl in OnDemand Implementation
\n
"
);
// if (dl && !(((dl->tmax * RB_NUMS)%1)>0.001))
// RET_FAIL(-1, "%s(): slice id %d tmax of OnDemand slice not on RB boundary\n", __func__, id);
uint8_t
rbgMap
[
25
]
=
{
0
};
int
index
=
_exists_slice
(
si
->
num
,
si
->
s
,
id
);
if
(
index
>=
0
)
{
LOG_I
(
FLEXRAN_AGENT
,
"Updating addmod_OnDemand_slice_dl in OnDemand Implementation
\n
"
);
// for (int s = 0; s < si->num; ++s) {
// scn19_slice_param_t *sd = dl && si->s[s]->id == id ? dl : si->s[s]->algo_data;
// for (int i = sd->posLow; i <= sd->posHigh; ++i) {
// if (rbgMap[i])
// RET_FAIL(-33, "%s(): overlap of slices detected at RBG %d\n", __func__, i);
// rbgMap[i] = 1;
// }
// }
dl
->
fexp
=
dl
->
kpsRequired
;
dl
->
rbs
=
0
;
dl
->
texp
=
dl
->
tmax
;
dl
->
fexp
=
dl
->
tmax
*
5000
;
/* no problem, can allocate */
slice_t
*
s
=
si
->
s
[
index
];
if
(
label
)
{
if
(
s
->
label
)
free
(
s
->
label
);
s
->
label
=
label
;
}
if
(
algo
)
{
s
->
dl_algo
.
unset
(
&
s
->
dl_algo
.
data
);
s
->
dl_algo
=
*
(
default_sched_dl_algo_t
*
)
algo
;
if
(
!
s
->
dl_algo
.
data
)
s
->
dl_algo
.
data
=
s
->
dl_algo
.
setup
();
}
if
(
dl
)
{
free
(
s
->
algo_data
);
s
->
algo_data
=
dl
;
}
return
index
;
}
if
(
!
dl
)
RET_FAIL
(
-
100
,
"%s(): no parameters for new slice %d, aborting
\n
"
,
__func__
,
id
);
if
(
si
->
num
>=
MAX_DYNAMIC_SLICES
)
RET_FAIL
(
-
2
,
"%s(): cannot have more than %d slices
\n
"
,
__func__
,
MAX_DYNAMIC_SLICES
);
// for (int s = 0; s < si->num; ++s) {
// scn19_slice_param_t *sd = si->s[s]->algo_data;
// sd->fexp = sd->kpsRequired;
// sd->rbs = 0;
// sd->eff = (sd->kpsReference / RB_NUMS)
// }
dl
->
fexp
=
dl
->
kpsRequired
;
dl
->
rbs
=
0
;
dl
->
texp
=
dl
->
tmax
;
dl
->
fexp
=
dl
->
tmax
*
5000
;
if
(
!
algo
)
RET_FAIL
(
-
14
,
"%s(): no scheduler algorithm provided
\n
"
,
__func__
);
slice_t
*
ns
=
_add_slice
(
&
si
->
num
,
si
->
s
);
if
(
!
ns
)
RET_FAIL
(
-
4
,
"%s(): could not create new slice
\n
"
,
__func__
);
ns
->
id
=
id
;
ns
->
label
=
label
;
ns
->
dl_algo
=
*
(
default_sched_dl_algo_t
*
)
algo
;
if
(
!
ns
->
dl_algo
.
data
)
ns
->
dl_algo
.
data
=
ns
->
dl_algo
.
setup
();
ns
->
algo_data
=
dl
;
LOG_I
(
FLEXRAN_AGENT
,
"End addmod_OnDemand_slice_dl in OnDemand Implementation
\n
"
);
return
si
->
num
-
1
;
}
}
int
addmod_static_slice_ul
(
slice_info_t
*
si
,
...
...
@@ -544,7 +710,9 @@ pp_impl_param_t static_dl_init(module_id_t mod_id, int CC_id) {
si
->
UE_assoc_slice
[
i
]
=
-
1
;
/* insert default slice, all resources */
static_slice_param_t
*
dlp
=
malloc
(
sizeof
(
static_slice_param_t
));
scn19_slice_param_t
*
dlp
=
malloc
(
sizeof
(
scn19_slice_param_t
));
dlp
->
type
=
"static"
;
dlp
->
typeid
=
1
;
dlp
->
posLow
=
0
;
dlp
->
posHigh
=
to_rbg
(
RC
.
mac
[
mod_id
]
->
common_channels
[
CC_id
].
mib
->
message
.
dl_Bandwidth
)
-
1
;
default_sched_dl_algo_t
*
algo
=
&
RC
.
mac
[
mod_id
]
->
pre_processor_dl
.
dl_algo
;
...
...
@@ -555,7 +723,7 @@ pp_impl_param_t static_dl_init(module_id_t mod_id, int CC_id) {
slicing_add_UE
(
si
,
UE_id
);
pp_impl_param_t
sttc
;
sttc
.
algorithm
=
S
TATIC
_SLICING
;
sttc
.
algorithm
=
S
CN19
_SLICING
;
sttc
.
add_UE
=
slicing_add_UE
;
sttc
.
remove_UE
=
slicing_remove_UE
;
sttc
.
move_UE
=
slicing_move_UE
;
...
...
@@ -636,11 +804,26 @@ pp_impl_param_t static_ul_init(module_id_t mod_id, int CC_id) {
* B. Then, following the QoS requirements of on-demand slices, we allocate
* necessary resources.
* C. Finally, we schedule resources for dynamic slices.
*/
/************************ SVN19 Slicing Implementation ************************/
/**
* On-demand Slices:
* SLA requirments in slice k:
* 1. A delay-threshold ∆k (ms)
* 2. A packet-loss probability ∂k
* 3. A long-run maximum resouce share t_(k,max)
*
* For each slice scheduling interval, the sclice tells the number of bits B_k to be
* scheduled to satisfy its ∆k.
*
* Based on the above parameters (i.e., B_k and t_(k,max)) as well as measured statistics
* (e.g., channel quality, user number), an on-demand slice can estimate its delay bound
* of the scheduling process.
*
* W_k(t_k) = B_k / (N * b¬_k) * log(t_k) = T_k * log(t_k)
*
*
*
Weight w'_k = (∂ W_k(t_k)) / (∂ t_k) = T_k / t_k = B_k / b_k, in which b_k = N * b¬_k * t_k
*/
int
addmod_scn19_slice_dl
(
slice_info_t
*
si
,
...
...
@@ -648,18 +831,25 @@ int addmod_scn19_slice_dl(slice_info_t *si,
char
*
label
,
void
*
algo
,
void
*
slice_params_dl
)
{
LOG_I
(
FLEXRAN_AGENT
,
"Begin addmod_static_slice_dl in Static Slicing Implementation %d
\n
"
);
static_slice_param_t
*
dl
=
slice_params_dl
;
LOG_I
(
FLEXRAN_AGENT
,
"Begin addmod_static_slice_dl in Static Slicing Implementation
\n
"
);
scn19_slice_param_t
*
dl
=
slice_params_dl
;
//static
if
(
dl
->
typeid
==
1
){
if
(
dl
&&
dl
->
posLow
>
dl
->
posHigh
)
RET_FAIL
(
-
1
,
"%s(): slice id %d posLow > posHigh
\n
"
,
__func__
,
id
);
uint8_t
rbgMap
[
25
]
=
{
0
};
int
index
=
_exists_slice
(
si
->
num
,
si
->
s
,
id
);
if
(
index
>=
0
)
{
LOG_I
(
FLEXRAN_AGENT
,
"Updating addmod_static_slice_dl in Static Slicing Implementation %d
\n
"
);
LOG_I
(
FLEXRAN_AGENT
,
"Updating addmod_static_slice_dl in Static Slicing Implementation
\n
"
);
for
(
int
s
=
0
;
s
<
si
->
num
;
++
s
)
{
static
_slice_param_t
*
sd
=
dl
&&
si
->
s
[
s
]
->
id
==
id
?
dl
:
si
->
s
[
s
]
->
algo_data
;
scn19
_slice_param_t
*
sd
=
dl
&&
si
->
s
[
s
]
->
id
==
id
?
dl
:
si
->
s
[
s
]
->
algo_data
;
for
(
int
i
=
sd
->
posLow
;
i
<=
sd
->
posHigh
;
++
i
)
{
if
(
rbgMap
[
i
])
RET_FAIL
(
-
33
,
"%s(): overlap of slices detected at RBG %d
\n
"
,
__func__
,
i
);
...
...
@@ -691,7 +881,7 @@ int addmod_scn19_slice_dl(slice_info_t *si,
if
(
si
->
num
>=
MAX_STATIC_SLICES
)
RET_FAIL
(
-
2
,
"%s(): cannot have more than %d slices
\n
"
,
__func__
,
MAX_STATIC_SLICES
);
for
(
int
s
=
0
;
s
<
si
->
num
;
++
s
)
{
static
_slice_param_t
*
sd
=
si
->
s
[
s
]
->
algo_data
;
scn19
_slice_param_t
*
sd
=
si
->
s
[
s
]
->
algo_data
;
for
(
int
i
=
sd
->
posLow
;
i
<=
sd
->
posHigh
;
++
i
)
rbgMap
[
i
]
=
1
;
}
...
...
@@ -712,9 +902,168 @@ int addmod_scn19_slice_dl(slice_info_t *si,
if
(
!
ns
->
dl_algo
.
data
)
ns
->
dl_algo
.
data
=
ns
->
dl_algo
.
setup
();
ns
->
algo_data
=
dl
;
LOG_I
(
FLEXRAN_AGENT
,
"End addmod_static_slice_dl in Static Slicing Implementation %d
\n
"
);
LOG_I
(
FLEXRAN_AGENT
,
"End addmod_static_slice_dl in Static Slicing Implementation
\n
"
);
return
si
->
num
-
1
;
}
//dynamic
if
(
dl
->
typeid
==
2
){
LOG_I
(
FLEXRAN_AGENT
,
"Begin addmod_dynamic_slice_dl in dynamic dynamic Implementation
\n
"
);
if
(
dl
&&
dl
->
kpsRequired
>
dl
->
kpsReference
)
RET_FAIL
(
-
1
,
"%s(): slice id %d kpsRequired > kpsReference
\n
"
,
__func__
,
id
);
uint8_t
rbgMap
[
25
]
=
{
0
};
int
index
=
_exists_slice
(
si
->
num
,
si
->
s
,
id
);
if
(
index
>=
0
)
{
LOG_I
(
FLEXRAN_AGENT
,
"Updating addmod_dynamic_slice_dl in dynamic dynamic Implementation
\n
"
);
// for (int s = 0; s < si->num; ++s) {
// scn19_slice_param_t *sd = dl && si->s[s]->id == id ? dl : si->s[s]->algo_data;
// for (int i = sd->posLow; i <= sd->posHigh; ++i) {
// if (rbgMap[i])
// RET_FAIL(-33, "%s(): overlap of slices detected at RBG %d\n", __func__, i);
// rbgMap[i] = 1;
// }
// }
/* no problem, can allocate */
dl
->
fexp
=
dl
->
kpsRequired
;
dl
->
rbs
=
0
;
dl
->
eff
=
(
dl
->
kpsReference
/
RB_NUMS
);
slice_t
*
s
=
si
->
s
[
index
];
if
(
label
)
{
if
(
s
->
label
)
free
(
s
->
label
);
s
->
label
=
label
;
}
if
(
algo
)
{
s
->
dl_algo
.
unset
(
&
s
->
dl_algo
.
data
);
s
->
dl_algo
=
*
(
default_sched_dl_algo_t
*
)
algo
;
if
(
!
s
->
dl_algo
.
data
)
s
->
dl_algo
.
data
=
s
->
dl_algo
.
setup
();
}
if
(
dl
)
{
free
(
s
->
algo_data
);
s
->
algo_data
=
dl
;
}
return
index
;
}
if
(
!
dl
)
RET_FAIL
(
-
100
,
"%s(): no parameters for new slice %d, aborting
\n
"
,
__func__
,
id
);
if
(
si
->
num
>=
MAX_DYNAMIC_SLICES
)
RET_FAIL
(
-
2
,
"%s(): cannot have more than %d slices
\n
"
,
__func__
,
MAX_DYNAMIC_SLICES
);
// for (int s = 0; s < si->num; ++s) {
// scn19_slice_param_t *sd = si->s[s]->algo_data;
// sd->fexp = sd->kpsRequired;
// sd->rbs = 0;
// sd->eff = (sd->kpsReference / RB_NUMS)
// }
dl
->
fexp
=
dl
->
kpsRequired
;
dl
->
rbs
=
0
;
dl
->
eff
=
(
dl
->
kpsReference
/
RB_NUMS
);
if
(
!
algo
)
RET_FAIL
(
-
14
,
"%s(): no scheduler algorithm provided
\n
"
,
__func__
);
slice_t
*
ns
=
_add_slice
(
&
si
->
num
,
si
->
s
);
if
(
!
ns
)
RET_FAIL
(
-
4
,
"%s(): could not create new slice
\n
"
,
__func__
);
ns
->
id
=
id
;
ns
->
label
=
label
;
ns
->
dl_algo
=
*
(
default_sched_dl_algo_t
*
)
algo
;
if
(
!
ns
->
dl_algo
.
data
)
ns
->
dl_algo
.
data
=
ns
->
dl_algo
.
setup
();
ns
->
algo_data
=
dl
;
LOG_I
(
FLEXRAN_AGENT
,
"End addmod_dynamic_slice_dl in dynamic dynamic Implementation
\n
"
);
return
si
->
num
-
1
;
}
//ondemand
if
(
dl
->
typeid
==
3
){
LOG_I
(
FLEXRAN_AGENT
,
"Begin addmod_ondemand_slice_dl in dynamic dynamic Implementation
\n
"
);
if
(
dl
&&
!
(((
dl
->
tmax
*
RB_NUMS
)
%
1
)
>
0
.
001
))
RET_FAIL
(
-
1
,
"%s(): slice id %d tmax of OnDemand slice not on RB boundary
\n
"
,
__func__
,
id
);
uint8_t
rbgMap
[
25
]
=
{
0
};
int
index
=
_exists_slice
(
si
->
num
,
si
->
s
,
id
);
if
(
index
>=
0
)
{
LOG_I
(
FLEXRAN_AGENT
,
"Updating addmod_dynamic_slice_dl in dynamic dynamic Implementation
\n
"
);
// for (int s = 0; s < si->num; ++s) {
// scn19_slice_param_t *sd = dl && si->s[s]->id == id ? dl : si->s[s]->algo_data;
// for (int i = sd->posLow; i <= sd->posHigh; ++i) {
// if (rbgMap[i])
// RET_FAIL(-33, "%s(): overlap of slices detected at RBG %d\n", __func__, i);
// rbgMap[i] = 1;
// }
// }
dl
->
fexp
=
dl
->
kpsRequired
;
dl
->
rbs
=
0
;
dl
->
texp
=
dl
->
tmax
;
dl
->
fexp
=
dl
->
tmax
*
5000
;
/* no problem, can allocate */
slice_t
*
s
=
si
->
s
[
index
];
if
(
label
)
{
if
(
s
->
label
)
free
(
s
->
label
);
s
->
label
=
label
;
}
if
(
algo
)
{
s
->
dl_algo
.
unset
(
&
s
->
dl_algo
.
data
);
s
->
dl_algo
=
*
(
default_sched_dl_algo_t
*
)
algo
;
if
(
!
s
->
dl_algo
.
data
)
s
->
dl_algo
.
data
=
s
->
dl_algo
.
setup
();
}
if
(
dl
)
{
free
(
s
->
algo_data
);
s
->
algo_data
=
dl
;
}
return
index
;
}
if
(
!
dl
)
RET_FAIL
(
-
100
,
"%s(): no parameters for new slice %d, aborting
\n
"
,
__func__
,
id
);
if
(
si
->
num
>=
MAX_DYNAMIC_SLICES
)
RET_FAIL
(
-
2
,
"%s(): cannot have more than %d slices
\n
"
,
__func__
,
MAX_DYNAMIC_SLICES
);
// for (int s = 0; s < si->num; ++s) {
// scn19_slice_param_t *sd = si->s[s]->algo_data;
// sd->fexp = sd->kpsRequired;
// sd->rbs = 0;
// sd->eff = (sd->kpsReference / RB_NUMS)
// }
dl
->
fexp
=
dl
->
kpsRequired
;
dl
->
rbs
=
0
;
dl
->
texp
=
dl
->
tmax
;
dl
->
fexp
=
dl
->
tmax
*
5000
;
if
(
!
algo
)
RET_FAIL
(
-
14
,
"%s(): no scheduler algorithm provided
\n
"
,
__func__
);
slice_t
*
ns
=
_add_slice
(
&
si
->
num
,
si
->
s
);
if
(
!
ns
)
RET_FAIL
(
-
4
,
"%s(): could not create new slice
\n
"
,
__func__
);
ns
->
id
=
id
;
ns
->
label
=
label
;
ns
->
dl_algo
=
*
(
default_sched_dl_algo_t
*
)
algo
;
if
(
!
ns
->
dl_algo
.
data
)
ns
->
dl_algo
.
data
=
ns
->
dl_algo
.
setup
();
ns
->
algo_data
=
dl
;
LOG_I
(
FLEXRAN_AGENT
,
"End addmod_dynamic_slice_dl in dynamic dynamic Implementation
\n
"
);
return
si
->
num
-
1
;
}
}
...
...
openair2/LAYER2/MAC/slicing/slicing.h
View file @
30feed86
...
...
@@ -64,6 +64,8 @@ int slicing_get_UE_slice_idx(slice_info_t *si, int UE_id);
#define SCN19_SLICING 11
/* only four static slices for UL, DL resp. (not enough DCIs) */
#define MAX_STATIC_SLICES 4
#define MAX_DYNAMIC_SLICES 10
#define RB_NUMS 25
typedef
struct
{
uint16_t
posLow
;
uint16_t
posHigh
;
...
...
@@ -79,6 +81,8 @@ typedef struct {
uint16_t
tau
;
uint16_t
delay
;
}
ondemand_slice_param_t
;
typedef
struct
{
uint16_t
posLow
;
uint16_t
posHigh
;
...
...
@@ -88,8 +92,20 @@ typedef struct {
uint16_t
logdelta
;
uint16_t
tau
;
uint16_t
delay
;
uint16_t
typeid
;
char
*
type
;
uint16_t
fexp
;
uint16_t
rbs
;
uint16_t
texp
;
uint16_t
eff
;
}
scn19_slice_param_t
;
typedef
struct
{
uint16_t
fexp
;
uint16_t
rbs
;
uint16_t
texp
;
}
stats_param_t
;
pp_impl_param_t
static_dl_init
(
module_id_t
mod_id
,
int
CC_id
);
pp_impl_param_t
static_ul_init
(
module_id_t
mod_id
,
int
CC_id
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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