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
canghaiwuhen
OpenXG-RAN
Commits
8f450f0e
Commit
8f450f0e
authored
Apr 09, 2020
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DL PP: consider the last RBG might be smaller
parent
1372e022
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
8 deletions
+32
-8
openair2/LAYER2/MAC/pre_processor.c
openair2/LAYER2/MAC/pre_processor.c
+32
-8
No files found.
openair2/LAYER2/MAC/pre_processor.c
View file @
8f450f0e
...
...
@@ -59,6 +59,15 @@ int next_ue_list_looped(UE_list_t* list, int UE_id) {
return
list
->
next
[
UE_id
]
<
0
?
list
->
head
:
list
->
next
[
UE_id
];
}
int
get_rbg_size_last
(
module_id_t
Mod_id
,
int
CC_id
)
{
const
int
RBGsize
=
get_min_rb_unit
(
Mod_id
,
CC_id
);
const
int
N_RB_DL
=
to_prb
(
RC
.
mac
[
Mod_id
]
->
common_channels
[
CC_id
].
mib
->
message
.
dl_Bandwidth
);
if
(
N_RB_DL
==
15
||
N_RB_DL
==
25
||
N_RB_DL
==
50
||
N_RB_DL
==
75
)
return
RBGsize
-
1
;
else
return
RBGsize
;
}
int
g_start_ue_dl
=
-
1
;
int
round_robin_dl
(
module_id_t
Mod_id
,
int
CC_id
,
...
...
@@ -70,7 +79,9 @@ int round_robin_dl(module_id_t Mod_id,
uint8_t
*
rbgalloc_mask
)
{
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
);
const
int
RBGsize
=
get_min_rb_unit
(
Mod_id
,
CC_id
);
const
int
RBGlastsize
=
get_rbg_size_last
(
Mod_id
,
CC_id
);
int
num_ue_req
=
0
;
UE_info_t
*
UE_info
=
&
RC
.
mac
[
Mod_id
]
->
UE_info
;
...
...
@@ -89,14 +100,26 @@ int round_robin_dl(module_id_t Mod_id,
UE_sched_ctrl_t
*
ue_ctrl
=
&
UE_info
->
UE_sched_ctrl
[
UE_id
];
const
uint8_t
round
=
ue_ctrl
->
round
[
CC_id
][
harq_pid
];
if
(
round
!=
8
)
{
// retransmission: allocate
int
nb_rb
=
UE_info
->
UE_template
[
CC_id
][
UE_id
].
nb_rb
[
harq_pid
];
const
int
nb_rb
=
UE_info
->
UE_template
[
CC_id
][
UE_id
].
nb_rb
[
harq_pid
];
if
(
nb_rb
==
0
)
continue
;
if
(
nb_rb
%
RBGsize
!=
0
)
nb_rb
+=
nb_rb
%
RBGsize
;
// should now divide evenly
int
nb_rbg
=
nb_rb
/
RBGsize
;
if
(
nb_rbg
>
n_rbg_sched
)
// needs more RBGs than we can allocate
int
nb_rbg
=
(
nb_rb
+
(
nb_rb
%
RBGsize
))
/
RBGsize
;
// needs more RBGs than we can allocate
if
(
nb_rbg
>
n_rbg_sched
)
{
LOG_D
(
MAC
,
"retransmission of UE %d needs more RBGs (%d) than we have (%d)
\n
"
,
UE_id
,
nb_rbg
,
n_rbg_sched
);
continue
;
}
// ensure that the number of RBs can be contained by the RBGs (!), i.e.
// if we allocate the last RBG this one should have the full RBGsize
if
((
nb_rb
%
RBGsize
)
==
0
&&
nb_rbg
==
n_rbg_sched
&&
rbgalloc_mask
[
N_RBG
-
1
]
&&
RBGlastsize
!=
RBGsize
)
{
LOG_D
(
MAC
,
"retransmission of UE %d needs %d RBs, but the last RBG %d is too small (%d, normal %d)
\n
"
,
UE_id
,
nb_rb
,
N_RBG
-
1
,
RBGlastsize
,
RBGsize
);
continue
;
}
const
uint8_t
cqi
=
ue_ctrl
->
dl_cqi
[
CC_id
];
const
int
idx
=
CCE_try_allocate_dlsch
(
Mod_id
,
CC_id
,
subframe
,
UE_id
,
cqi
);
if
(
idx
<
0
)
...
...
@@ -186,9 +209,10 @@ int round_robin_dl(module_id_t Mod_id,
continue
;
UE_sched_ctrl_t
*
ue_ctrl
=
&
UE_info
->
UE_sched_ctrl
[
UE_id
];
ue_ctrl
->
rballoc_sub_UE
[
CC_id
][
rbg
]
=
1
;
ue_ctrl
->
pre_nb_available_rbs
[
CC_id
]
+=
RBGsize
;
rb_required
[
UE_id
]
-=
RBGsize
;
rb_required_total
-=
RBGsize
;
const
int
sRBG
=
rbg
==
N_RBG
-
1
?
RBGlastsize
:
RBGsize
;
ue_ctrl
->
pre_nb_available_rbs
[
CC_id
]
+=
sRBG
;
rb_required
[
UE_id
]
-=
sRBG
;
rb_required_total
-=
sRBG
;
if
(
rb_required_total
<=
0
)
break
;
n_rbg_sched
--
;
...
...
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