Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bin He
openairinterface5G
Commits
c321f9b5
Commit
c321f9b5
authored
5 years ago
by
Robert Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Make UE mem alloc for UL_INFO only once in PHY stub mode
parent
5f851d45
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
targets/RT/USER/lte-ue.c
+29
-38
29 additions, 38 deletions
targets/RT/USER/lte-ue.c
with
29 additions
and
38 deletions
targets/RT/USER/lte-ue.c
+
29
−
38
View file @
c321f9b5
...
@@ -992,6 +992,19 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
...
@@ -992,6 +992,19 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
phy_stub_ticking
->
num_single_thread
[
ue_thread_id
]
=
-
1
;
phy_stub_ticking
->
num_single_thread
[
ue_thread_id
]
=
-
1
;
UE
=
rtd
->
UE
;
UE
=
rtd
->
UE
;
UL_INFO
=
(
UL_IND_t
*
)
malloc
(
sizeof
(
UL_IND_t
));
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
=
calloc
(
NB_UE_INST
,
sizeof
(
nfapi_rx_indication_pdu_t
));
UL_INFO
->
rx_ind
.
rx_indication_body
.
number_of_pdus
=
0
;
UL_INFO
->
crc_ind
.
crc_indication_body
.
crc_pdu_list
=
calloc
(
NB_UE_INST
,
sizeof
(
nfapi_crc_indication_pdu_t
));
UL_INFO
->
crc_ind
.
crc_indication_body
.
number_of_crcs
=
0
;
UL_INFO
->
harq_ind
.
harq_indication_body
.
harq_pdu_list
=
calloc
(
NB_UE_INST
,
sizeof
(
nfapi_harq_indication_pdu_t
));
UL_INFO
->
harq_ind
.
harq_indication_body
.
number_of_harqs
=
0
;
UL_INFO
->
sr_ind
.
sr_indication_body
.
sr_pdu_list
=
calloc
(
NB_UE_INST
,
sizeof
(
nfapi_sr_indication_pdu_t
));
UL_INFO
->
sr_ind
.
sr_indication_body
.
number_of_srs
=
0
;
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_pdu_list
=
calloc
(
NB_UE_INST
,
sizeof
(
nfapi_cqi_indication_pdu_t
));
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_raw_pdu_list
=
calloc
(
NB_UE_INST
,
sizeof
(
nfapi_cqi_indication_raw_pdu_t
));
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
number_of_cqis
=
0
;
if
(
ue_thread_id
==
0
)
{
if
(
ue_thread_id
==
0
)
{
phy_stub_ticking
->
ticking_var
=
-
1
;
phy_stub_ticking
->
ticking_var
=
-
1
;
proc
->
subframe_rx
=
proc
->
sub_frame_start
;
proc
->
subframe_rx
=
proc
->
sub_frame_start
;
...
@@ -1064,20 +1077,6 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
...
@@ -1064,20 +1077,6 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
initRefTimes(t3);
initRefTimes(t3);
pickTime(current);
pickTime(current);
updateTimes(proc->gotIQs, &t2, 10000, "Delay to wake up UE_Thread_Rx (case 2)");*/
updateTimes(proc->gotIQs, &t2, 10000, "Delay to wake up UE_Thread_Rx (case 2)");*/
// Not sure whether we should put the memory allocation here and not sure how much memory
//we should allocate for each subframe cycle.
UL_INFO
=
(
UL_IND_t
*
)
malloc
(
sizeof
(
UL_IND_t
));
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
=
(
nfapi_rx_indication_pdu_t
*
)
malloc
(
NB_UE_INST
*
sizeof
(
nfapi_rx_indication_pdu_t
));
UL_INFO
->
rx_ind
.
rx_indication_body
.
number_of_pdus
=
0
;
UL_INFO
->
crc_ind
.
crc_indication_body
.
crc_pdu_list
=
(
nfapi_crc_indication_pdu_t
*
)
malloc
(
NB_UE_INST
*
sizeof
(
nfapi_crc_indication_pdu_t
));
UL_INFO
->
crc_ind
.
crc_indication_body
.
number_of_crcs
=
0
;
UL_INFO
->
harq_ind
.
harq_indication_body
.
harq_pdu_list
=
(
nfapi_harq_indication_pdu_t
*
)
malloc
(
NB_UE_INST
*
sizeof
(
nfapi_harq_indication_pdu_t
));
UL_INFO
->
harq_ind
.
harq_indication_body
.
number_of_harqs
=
0
;
UL_INFO
->
sr_ind
.
sr_indication_body
.
sr_pdu_list
=
(
nfapi_sr_indication_pdu_t
*
)
malloc
(
NB_UE_INST
*
sizeof
(
nfapi_sr_indication_pdu_t
));
UL_INFO
->
sr_ind
.
sr_indication_body
.
number_of_srs
=
0
;
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_pdu_list
=
(
nfapi_cqi_indication_pdu_t
*
)
malloc
(
NB_UE_INST
*
sizeof
(
nfapi_cqi_indication_pdu_t
));
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_raw_pdu_list
=
(
nfapi_cqi_indication_raw_pdu_t
*
)
malloc
(
NB_UE_INST
*
sizeof
(
nfapi_cqi_indication_raw_pdu_t
));
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
number_of_cqis
=
0
;
if
(
pthread_mutex_lock
(
&
phy_stub_ticking
->
mutex_single_thread
)
!=
0
)
{
if
(
pthread_mutex_lock
(
&
phy_stub_ticking
->
mutex_single_thread
)
!=
0
)
{
LOG_E
(
MAC
,
"[SCHED][UE] error locking mutex for ue_thread_id %d (mutex_single_thread)
\n
"
,
ue_thread_id
);
LOG_E
(
MAC
,
"[SCHED][UE] error locking mutex for ue_thread_id %d (mutex_single_thread)
\n
"
,
ue_thread_id
);
...
@@ -1267,30 +1266,6 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
...
@@ -1267,30 +1266,6 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
UL_INFO
->
sr_ind
.
sr_indication_body
.
number_of_srs
=
0
;
UL_INFO
->
sr_ind
.
sr_indication_body
.
number_of_srs
=
0
;
}
}
// Free UL_INFO messages
//if(UL_INFO->crc_ind.crc_indication_body.crc_pdu_list != NULL){
free
(
UL_INFO
->
crc_ind
.
crc_indication_body
.
crc_pdu_list
);
UL_INFO
->
crc_ind
.
crc_indication_body
.
crc_pdu_list
=
NULL
;
//}
//if(UL_INFO->rx_ind.rx_indication_body.rx_pdu_list != NULL){
free
(
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
);
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
=
NULL
;
//}
//if(UL_INFO->harq_ind.harq_indication_body.harq_pdu_list !=NULL){
free
(
UL_INFO
->
harq_ind
.
harq_indication_body
.
harq_pdu_list
);
UL_INFO
->
harq_ind
.
harq_indication_body
.
harq_pdu_list
=
NULL
;
//}
//if(UL_INFO->sr_ind.sr_indication_body.sr_pdu_list!=NULL){
free
(
UL_INFO
->
sr_ind
.
sr_indication_body
.
sr_pdu_list
);
UL_INFO
->
sr_ind
.
sr_indication_body
.
sr_pdu_list
=
NULL
;
//}
free
(
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_pdu_list
);
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_pdu_list
=
NULL
;
free
(
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_raw_pdu_list
);
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_raw_pdu_list
=
NULL
;
free
(
UL_INFO
);
UL_INFO
=
NULL
;
// De-allocate memory of nfapi requests copies before next subframe round
// De-allocate memory of nfapi requests copies before next subframe round
if
(
dl_config_req
!=
NULL
)
{
if
(
dl_config_req
!=
NULL
)
{
if
(
dl_config_req
->
vendor_extension
!=
NULL
)
{
if
(
dl_config_req
->
vendor_extension
!=
NULL
)
{
...
@@ -1334,6 +1309,22 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
...
@@ -1334,6 +1309,22 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg)
}
}
}
}
// Free UL_INFO messages
free
(
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_raw_pdu_list
);
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_raw_pdu_list
=
NULL
;
free
(
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_pdu_list
);
UL_INFO
->
cqi_ind
.
cqi_indication_body
.
cqi_pdu_list
=
NULL
;
free
(
UL_INFO
->
sr_ind
.
sr_indication_body
.
sr_pdu_list
);
UL_INFO
->
sr_ind
.
sr_indication_body
.
sr_pdu_list
=
NULL
;
free
(
UL_INFO
->
harq_ind
.
harq_indication_body
.
harq_pdu_list
);
UL_INFO
->
harq_ind
.
harq_indication_body
.
harq_pdu_list
=
NULL
;
free
(
UL_INFO
->
crc_ind
.
crc_indication_body
.
crc_pdu_list
);
UL_INFO
->
crc_ind
.
crc_indication_body
.
crc_pdu_list
=
NULL
;
free
(
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
);
UL_INFO
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
=
NULL
;
free
(
UL_INFO
);
UL_INFO
=
NULL
;
// thread finished
// thread finished
free
(
arg
);
free
(
arg
);
return
&
UE_thread_rxtx_retval
;
return
&
UE_thread_rxtx_retval
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment