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
Michael Black
OpenXG-RAN
Commits
bcbf2b38
Commit
bcbf2b38
authored
Jun 29, 2022
by
Robert Schmidt
Committed by
Chieh-Chun Chen
Aug 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more MAC stats
parent
61312ca6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
0 deletions
+31
-0
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
+3
-0
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+9
-0
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+11
-0
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+8
-0
No files found.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
View file @
bcbf2b38
...
...
@@ -133,6 +133,9 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
gNB
->
tdd_beam_association
[
i
]
=
-
1
;
}
gNB
->
frame
=
frame
;
gNB
->
slot
=
slot
;
start_meas
(
&
RC
.
nrmac
[
module_idP
]
->
eNB_scheduler
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ULSCH_SCHEDULER
,
VCD_FUNCTION_IN
);
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
View file @
bcbf2b38
...
...
@@ -888,6 +888,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
NR_sched_pdsch_t
*
sched_pdsch
=
&
sched_ctrl
->
sched_pdsch
;
UE
->
mac_stats
.
dl
.
current_bytes
=
0
;
UE
->
mac_stats
.
dl
.
current_rbs
=
0
;
NR_CellGroupConfig_t
*
cg
=
UE
->
CellGroup
;
/* update TA and set ta_apply every 10 frames.
...
...
@@ -1185,6 +1186,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
current_harq_pid
);
T
(
T_GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA
,
T_INT
(
module_id
),
T_INT
(
CC_id
),
T_INT
(
rnti
),
T_INT
(
frame
),
T_INT
(
slot
),
T_INT
(
current_harq_pid
),
T_INT
(
harq
->
round
),
T_BUFFER
(
harq
->
transportBlock
,
TBS
));
UE
->
mac_stats
.
dl
.
total_rbs_retx
+=
sched_pdsch
->
rbSize
;
}
else
{
/* initial transmission */
LOG_D
(
NR_MAC
,
"[%s] Initial HARQ transmission in %d.%d
\n
"
,
__FUNCTION__
,
frame
,
slot
);
uint8_t
*
buf
=
(
uint8_t
*
)
harq
->
transportBlock
;
...
...
@@ -1200,6 +1202,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
int
dlsch_total_bytes
=
0
;
/* next, get RLC data */
start_meas
(
&
gNB_mac
->
rlc_data_req
);
int
sdus
=
0
;
if
(
sched_ctrl
->
num_total_bytes
>
0
)
{
/* loop over all activated logical channels */
...
...
@@ -1251,6 +1254,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
buf
+=
len
+
sizeof
(
NR_MAC_SUBHEADER_LONG
);
dlsch_total_bytes
+=
len
;
lcid_bytes
+=
len
;
sdus
+=
1
;
}
UE
->
mac_stats
.
dl
.
lc_bytes
[
lcid
]
+=
lcid_bytes
;
...
...
@@ -1278,6 +1282,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
}
for
(;
buf
<
bufEnd
;
buf
++
)
*
buf
=
lrand48
()
&
0xff
;
sdus
+=
1
;
}
}
...
...
@@ -1295,6 +1300,10 @@ void nr_schedule_ue_spec(module_id_t module_id,
UE
->
mac_stats
.
dl
.
total_bytes
+=
TBS
;
UE
->
mac_stats
.
dl
.
current_bytes
=
TBS
;
UE
->
mac_stats
.
dl
.
total_rbs
+=
sched_pdsch
->
rbSize
;
UE
->
mac_stats
.
dl
.
num_mac_sdu
+=
sdus
;
UE
->
mac_stats
.
dl
.
current_rbs
=
sched_pdsch
->
rbSize
;
/* save retransmission information */
harq
->
sched_pdsch
=
*
sched_pdsch
;
/* save which time allocation has been used, to be used on
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
bcbf2b38
...
...
@@ -88,6 +88,7 @@ int nr_process_mac_pdu( instance_t module_idP,
uint8_t
done
=
0
;
int
sdus
=
0
;
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE
->
UE_sched_ctrl
;
...
...
@@ -349,6 +350,7 @@ int nr_process_mac_pdu( instance_t module_idP,
1
,
NULL
);
sdus
+=
1
;
/* Updated estimated buffer when receiving data */
if
(
sched_ctrl
->
estimated_ul_buffer
>=
mac_len
)
{
sched_ctrl
->
estimated_ul_buffer
-=
mac_len
;
...
...
@@ -357,6 +359,7 @@ int nr_process_mac_pdu( instance_t module_idP,
}
break
;
sdus
+=
1
;
default:
LOG_E
(
NR_MAC
,
"Received unknown MAC header (LCID = 0x%02x)
\n
"
,
rx_lcid
);
...
...
@@ -388,6 +391,9 @@ int nr_process_mac_pdu( instance_t module_idP,
return
0
;
}
}
UE
->
mac_stats
.
ul
.
num_mac_sdu
+=
sdus
;
return
0
;
}
...
...
@@ -1494,6 +1500,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
NR_UE_UL_BWP_t
*
current_BWP
=
&
UE
->
current_UL_BWP
;
UE
->
mac_stats
.
ul
.
current_bytes
=
0
;
UE
->
mac_stats
.
ul
.
current_rbs
=
0
;
/* dynamic PUSCH values (RB alloc, MCS, hence R, Qm, TBS) that change in
* every TTI are pre-populated by the preprocessor and used below */
...
...
@@ -1548,6 +1555,8 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
* retransmissions */
cur_harq
->
sched_pusch
.
time_domain_allocation
=
ps
->
time_domain_allocation
;
sched_ctrl
->
sched_ul_bytes
+=
sched_pusch
->
tb_size
;
UE
->
mac_stats
.
ul
.
total_rbs
+=
sched_pusch
->
rbSize
;
}
else
{
LOG_D
(
NR_MAC
,
"%d.%2d UL retransmission RNTI %04x sched %d.%2d HARQ PID %d round %d NDI %d
\n
"
,
...
...
@@ -1559,8 +1568,10 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
harq_id
,
cur_harq
->
round
,
cur_harq
->
ndi
);
UE
->
mac_stats
.
ul
.
total_rbs_retx
+=
sched_pusch
->
rbSize
;
}
UE
->
mac_stats
.
ul
.
current_bytes
=
sched_pusch
->
tb_size
;
UE
->
mac_stats
.
ul
.
current_rbs
=
sched_pusch
->
rbSize
;
sched_ctrl
->
last_ul_frame
=
sched_pusch
->
frame
;
sched_ctrl
->
last_ul_slot
=
sched_pusch
->
slot
;
...
...
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
View file @
bcbf2b38
...
...
@@ -667,6 +667,10 @@ typedef struct NR_mac_dir_stats {
uint64_t
errors
;
uint64_t
total_bytes
;
uint32_t
current_bytes
;
uint32_t
total_rbs
;
uint32_t
total_rbs_retx
;
uint32_t
num_mac_sdu
;
uint32_t
current_rbs
;
}
NR_mac_dir_stats_t
;
typedef
struct
NR_mac_stats
{
...
...
@@ -849,6 +853,10 @@ typedef struct gNB_MAC_INST_s {
uint8_t
min_grant_mcs
;
nr_mac_rrc_ul_if_t
mac_rrc
;
int16_t
frame
;
int16_t
slot
;
}
gNB_MAC_INST
;
#endif
/*__LAYER2_NR_MAC_GNB_H__ */
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