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
wangwenhui
OpenXG-RAN
Commits
eb9a5c16
Commit
eb9a5c16
authored
Feb 26, 2018
by
Niccolò Iardella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring and optimization
parent
36a081b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
41 deletions
+36
-41
openair2/LAYER2/MAC/pre_processor.c
openair2/LAYER2/MAC/pre_processor.c
+36
-40
openair2/LAYER2/MAC/proto.h
openair2/LAYER2/MAC/proto.h
+0
-1
No files found.
openair2/LAYER2/MAC/pre_processor.c
View file @
eb9a5c16
...
@@ -626,8 +626,12 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
...
@@ -626,8 +626,12 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
rnti_t
rnti
;
rnti_t
rnti
;
uint8_t
harq_pid
,
round
;
uint8_t
harq_pid
,
round
;
uint8_t
total_rbs_used
[
MAX_NUM_CCs
];
uint8_t
rbs_retx
[
MAX_NUM_CCs
];
uint16_t
average_rbs_per_user
[
MAX_NUM_CCs
];
uint16_t
average_rbs_per_user
[
MAX_NUM_CCs
];
int
ue_count_newtx
[
MAX_NUM_CCs
];
int
ue_count_retx
[
MAX_NUM_CCs
];
uint8_t
ue_retx_flag
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
];
int
N_RB_DL
;
int
N_RB_DL
;
UE_list_t
*
UE_list
=
&
RC
.
mac
[
Mod_id
]
->
UE_list
;
UE_list_t
*
UE_list
=
&
RC
.
mac
[
Mod_id
]
->
UE_list
;
...
@@ -635,10 +639,15 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
...
@@ -635,10 +639,15 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
COMMON_channels_t
*
cc
;
COMMON_channels_t
*
cc
;
// Reset
// Reset
for
(
CC_id
=
0
;
CC_id
<
MAX_NUM_CCs
;
CC_id
++
)
{
for
(
CC_id
=
0
;
CC_id
<
MAX_NUM_CCs
;
++
CC_id
)
{
total_ue_count
[
CC_id
]
=
0
;
total_ue_count
[
CC_id
]
=
0
;
total_rbs_used
[
CC_id
]
=
0
;
ue_count_newtx
[
CC_id
]
=
0
;
ue_count_retx
[
CC_id
]
=
0
;
rbs_retx
[
CC_id
]
=
0
;
average_rbs_per_user
[
CC_id
]
=
0
;
average_rbs_per_user
[
CC_id
]
=
0
;
for
(
UE_id
=
0
;
UE_id
<
NUMBER_OF_UE_MAX
;
++
UE_id
)
{
ue_retx_flag
[
CC_id
][
UE_id
]
=
0
;
}
}
}
// Find total UE count, and account the RBs required for retransmissions
// Find total UE count, and account the RBs required for retransmissions
...
@@ -660,16 +669,17 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
...
@@ -660,16 +669,17 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
harq_pid
=
((
frameP
*
10
)
+
subframeP
)
&
7
;
harq_pid
=
((
frameP
*
10
)
+
subframeP
)
&
7
;
round
=
ue_sched_ctl
->
round
[
CC_id
][
harq_pid
];
round
=
ue_sched_ctl
->
round
[
CC_id
][
harq_pid
];
average_rbs_per_user
[
CC_id
]
=
0
;
if
(
nb_rbs_required
[
CC_id
][
UE_id
]
>
0
)
{
total_ue_count
[
CC_id
]
++
;
}
if
(
round
!=
8
)
{
if
(
round
!=
8
)
{
nb_rbs_required
[
CC_id
][
UE_id
]
=
UE_list
->
UE_template
[
CC_id
][
UE_id
].
nb_rb
[
harq_pid
];
nb_rbs_required
[
CC_id
][
UE_id
]
=
UE_list
->
UE_template
[
CC_id
][
UE_id
].
nb_rb
[
harq_pid
];
total_rbs_used
[
CC_id
]
+=
nb_rbs_required
[
CC_id
][
UE_id
];
rbs_retx
[
CC_id
]
+=
nb_rbs_required
[
CC_id
][
UE_id
];
}
ue_count_retx
[
CC_id
]
++
;
ue_retx_flag
[
CC_id
][
UE_id
]
=
1
;
//nb_rbs_required_remaining[UE_id] = nb_rbs_required[UE_id];
}
else
{
if
(
nb_rbs_required
[
CC_id
][
UE_id
]
>
0
)
{
ue_count_newtx
[
CC_id
]
++
;
total_ue_count
[
CC_id
]
=
total_ue_count
[
CC_id
]
+
1
;
}
}
}
}
}
}
...
@@ -682,20 +692,10 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
...
@@ -682,20 +692,10 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
if
(
UE_list
->
UE_sched_ctrl
[
UE_id
].
ul_out_of_sync
==
1
)
continue
;
if
(
UE_list
->
UE_sched_ctrl
[
UE_id
].
ul_out_of_sync
==
1
)
continue
;
if
(
!
ue_slice_membership
(
UE_id
,
slice_id
))
continue
;
if
(
!
ue_slice_membership
(
UE_id
,
slice_id
))
continue
;
for
(
i
=
0
;
i
<
UE_num_active_CC
(
UE_list
,
UE_id
);
i
++
)
{
for
(
i
=
0
;
i
<
UE_num_active_CC
(
UE_list
,
UE_id
);
++
i
)
{
CC_id
=
UE_list
->
ordered_CCids
[
i
][
UE_id
];
CC_id
=
UE_list
->
ordered_CCids
[
i
][
UE_id
];
// hypothetical assignment
N_RB_DL
=
to_prb
(
RC
.
mac
[
Mod_id
]
->
common_channels
[
CC_id
].
mib
->
message
.
dl_Bandwidth
)
-
rbs_retx
[
CC_id
];
/*
* If schedule is enabled and if the priority of the UEs is modified
* The average rbs per logical channel per user will depend on the level of
* priority. Concerning the hypothetical assignement, we should assign more
* rbs to prioritized users. Maybe, we can do a mapping between the
* average rbs per user and the level of priority or multiply the average rbs
* per user by a coefficient which represents the degree of priority.
*/
N_RB_DL
=
to_prb
(
RC
.
mac
[
Mod_id
]
->
common_channels
[
CC_id
].
mib
->
message
.
dl_Bandwidth
)
-
total_rbs_used
[
CC_id
];
// recalculate based on the what is left after retransmission
// recalculate based on the what is left after retransmission
ue_sched_ctl
=
&
UE_list
->
UE_sched_ctrl
[
UE_id
];
ue_sched_ctl
=
&
UE_list
->
UE_sched_ctrl
[
UE_id
];
...
@@ -709,7 +709,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
...
@@ -709,7 +709,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
(
uint16_t
)
floor
(
ue_sched_ctl
->
max_rbs_allowed_slice
[
CC_id
][
slice_id
]
/
total_ue_count
[
CC_id
]);
(
uint16_t
)
floor
(
ue_sched_ctl
->
max_rbs_allowed_slice
[
CC_id
][
slice_id
]
/
total_ue_count
[
CC_id
]);
}
else
{
}
else
{
// consider the total number of use that can be scheduled UE
// consider the total number of use that can be scheduled UE
average_rbs_per_user
[
CC_id
]
=
min_rb_unit
[
CC_id
];
average_rbs_per_user
[
CC_id
]
=
(
uint16_t
)
min_rb_unit
[
CC_id
];
}
}
}
}
}
}
...
@@ -718,13 +718,9 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
...
@@ -718,13 +718,9 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
// extend nb_rbs_required to capture per LCID RB required
// extend nb_rbs_required to capture per LCID RB required
for
(
UE_id
=
UE_list
->
head
;
UE_id
>=
0
;
UE_id
=
UE_list
->
next
[
UE_id
])
{
for
(
UE_id
=
UE_list
->
head
;
UE_id
>=
0
;
UE_id
=
UE_list
->
next
[
UE_id
])
{
rnti
=
UE_RNTI
(
Mod_id
,
UE_id
);
rnti
=
UE_RNTI
(
Mod_id
,
UE_id
);
if
(
rnti
==
NOT_A_RNTI
)
continue
;
if
(
rnti
==
NOT_A_RNTI
)
if
(
UE_list
->
UE_sched_ctrl
[
UE_id
].
ul_out_of_sync
==
1
)
continue
;
continue
;
if
(
!
ue_slice_membership
(
UE_id
,
slice_id
))
continue
;
if
(
UE_list
->
UE_sched_ctrl
[
UE_id
].
ul_out_of_sync
==
1
)
continue
;
if
(
!
ue_slice_membership
(
UE_id
,
slice_id
))
continue
;
for
(
i
=
0
;
i
<
UE_num_active_CC
(
UE_list
,
UE_id
);
i
++
)
{
for
(
i
=
0
;
i
<
UE_num_active_CC
(
UE_list
,
UE_id
);
i
++
)
{
CC_id
=
UE_list
->
ordered_CCids
[
i
][
UE_id
];
CC_id
=
UE_list
->
ordered_CCids
[
i
][
UE_id
];
...
@@ -763,7 +759,7 @@ void dlsch_scheduler_pre_processor_positioning(module_id_t Mod_id,
...
@@ -763,7 +759,7 @@ void dlsch_scheduler_pre_processor_positioning(module_id_t Mod_id,
uint8_t
transmission_mode
;
uint8_t
transmission_mode
;
uint8_t
slice_allocation_mask
[
MAX_NUM_CCs
][
N_RBG_MAX
];
uint8_t
slice_allocation_mask
[
MAX_NUM_CCs
][
N_RBG_MAX
];
uint16_t
nb_rbs_re
quired_re
maining
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
];
uint16_t
nb_rbs_remaining
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
];
rnti_t
rnti
;
rnti_t
rnti
;
UE_list_t
*
UE_list
=
&
RC
.
mac
[
Mod_id
]
->
UE_list
;
UE_list_t
*
UE_list
=
&
RC
.
mac
[
Mod_id
]
->
UE_list
;
...
@@ -780,22 +776,22 @@ void dlsch_scheduler_pre_processor_positioning(module_id_t Mod_id,
...
@@ -780,22 +776,22 @@ void dlsch_scheduler_pre_processor_positioning(module_id_t Mod_id,
CC_id
=
UE_list
->
ordered_CCids
[
i
][
UE_id
];
CC_id
=
UE_list
->
ordered_CCids
[
i
][
UE_id
];
if
(
r1
==
0
)
{
if
(
r1
==
0
)
{
nb_rbs_re
quired_re
maining
[
CC_id
][
UE_id
]
=
nb_rbs_remaining
[
CC_id
][
UE_id
]
=
nb_rbs_accounted
[
CC_id
][
UE_id
];
nb_rbs_accounted
[
CC_id
][
UE_id
];
}
else
{
// rb required based only on the buffer - rb allocated in the 1st round + extra reaming rb form the 1st round
}
else
{
// rb required based only on the buffer - rb allocated in the 1st round + extra reaming rb form the 1st round
nb_rbs_re
quired_re
maining
[
CC_id
][
UE_id
]
=
nb_rbs_remaining
[
CC_id
][
UE_id
]
=
nb_rbs_required
[
CC_id
][
UE_id
]
-
nb_rbs_required
[
CC_id
][
UE_id
]
-
nb_rbs_accounted
[
CC_id
][
UE_id
]
+
nb_rbs_accounted
[
CC_id
][
UE_id
]
+
nb_rbs_required
_remaining
[
CC_id
][
UE_id
];
nb_rbs
_remaining
[
CC_id
][
UE_id
];
if
(
nb_rbs_re
quired_re
maining
[
CC_id
][
UE_id
]
<
0
)
if
(
nb_rbs_remaining
[
CC_id
][
UE_id
]
<
0
)
abort
();
abort
();
}
}
if
(
nb_rbs_required
[
CC_id
][
UE_id
]
>
0
)
if
(
nb_rbs_required
[
CC_id
][
UE_id
]
>
0
)
LOG_D
(
MAC
,
LOG_D
(
MAC
,
"round %d : nb_rbs_re
quired_remaining[%d][%d]= %d (remaining_1
%d, required %d, pre_nb_available_rbs %d, N_RBG %d, rb_unit %d)
\n
"
,
"round %d : nb_rbs_re
maining[%d][%d]= %d (accounted
%d, required %d, pre_nb_available_rbs %d, N_RBG %d, rb_unit %d)
\n
"
,
r1
,
CC_id
,
UE_id
,
r1
,
CC_id
,
UE_id
,
nb_rbs_re
quired_re
maining
[
CC_id
][
UE_id
],
nb_rbs_remaining
[
CC_id
][
UE_id
],
nb_rbs_accounted
[
CC_id
][
UE_id
],
nb_rbs_accounted
[
CC_id
][
UE_id
],
nb_rbs_required
[
CC_id
][
UE_id
],
nb_rbs_required
[
CC_id
][
UE_id
],
UE_list
->
UE_sched_ctrl
[
UE_id
].
pre_nb_available_rbs
[
CC_id
],
UE_list
->
UE_sched_ctrl
[
UE_id
].
pre_nb_available_rbs
[
CC_id
],
...
@@ -833,10 +829,9 @@ void dlsch_scheduler_pre_processor_positioning(module_id_t Mod_id,
...
@@ -833,10 +829,9 @@ void dlsch_scheduler_pre_processor_positioning(module_id_t Mod_id,
UE_id
,
UE_id
,
CC_id
,
CC_id
,
N_RBG
[
CC_id
],
N_RBG
[
CC_id
],
transmission_mode
,
min_rb_unit
[
CC_id
],
min_rb_unit
[
CC_id
],
nb_rbs_required
,
nb_rbs_required
,
nb_rbs_re
quired_re
maining
,
nb_rbs_remaining
,
rballoc_sub
,
rballoc_sub
,
slice_allocation_mask
,
slice_allocation_mask
,
MIMO_mode_indicator
);
MIMO_mode_indicator
);
...
@@ -1053,6 +1048,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
...
@@ -1053,6 +1048,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
MIMO_mode_indicator
,
MIMO_mode_indicator
,
mbsfn_flag
);
// TODO Not sure if useful
mbsfn_flag
);
// TODO Not sure if useful
// STATUS
// Store the DLSCH buffer for each logical channel
// Store the DLSCH buffer for each logical channel
store_dlsch_buffer
(
Mod_id
,
slice_id
,
frameP
,
subframeP
);
store_dlsch_buffer
(
Mod_id
,
slice_id
,
frameP
,
subframeP
);
...
@@ -1374,7 +1370,6 @@ dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id,
...
@@ -1374,7 +1370,6 @@ dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id,
int
UE_id
,
int
UE_id
,
uint8_t
CC_id
,
uint8_t
CC_id
,
int
N_RBG
,
int
N_RBG
,
int
tm
,
int
min_rb_unit
,
int
min_rb_unit
,
uint16_t
nb_rbs_required
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
],
uint16_t
nb_rbs_required
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
],
uint16_t
nb_rbs_remaining
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
],
uint16_t
nb_rbs_remaining
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
],
...
@@ -1383,6 +1378,7 @@ dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id,
...
@@ -1383,6 +1378,7 @@ dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id,
unsigned
char
MIMO_mode_indicator
[
MAX_NUM_CCs
][
N_RBG_MAX
])
{
unsigned
char
MIMO_mode_indicator
[
MAX_NUM_CCs
][
N_RBG_MAX
])
{
int
i
;
int
i
;
int
tm
=
get_tmode
(
Mod_id
,
CC_id
,
UE_id
);
UE_list_t
*
UE_list
=
&
RC
.
mac
[
Mod_id
]
->
UE_list
;
UE_list_t
*
UE_list
=
&
RC
.
mac
[
Mod_id
]
->
UE_list
;
UE_sched_ctrl
*
ue_sched_ctl
=
&
UE_list
->
UE_sched_ctrl
[
UE_id
];
UE_sched_ctrl
*
ue_sched_ctl
=
&
UE_list
->
UE_sched_ctrl
[
UE_id
];
int
N_RB_DL
=
to_prb
(
RC
.
mac
[
Mod_id
]
->
common_channels
[
CC_id
].
mib
->
message
.
dl_Bandwidth
);
int
N_RB_DL
=
to_prb
(
RC
.
mac
[
Mod_id
]
->
common_channels
[
CC_id
].
mib
->
message
.
dl_Bandwidth
);
...
...
openair2/LAYER2/MAC/proto.h
View file @
eb9a5c16
...
@@ -251,7 +251,6 @@ void dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id,
...
@@ -251,7 +251,6 @@ void dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id,
int
UE_id
,
int
UE_id
,
uint8_t
CC_id
,
uint8_t
CC_id
,
int
N_RBG
,
int
N_RBG
,
int
transmission_mode
,
int
min_rb_unit
,
int
min_rb_unit
,
uint16_t
nb_rbs_required
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
],
uint16_t
nb_rbs_required
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
],
uint16_t
nb_rbs_required_remaining
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
],
uint16_t
nb_rbs_required_remaining
[
MAX_NUM_CCs
][
NUMBER_OF_UE_MAX
],
...
...
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