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
promise
OpenXG-RAN
Commits
4cd3d635
Commit
4cd3d635
authored
May 21, 2019
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more pthread protection in nr-gnb.c
parent
aaa3afb7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
executables/nr-gnb.c
executables/nr-gnb.c
+8
-3
executables/nr-ru.c
executables/nr-ru.c
+1
-1
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+6
-3
No files found.
executables/nr-gnb.c
View file @
4cd3d635
...
@@ -293,12 +293,12 @@ static void *gNB_L1_thread_tx(void *param) {
...
@@ -293,12 +293,12 @@ static void *gNB_L1_thread_tx(void *param) {
pthread_mutex_lock
(
&
L1_proc_tx
->
mutex
);
pthread_mutex_lock
(
&
L1_proc_tx
->
mutex
);
L1_proc_tx
->
instance_cnt
=
-
1
;
L1_proc_tx
->
instance_cnt
=
-
1
;
pthread_mutex_unlock
(
&
L1_proc_tx
->
mutex
);
// the thread can now be woken up
// the thread can now be woken up
if
(
pthread_cond_signal
(
&
L1_proc_tx
->
cond
)
!=
0
)
{
if
(
pthread_cond_signal
(
&
L1_proc_tx
->
cond
)
!=
0
)
{
LOG_E
(
PHY
,
"[gNB] ERROR pthread_cond_signal for gNB TXnp4 thread
\n
"
);
LOG_E
(
PHY
,
"[gNB] ERROR pthread_cond_signal for gNB TXnp4 thread
\n
"
);
exit_fun
(
"ERROR pthread_cond_signal"
);
exit_fun
(
"ERROR pthread_cond_signal"
);
}
}
pthread_mutex_unlock
(
&
L1_proc_tx
->
mutex
);
wakeup_txfh
(
gNB
,
L1_proc_tx
,
frame_tx
,
slot_tx
,
timestamp_tx
);
wakeup_txfh
(
gNB
,
L1_proc_tx
,
frame_tx
,
slot_tx
,
timestamp_tx
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1
,
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1
,
0
);
...
@@ -423,18 +423,23 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
...
@@ -423,18 +423,23 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
// note this should depend on the numerology used by the TX L1 thread, set here for 500us slot time
// note this should depend on the numerology used by the TX L1 thread, set here for 500us slot time
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL
,
1
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL
,
1
);
waitret
=
timedwait_on_condition
(
&
proc
->
mutex_RUs_tx
,
&
proc
->
cond_RUs
,
&
proc
->
instance_cnt_RUs
,
"wakeup_txfh"
,
5
00000
);
waitret
=
timedwait_on_condition
(
&
proc
->
mutex_RUs_tx
,
&
proc
->
cond_RUs
,
&
proc
->
instance_cnt_RUs
,
"wakeup_txfh"
,
10
00000
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL
,
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL
,
0
);
AssertFatal
(
release_thread
(
&
proc
->
mutex_RUs_tx
,
&
proc
->
instance_cnt_RUs
,
"wakeup_txfh"
)
==
0
,
"error releaseing gNB lock on RUs
\n
"
);
AssertFatal
(
release_thread
(
&
proc
->
mutex_RUs_tx
,
&
proc
->
instance_cnt_RUs
,
"wakeup_txfh"
)
==
0
,
"error releaseing gNB lock on RUs
\n
"
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE
,
proc
->
instance_cnt_RUs
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE
,
proc
->
instance_cnt_RUs
);
if
(
waitret
==
ETIMEDOUT
)
{
if
(
waitret
==
ETIMEDOUT
)
{
LOG_W
(
PHY
,
"Dropping TX slot (%d.%d) because FH is blocked more than
2 slot times (10
00us)
\n
"
,
frame_tx
,
slot_tx
);
LOG_W
(
PHY
,
"Dropping TX slot (%d.%d) because FH is blocked more than
1 slot times (5
00us)
\n
"
,
frame_tx
,
slot_tx
);
AssertFatal
((
ret
=
pthread_mutex_lock
(
&
gNB
->
proc
.
mutex_RU_tx
))
==
0
,
"mutex_lock returns %d
\n
"
,
ret
);
AssertFatal
((
ret
=
pthread_mutex_lock
(
&
gNB
->
proc
.
mutex_RU_tx
))
==
0
,
"mutex_lock returns %d
\n
"
,
ret
);
gNB
->
proc
.
RU_mask_tx
=
0
;
gNB
->
proc
.
RU_mask_tx
=
0
;
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
gNB
->
proc
.
mutex_RU_tx
))
==
0
,
"mutex_unlock returns %d
\n
"
,
ret
);
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
gNB
->
proc
.
mutex_RU_tx
))
==
0
,
"mutex_unlock returns %d
\n
"
,
ret
);
AssertFatal
((
ret
=
pthread_mutex_lock
(
&
proc
->
mutex_RUs_tx
))
==
0
,
"mutex_lock returns %d
\n
"
,
ret
);
proc
->
instance_cnt_RUs
=
0
;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE
,
proc
->
instance_cnt_RUs
);
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
proc
->
mutex_RUs_tx
))
==
0
,
"mutex_unlock returns %d
\n
"
,
ret
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_UE
,
1
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_UE
,
1
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_UE
,
0
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_UE
,
0
);
...
...
executables/nr-ru.c
View file @
4cd3d635
...
@@ -1298,7 +1298,7 @@ static void *ru_thread_tx( void *param ) {
...
@@ -1298,7 +1298,7 @@ static void *ru_thread_tx( void *param ) {
if
(
L1_proc
->
instance_cnt_RUs
==-
1
)
{
if
(
L1_proc
->
instance_cnt_RUs
==-
1
)
{
AssertFatal
(
pthread_cond_signal
(
&
L1_proc
->
cond_RUs
)
==
0
,
AssertFatal
(
pthread_cond_signal
(
&
L1_proc
->
cond_RUs
)
==
0
,
"ERROR pthread_cond_signal for gNB_L1_thread
\n
"
);
"ERROR pthread_cond_signal for gNB_L1_thread
\n
"
);
}
else
AssertFatal
(
1
==
0
,
"gNB TX thread is not ready
\n
"
);
}
//
else AssertFatal(1==0,"gNB TX thread is not ready\n");
L1_proc
->
instance_cnt_RUs
=
0
;
L1_proc
->
instance_cnt_RUs
=
0
;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE
,
L1_proc
->
instance_cnt_RUs
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE
,
L1_proc
->
instance_cnt_RUs
);
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
L1_proc
->
mutex_RUs_tx
))
==
0
,
"mutex_unlock returns %d
\n
"
,
ret
);
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
L1_proc
->
mutex_RUs_tx
))
==
0
,
"mutex_unlock returns %d
\n
"
,
ret
);
...
...
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
4cd3d635
...
@@ -98,6 +98,7 @@ typedef struct {
...
@@ -98,6 +98,7 @@ typedef struct {
int64_t
rx_count
;
int64_t
rx_count
;
int
wait_for_first_pps
;
int
wait_for_first_pps
;
int
use_gps
;
int
use_gps
;
int
first_tx
;
//! timestamp of RX packet
//! timestamp of RX packet
openair0_timestamp
rx_timestamp
;
openair0_timestamp
rx_timestamp
;
...
@@ -323,10 +324,10 @@ static int trx_usrp_start(openair0_device *device) {
...
@@ -323,10 +324,10 @@ static int trx_usrp_start(openair0_device *device) {
cmd
.
stream_now
=
false
;
// start at constant delay
cmd
.
stream_now
=
false
;
// start at constant delay
s
->
rx_stream
->
issue_stream_cmd
(
cmd
);
s
->
rx_stream
->
issue_stream_cmd
(
cmd
);
s
->
tx_md
.
time_spec
=
cmd
.
time_spec
+
uhd
::
time_spec_t
(
1
-
(
double
)
s
->
tx_forward_nsamps
/
s
->
sample_rate
);
/*
s->tx_md.time_spec = cmd.time_spec + uhd::time_spec_t(1-(double)s->tx_forward_nsamps/s->sample_rate);
s->tx_md.has_time_spec = true;
s->tx_md.has_time_spec = true;
s->tx_md.start_of_burst = true;
s->tx_md.start_of_burst = true;
s
->
tx_md
.
end_of_burst
=
false
;
s->tx_md.end_of_burst = false;
*/
s
->
rx_count
=
0
;
s
->
rx_count
=
0
;
s
->
tx_count
=
0
;
s
->
tx_count
=
0
;
s
->
rx_timestamp
=
0
;
s
->
rx_timestamp
=
0
;
...
@@ -496,10 +497,12 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
...
@@ -496,10 +497,12 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
last_packet_state
=
true
;
last_packet_state
=
true
;
}
}
s
->
tx_md
.
has_time_spec
=
true
;
s
->
tx_md
.
has_time_spec
=
true
;
s
->
tx_md
.
start_of_burst
=
first_packet_state
;
s
->
tx_md
.
start_of_burst
=
(
s
->
tx_count
==
0
)
?
true
:
first_packet_state
;
s
->
tx_md
.
end_of_burst
=
last_packet_state
;
s
->
tx_md
.
end_of_burst
=
last_packet_state
;
s
->
tx_md
.
time_spec
=
uhd
::
time_spec_t
::
from_ticks
(
timestamp
,
s
->
sample_rate
);
s
->
tx_md
.
time_spec
=
uhd
::
time_spec_t
::
from_ticks
(
timestamp
,
s
->
sample_rate
);
s
->
tx_count
++
;
if
(
cc
>
1
)
{
if
(
cc
>
1
)
{
std
::
vector
<
void
*>
buff_ptrs
;
std
::
vector
<
void
*>
buff_ptrs
;
...
...
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