Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
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
alex037yang
OpenXG-RAN
Commits
18a6961f
Commit
18a6961f
authored
Jun 17, 2020
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Format to dynamically handle default DL SCHED algo
parent
8c7d9413
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
25 deletions
+65
-25
openair2/LAYER2/MAC/mac.h
openair2/LAYER2/MAC/mac.h
+15
-0
openair2/LAYER2/MAC/main.c
openair2/LAYER2/MAC/main.c
+5
-1
openair2/LAYER2/MAC/pre_processor.c
openair2/LAYER2/MAC/pre_processor.c
+45
-24
No files found.
openair2/LAYER2/MAC/mac.h
View file @
18a6961f
...
...
@@ -1274,6 +1274,19 @@ typedef struct {
int
length
;
}
contig_rbs_t
;
/**
* definition of a scheduling algorithm implementation used in the
* default scheduler
*/
typedef
struct
{
char
*
name
;
void
*
(
*
setup
)(
void
);
void
(
*
unset
)(
void
**
);
int
(
*
run
)(
module_id_t
,
int
,
int
,
int
,
UE_list_t
*
,
int
,
int
,
uint8_t
*
,
void
*
);
void
*
data
;
}
default_sched_dl_algo_t
;
/*! \brief eNB common channels */
typedef
struct
{
int
physCellId
;
...
...
@@ -1432,6 +1445,8 @@ typedef struct eNB_MAC_INST_s {
UE_free_list_t
UE_free_list
;
/// for scheduling selection
SCHEDULER_MODES
scheduler_mode
;
/// scheduling algorithm used in default scheduler
default_sched_dl_algo_t
dl_algo
;
int32_t
puSch10xSnr
;
int32_t
puCch10xSnr
;
...
...
openair2/LAYER2/MAC/main.c
View file @
18a6961f
...
...
@@ -128,7 +128,11 @@ void mac_top_init_eNB(void)
}
mac
[
i
]
->
if_inst
=
IF_Module_init
(
i
);
char
*
s
=
"round_robin_dl"
;
void
*
d
=
dlsym
(
NULL
,
s
);
AssertFatal
(
d
,
"%s(): no scheduler algo '%s' found
\n
"
,
__func__
,
s
);
mac
[
i
]
->
dl_algo
=
*
(
default_sched_dl_algo_t
*
)
d
;
mac
[
i
]
->
dl_algo
.
data
=
mac
[
i
]
->
dl_algo
.
setup
();
init_UE_info
(
&
mac
[
i
]
->
UE_info
);
init_slice_info
(
&
mac
[
i
]
->
slice_info
);
}
...
...
openair2/LAYER2/MAC/pre_processor.c
View file @
18a6961f
...
...
@@ -69,15 +69,26 @@ int get_rbg_size_last(module_id_t Mod_id, int CC_id) {
return
RBGsize
;
}
int
g_start_ue_dl
=
-
1
;
int
round_robin_dl
(
module_id_t
Mod_id
,
int
CC_id
,
int
frame
,
int
subframe
,
UE_list_t
*
UE_list
,
int
max_num_ue
,
int
n_rbg_sched
,
uint8_t
*
rbgalloc_mask
)
{
void
*
rr_dl_setup
(
void
)
{
void
*
data
=
malloc
(
sizeof
(
int
));
*
(
int
*
)
data
=
0
;
AssertFatal
(
data
,
"could not allocate data in %s()
\n
"
,
__func__
);
return
data
;
}
void
rr_dl_unset
(
void
**
data
)
{
if
(
*
data
)
free
(
*
data
);
*
data
=
NULL
;
}
int
rr_dl_run
(
module_id_t
Mod_id
,
int
CC_id
,
int
frame
,
int
subframe
,
UE_list_t
*
UE_list
,
int
max_num_ue
,
int
n_rbg_sched
,
uint8_t
*
rbgalloc_mask
,
void
*
data
)
{
DevAssert
(
UE_list
->
head
>=
0
);
DevAssert
(
n_rbg_sched
>
0
);
const
int
N_RBG
=
to_rbg
(
RC
.
mac
[
Mod_id
]
->
common_channels
[
CC_id
].
mib
->
message
.
dl_Bandwidth
);
...
...
@@ -91,10 +102,10 @@ int round_robin_dl(module_id_t Mod_id,
/* just start with the UE after the one we had last time. If it does not
* exist, this will start at the head */
int
g_start_ue_dl
=
data
;
g_start_ue_dl
=
next_ue_list_looped
(
UE_list
,
g_start_ue_dl
);
int
*
start_ue
=
data
;
*
start_ue
=
next_ue_list_looped
(
UE_list
,
*
start_ue
);
int
UE_id
=
g_start_ue_dl
;
int
UE_id
=
*
start_ue
;
UE_list_t
UE_sched
;
int
*
cur_UE
=
&
UE_sched
.
head
;
// Allocate retransmissions, and mark UEs with new transmissions
...
...
@@ -163,7 +174,7 @@ int round_robin_dl(module_id_t Mod_id,
skip_ue:
UE_id
=
next_ue_list_looped
(
UE_list
,
UE_id
);
}
while
(
UE_id
!=
g_start_ue_dl
);
}
while
(
UE_id
!=
*
start_ue
);
*
cur_UE
=
-
1
;
// mark end
if
(
UE_sched
.
head
<
0
)
...
...
@@ -217,6 +228,14 @@ skip_ue:
return
n_rbg_sched
;
}
default_sched_dl_algo_t
round_robin_dl
=
{
.
name
=
"round_robin_dl"
,
.
setup
=
rr_dl_setup
,
.
unset
=
rr_dl_unset
,
.
run
=
rr_dl_run
,
.
data
=
NULL
};
// This function stores the downlink buffer for all the logical channels
void
...
...
@@ -306,8 +325,9 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
int
CC_id
,
frame_t
frameP
,
sub_frame_t
subframeP
)
{
UE_info_t
*
UE_info
=
&
RC
.
mac
[
Mod_id
]
->
UE_info
;
const
int
N_RBG
=
to_rbg
(
RC
.
mac
[
Mod_id
]
->
common_channels
[
CC_id
].
mib
->
message
.
dl_Bandwidth
);
eNB_MAC_INST
*
mac
=
RC
.
mac
[
Mod_id
];
UE_info_t
*
UE_info
=
&
mac
->
UE_info
;
const
int
N_RBG
=
to_rbg
(
mac
->
common_channels
[
CC_id
].
mib
->
message
.
dl_Bandwidth
);
const
int
RBGsize
=
get_min_rb_unit
(
Mod_id
,
CC_id
);
store_dlsch_buffer
(
Mod_id
,
CC_id
,
frameP
,
subframeP
);
...
...
@@ -364,7 +384,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
if
(
UE_to_sched
.
head
<
0
)
return
;
uint8_t
*
vrb_map
=
RC
.
mac
[
Mod_id
]
->
common_channels
[
CC_id
].
vrb_map
;
uint8_t
*
vrb_map
=
mac
->
common_channels
[
CC_id
].
vrb_map
;
uint8_t
rbgalloc_mask
[
N_RBG_MAX
];
int
n_rbg_sched
=
0
;
for
(
int
i
=
0
;
i
<
N_RBG
;
i
++
)
{
...
...
@@ -376,14 +396,15 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
n_rbg_sched
+=
rbgalloc_mask
[
i
];
}
round_robin_dl
(
Mod_id
,
CC_id
,
frameP
,
subframeP
,
&
UE_to_sched
,
4
,
// max_num_ue
n_rbg_sched
,
rbgalloc_mask
);
mac
->
dl_algo
.
run
(
Mod_id
,
CC_id
,
frameP
,
subframeP
,
&
UE_to_sched
,
4
,
// max_num_ue
n_rbg_sched
,
rbgalloc_mask
,
mac
->
dl_algo
.
data
);
// the following block is meant for validation of the pre-processor to check
// whether all UE allocations are non-overlapping and is not necessary for
...
...
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