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
spbro
OpenXG-RAN
Commits
1512e39e
Commit
1512e39e
authored
May 17, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrite kill_NR_RU_proc() and reuse functions
parent
9ec3deb5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
28 deletions
+47
-28
executables/nr-ru.c
executables/nr-ru.c
+14
-28
openair1/SCHED_NR/nr_ru_procedures.c
openair1/SCHED_NR/nr_ru_procedures.c
+31
-0
openair1/SCHED_NR/sched_nr.h
openair1/SCHED_NR/sched_nr.h
+2
-0
No files found.
executables/nr-ru.c
View file @
1512e39e
...
@@ -1331,40 +1331,26 @@ void init_RU_proc(RU_t *ru) {
...
@@ -1331,40 +1331,26 @@ void init_RU_proc(RU_t *ru) {
}
}
void
kill_NR_RU_proc
(
int
inst
)
{
void
kill_NR_RU_proc
(
int
inst
)
{
RU_t
*
ru
=
RC
.
ru
[
inst
];
RU_t
*
ru
=
RC
.
ru
[
inst
];
RU_proc_t
*
proc
=
&
ru
->
proc
;
RU_proc_t
*
proc
=
&
ru
->
proc
;
LOG_D
(
PHY
,
"Joining pthread_FH
\n
"
);
/* Note: it seems pthread_FH and and FEP thread below both use
* mutex_fep/cond_fep. Thus, we unlocked above for pthread_FH above and do
* the same for FEP thread below again (using broadcast() to ensure both
* threads get the signal). This one will also destroy the mutex and cond. */
pthread_mutex_lock
(
&
proc
->
mutex_fep
);
proc
->
instance_cnt_fep
=
0
;
pthread_cond_broadcast
(
&
proc
->
cond_fep
);
pthread_mutex_unlock
(
&
proc
->
mutex_fep
);
pthread_join
(
proc
->
pthread_FH
,
NULL
);
pthread_join
(
proc
->
pthread_FH
,
NULL
);
if
(
get_nprocs
()
>=
2
)
{
if
(
ru
->
feprx
)
if
(
ru
->
feprx
)
{
nr_kill_feprx_thread
(
ru
);
pthread_mutex_lock
(
&
proc
->
mutex_fep
);
proc
->
instance_cnt_fep
=
0
;
pthread_mutex_unlock
(
&
proc
->
mutex_fep
);
pthread_cond_signal
(
&
proc
->
cond_fep
);
LOG_D
(
PHY
,
"Joining pthread_fep
\n
"
);
pthread_join
(
proc
->
pthread_fep
,
NULL
);
pthread_mutex_destroy
(
&
proc
->
mutex_fep
);
pthread_cond_destroy
(
&
proc
->
cond_fep
);
}
if
(
ru
->
feptx_ofdm
)
{
if
(
ru
->
feptx_ofdm
)
pthread_mutex_lock
(
&
proc
->
mutex_feptx
);
nr_kill_feptx_thread
(
ru
);
proc
->
instance_cnt_feptx
=
0
;
pthread_mutex_unlock
(
&
proc
->
mutex_feptx
);
pthread_cond_signal
(
&
proc
->
cond_feptx
);
LOG_D
(
PHY
,
"Joining pthread_feptx
\n
"
);
pthread_join
(
proc
->
pthread_feptx
,
NULL
);
pthread_mutex_destroy
(
&
proc
->
mutex_feptx
);
pthread_cond_destroy
(
&
proc
->
cond_feptx
);
}
}
if
(
opp_enabled
)
{
LOG_D
(
PHY
,
"Joining ru_stats_thread
\n
"
);
pthread_join
(
ru
->
ru_stats_thread
,
NULL
);
}
}
}
int
check_capabilities
(
RU_t
*
ru
,
RRU_capabilities_t
*
cap
)
{
int
check_capabilities
(
RU_t
*
ru
,
RRU_capabilities_t
*
cap
)
{
...
...
openair1/SCHED_NR/nr_ru_procedures.c
View file @
1512e39e
...
@@ -453,6 +453,24 @@ void nr_init_feptx_thread(RU_t *ru) {
...
@@ -453,6 +453,24 @@ void nr_init_feptx_thread(RU_t *ru) {
}
}
void
nr_kill_feptx_thread
(
RU_t
*
ru
)
{
RU_proc_t
*
proc
=
&
ru
->
proc
;
for
(
int
i
=
0
;
i
<
ru
->
nb_tx
*
2
;
i
++
)
{
RU_feptx_t
*
feptx
=
&
proc
->
feptx
[
i
];
if
(
feptx
->
pthread_feptx
==
0
)
continue
;
pthread_mutex_lock
(
&
feptx
->
mutex_feptx
);
feptx
->
instance_cnt_feptx
=
0
;
pthread_mutex_unlock
(
&
feptx
->
mutex_feptx
);
pthread_cond_signal
(
&
feptx
->
cond_feptx
);
LOG_I
(
PHY
,
"Joining pthread_feptx %d
\n
"
,
i
);
pthread_join
(
feptx
->
pthread_feptx
,
NULL
);
pthread_mutex_destroy
(
&
feptx
->
mutex_feptx
);
pthread_cond_destroy
(
&
feptx
->
cond_feptx
);
}
}
void
nr_feptx_prec
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
)
{
void
nr_feptx_prec
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
)
{
...
@@ -590,6 +608,19 @@ void nr_init_feprx_thread(RU_t *ru) {
...
@@ -590,6 +608,19 @@ void nr_init_feprx_thread(RU_t *ru) {
threadCreate
(
&
proc
->
pthread_fep
,
nr_feprx_thread
,
(
void
*
)
ru
,
"feprx"
,
-
1
,
OAI_PRIORITY_RT
);
threadCreate
(
&
proc
->
pthread_fep
,
nr_feprx_thread
,
(
void
*
)
ru
,
"feprx"
,
-
1
,
OAI_PRIORITY_RT
);
}
}
void
nr_kill_feprx_thread
(
RU_t
*
ru
)
{
RU_proc_t
*
proc
=
&
ru
->
proc
;
if
(
proc
->
pthread_fep
==
0
)
return
;
LOG_I
(
PHY
,
"Joining pthread_feprx
\n
"
);
pthread_mutex_lock
(
&
proc
->
mutex_fep
);
proc
->
instance_cnt_fep
=
0
;
pthread_mutex_unlock
(
&
proc
->
mutex_fep
);
pthread_cond_signal
(
&
proc
->
cond_fep
);
pthread_join
(
proc
->
pthread_fep
,
NULL
);
pthread_mutex_destroy
(
&
proc
->
mutex_fep
);
pthread_cond_destroy
(
&
proc
->
cond_fep
);
}
void
nr_fep_full_2thread
(
RU_t
*
ru
,
int
slot
)
{
void
nr_fep_full_2thread
(
RU_t
*
ru
,
int
slot
)
{
...
...
openair1/SCHED_NR/sched_nr.h
View file @
1512e39e
...
@@ -45,11 +45,13 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx);
...
@@ -45,11 +45,13 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx);
void
nr_feptx_ofdm_2thread
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
);
void
nr_feptx_ofdm_2thread
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
);
void
nr_feptx0
(
RU_t
*
ru
,
int
tti_tx
,
int
first_symbol
,
int
num_symbols
,
int
aa
);
void
nr_feptx0
(
RU_t
*
ru
,
int
tti_tx
,
int
first_symbol
,
int
num_symbols
,
int
aa
);
void
nr_init_feptx_thread
(
RU_t
*
ru
);
void
nr_init_feptx_thread
(
RU_t
*
ru
);
void
nr_kill_feptx_thread
(
RU_t
*
ru
);
void
fep_full
(
RU_t
*
ru
,
int
slot
);
void
fep_full
(
RU_t
*
ru
,
int
slot
);
void
nr_feptx_prec
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
);
void
nr_feptx_prec
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
);
void
nr_init_feptx_prec_thread
(
RU_t
*
ru
);
void
nr_init_feptx_prec_thread
(
RU_t
*
ru
);
void
nr_feptx_prec_control
(
RU_t
*
ru
,
int
frame
,
int
tti_tx
);
void
nr_feptx_prec_control
(
RU_t
*
ru
,
int
frame
,
int
tti_tx
);
void
nr_init_feprx_thread
(
RU_t
*
ru
);
void
nr_init_feprx_thread
(
RU_t
*
ru
);
void
nr_kill_feprx_thread
(
RU_t
*
ru
);
void
nr_fep_full
(
RU_t
*
ru
,
int
slot
);
void
nr_fep_full
(
RU_t
*
ru
,
int
slot
);
void
nr_fep_full_2thread
(
RU_t
*
ru
,
int
slot
);
void
nr_fep_full_2thread
(
RU_t
*
ru
,
int
slot
);
void
feptx_prec
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
);
void
feptx_prec
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
);
...
...
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