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
lizhongxiao
OpenXG-RAN
Commits
081a2879
Commit
081a2879
authored
Jul 02, 2021
by
luis_pereira87
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix gNB downlink MAC short/long header accordingly with RLC buffer size
parent
dcfec657
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
13 deletions
+32
-13
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+32
-13
No files found.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
View file @
081a2879
...
@@ -1102,12 +1102,18 @@ void nr_schedule_ue_spec(module_id_t module_id,
...
@@ -1102,12 +1102,18 @@ void nr_schedule_ue_spec(module_id_t module_id,
if
(
sched_ctrl
->
num_total_bytes
>
0
)
{
if
(
sched_ctrl
->
num_total_bytes
>
0
)
{
tbs_size_t
len
=
0
;
tbs_size_t
len
=
0
;
while
(
size
>
3
)
{
while
(
size
>
3
)
{
// we do not know how much data we will get from RLC, i.e., whether it
// will be longer than 256B or not. Therefore, reserve space for long header, then
// Reserve space for short or long header.
// fetch data, then fill real length
// Check if data from RLC is equal or longer than 256B or not.
NR_MAC_SUBHEADER_LONG
*
header
=
(
NR_MAC_SUBHEADER_LONG
*
)
buf
;
// Data from RLC was checked before, in function nr_store_dlsch_buffer
buf
+=
3
;
uint8_t
*
header
=
buf
;
size
-=
3
;
if
(
sched_ctrl
->
num_total_bytes
>=
256
)
{
buf
+=
sizeof
(
NR_MAC_SUBHEADER_LONG
);
size
-=
sizeof
(
NR_MAC_SUBHEADER_LONG
);
}
else
{
buf
+=
sizeof
(
NR_MAC_SUBHEADER_SHORT
);
size
-=
sizeof
(
NR_MAC_SUBHEADER_SHORT
);
}
/* limit requested number of bytes to what preprocessor specified, or
/* limit requested number of bytes to what preprocessor specified, or
* such that TBS is full */
* such that TBS is full */
...
@@ -1137,19 +1143,32 @@ void nr_schedule_ue_spec(module_id_t module_id,
...
@@ -1137,19 +1143,32 @@ void nr_schedule_ue_spec(module_id_t module_id,
if
(
len
==
0
)
if
(
len
==
0
)
break
;
break
;
header
->
R
=
0
;
if
(
sched_ctrl
->
num_total_bytes
>=
256
)
{
header
->
F
=
1
;
((
NR_MAC_SUBHEADER_LONG
*
)
header
)
->
R
=
0
;
header
->
LCID
=
lcid
;
((
NR_MAC_SUBHEADER_LONG
*
)
header
)
->
F
=
1
;
header
->
L1
=
(
len
>>
8
)
&
0xff
;
((
NR_MAC_SUBHEADER_LONG
*
)
header
)
->
LCID
=
lcid
;
header
->
L2
=
len
&
0xff
;
((
NR_MAC_SUBHEADER_LONG
*
)
header
)
->
L1
=
(
len
>>
8
)
&
0xff
;
((
NR_MAC_SUBHEADER_LONG
*
)
header
)
->
L2
=
len
&
0xff
;
}
else
{
((
NR_MAC_SUBHEADER_SHORT
*
)
header
)
->
R
=
0
;
((
NR_MAC_SUBHEADER_SHORT
*
)
header
)
->
F
=
0
;
((
NR_MAC_SUBHEADER_SHORT
*
)
header
)
->
LCID
=
lcid
;
((
NR_MAC_SUBHEADER_SHORT
*
)
header
)
->
L
=
len
&
0xff
;
}
size
-=
len
;
size
-=
len
;
buf
+=
len
;
buf
+=
len
;
dlsch_total_bytes
+=
len
;
dlsch_total_bytes
+=
len
;
}
}
if
(
len
==
0
)
{
if
(
len
==
0
)
{
/* RLC did not have data anymore, mark buffer as unused */
/* RLC did not have data anymore, mark buffer as unused */
buf
-=
3
;
if
(
sched_ctrl
->
num_total_bytes
>=
256
)
{
size
+=
3
;
buf
-=
sizeof
(
NR_MAC_SUBHEADER_LONG
);
size
+=
sizeof
(
NR_MAC_SUBHEADER_LONG
);
}
else
{
buf
-=
sizeof
(
NR_MAC_SUBHEADER_SHORT
);
size
+=
sizeof
(
NR_MAC_SUBHEADER_SHORT
);
}
}
}
}
}
else
if
(
get_softmodem_params
()
->
phy_test
||
get_softmodem_params
()
->
do_ra
||
get_softmodem_params
()
->
sa
)
{
else
if
(
get_softmodem_params
()
->
phy_test
||
get_softmodem_params
()
->
do_ra
||
get_softmodem_params
()
->
sa
)
{
...
...
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