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
51a7b7bd
Commit
51a7b7bd
authored
Jun 30, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove memory leaks in FAPI PUCCH 0-4 PDU handling
parent
2465f1fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
29 deletions
+27
-29
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
+25
-12
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
+2
-17
No files found.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
View file @
51a7b7bd
...
...
@@ -909,21 +909,26 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
handle_dl_harq
(
UE
,
pid
,
harq_value
==
0
&&
harq_confidence
==
0
,
RC
.
nrmac
[
mod_id
]
->
dl_bler
.
harq_round_max
);
if
(
harq_confidence
==
1
)
UE
->
mac_stats
.
pucch0_DTX
++
;
}
}
// check scheduling request result, confidence_level == 0 is good
if
(
uci_01
->
pduBitmap
&
0x1
&&
uci_01
->
sr
->
sr_indication
&&
uci_01
->
sr
->
sr_confidence_level
==
0
&&
uci_01
->
ul_cqi
>=
148
)
{
// SR detected with SNR >= 10dB
sched_ctrl
->
SR
|=
true
;
LOG_D
(
NR_MAC
,
"SR UE %04x ul_cqi %d
\n
"
,
uci_01
->
rnti
,
uci_01
->
ul_cqi
);
// tpc (power control) only if we received AckNack
if
(
uci_01
->
harq
->
harq_confidence_level
==
0
)
sched_ctrl
->
tpc1
=
nr_get_tpc
(
RC
.
nrmac
[
mod_id
]
->
pucch_target_snrx10
,
uci_01
->
ul_cqi
,
30
);
else
sched_ctrl
->
tpc1
=
3
;
sched_ctrl
->
pucch_snrx10
=
uci_01
->
ul_cqi
*
5
-
640
;
free
(
uci_01
->
harq
->
harq_list
);
free
(
uci_01
->
harq
);
}
// tpc (power control) only if we received AckNack or positive SR. For a
// negative SR, the UE won't have sent anything, and the SNR is not valid
if
(((
uci_01
->
pduBitmap
>>
1
)
&
0x1
)
)
{
if
((
uci_01
->
harq
)
&&
(
uci_01
->
harq
->
harq_confidence_level
==
0
))
sched_ctrl
->
tpc1
=
nr_get_tpc
(
RC
.
nrmac
[
mod_id
]
->
pucch_target_snrx10
,
uci_01
->
ul_cqi
,
30
);
else
sched_ctrl
->
tpc1
=
3
;
sched_ctrl
->
pucch_snrx10
=
uci_01
->
ul_cqi
*
5
-
640
;
// check scheduling request result, confidence_level == 0 is good
if
(
uci_01
->
pduBitmap
&
0x1
)
{
if
(
uci_01
->
sr
->
sr_indication
&&
uci_01
->
sr
->
sr_confidence_level
==
0
&&
uci_01
->
ul_cqi
>=
148
)
{
// SR detected with SNR >= 10dB
sched_ctrl
->
SR
|=
true
;
LOG_D
(
NR_MAC
,
"SR UE %04x ul_cqi %d
\n
"
,
uci_01
->
rnti
,
uci_01
->
ul_cqi
);
}
free
(
uci_01
->
sr
);
}
}
...
...
@@ -950,6 +955,11 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
// 30);
//sched_ctrl->pucch_snrx10 = uci_234->ul_cqi * 5 - 640;
// TODO: handle SR
if
(
uci_234
->
pduBitmap
&
0x1
)
{
free
(
uci_234
->
sr
.
sr_payload
);
}
if
((
uci_234
->
pduBitmap
>>
1
)
&
0x01
)
{
// iterate over received harq bits
for
(
int
harq_bit
=
0
;
harq_bit
<
uci_234
->
harq
.
harq_bit_len
;
harq_bit
++
)
{
...
...
@@ -962,15 +972,18 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
remove_front_nr_list
(
&
sched_ctrl
->
feedback_dl_harq
);
handle_dl_harq
(
UE
,
pid
,
uci_234
->
harq
.
harq_crc
!=
1
&&
acknack
,
RC
.
nrmac
[
mod_id
]
->
dl_bler
.
harq_round_max
);
}
free
(
uci_234
->
harq
.
harq_payload
);
}
if
((
uci_234
->
pduBitmap
>>
2
)
&
0x01
)
{
//API to parse the csi report and store it into sched_ctrl
extract_pucch_csi_report
(
csi_MeasConfig
,
uci_234
,
frame
,
slot
,
UE
,
RC
.
nrmac
[
mod_id
]
->
common_channels
->
ServingCellConfigCommon
);
//TCI handling function
tci_handling
(
UE
,
frame
,
slot
);
free
(
uci_234
->
csi_part1
.
csi_part1_payload
);
}
if
((
uci_234
->
pduBitmap
>>
3
)
&
0x01
)
{
//@TODO:Handle CSI Report 2
// nothing to free (yet)
}
}
...
...
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
View file @
51a7b7bd
...
...
@@ -265,23 +265,8 @@ static void free_unqueued_nfapi_indications(nfapi_nr_rach_indication_t *rach_ind
}
if
(
uci_ind
&&
uci_ind
->
num_ucis
>
0
)
{
for
(
int
i
=
0
;
i
<
uci_ind
->
num_ucis
;
i
++
)
{
switch
(
uci_ind
->
uci_list
[
i
].
pdu_type
)
{
case
NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE
:
if
(
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_0_1
.
harq
)
{
free_and_zero
(
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_0_1
.
harq
->
harq_list
);
}
free_and_zero
(
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_0_1
.
harq
);
free_and_zero
(
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_0_1
.
sr
);
break
;
case
NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE
:
free_and_zero
(
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_2_3_4
.
harq
.
harq_payload
);
free_and_zero
(
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_2_3_4
.
csi_part1
.
csi_part1_payload
);
free_and_zero
(
uci_ind
->
uci_list
[
i
].
pucch_pdu_format_2_3_4
.
csi_part2
.
csi_part2_payload
);
break
;
}
}
/* PUCCH fields (HARQ, SR) are freed in handle_nr_uci_pucch_0_1() and
* handle_nr_uci_pucch_2_3_4() */
free_and_zero
(
uci_ind
->
uci_list
);
free_and_zero
(
uci_ind
);
}
...
...
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