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
alex037yang
OpenXG-RAN
Commits
23575ae4
Commit
23575ae4
authored
Jan 30, 2019
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logging removal
parent
a13f70be
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
33 deletions
+47
-33
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
+1
-1
targets/RT/USER/lte-enb.c
targets/RT/USER/lte-enb.c
+33
-21
targets/RT/USER/lte-ru.c
targets/RT/USER/lte-ru.c
+13
-11
No files found.
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
View file @
23575ae4
...
...
@@ -245,7 +245,7 @@ int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestam
}
eth
->
tx_nsamps
=
nblocks
;
printf
(
"Sending %d bytes to %s:%d
\n
"
,
packet_size
,
str
,
ntohs
(
eth
->
local_addrd
.
sin_port
));
//
printf("Sending %d bytes to %s:%d\n",packet_size,str,ntohs(eth->local_addrd.sin_port));
bytes_sent
=
sendto
(
eth
->
sockfdd
,
buff
[
0
],
...
...
targets/RT/USER/lte-enb.c
View file @
23575ae4
...
...
@@ -351,9 +351,11 @@ static void* L1_thread_tx(void* param) {
//wait_sync("tx_thread");
while
(
!
oai_exit
)
{
LOG_D
(
PHY
,
"L1_thread_tx: Waiting for signal (IC %d)
\n
"
,
proc
->
instance_cnt
);
if
(
wait_on_condition
(
&
proc
->
mutex
,
&
proc
->
cond
,
&
proc
->
instance_cnt
,
thread_name
)
<
0
)
break
;
if
(
oai_exit
)
break
;
LOG_D
(
PHY
,
"L1_thread_tx: Running for %d.%d
\n
"
,
proc
->
frame_tx
,
proc
->
subframe_tx
);
// *****************************************
// TX processing for subframe n+4
// run PHY TX procedures the one after the other for all CCs to avoid race conditions
...
...
@@ -370,6 +372,7 @@ static void* L1_thread_tx(void* param) {
proc
->
instance_cnt
=
-
1
;
// the thread can now be woken up
LOG_D
(
PHY
,
"L1_thread_tx: signaling completion in %d.%d
\n
"
,
proc
->
frame_tx
,
proc
->
subframe_tx
);
if
(
pthread_cond_signal
(
&
proc
->
cond
)
!=
0
)
{
LOG_E
(
PHY
,
"[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread
\n
"
);
exit_fun
(
"ERROR pthread_cond_signal"
);
...
...
@@ -420,6 +423,7 @@ static void* L1_thread( void* param ) {
if
(
wait_on_condition
(
&
proc
->
mutex
,
&
proc
->
cond
,
&
proc
->
instance_cnt
,
thread_name
)
<
0
)
break
;
LOG_D
(
PHY
,
"L1_thread wakeup %d.%d
\n
"
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX
,
sched_getcpu
());
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0
+
(
proc
->
subframe_rx
&
1
),
1
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_ENB
,
proc
->
subframe_tx
);
...
...
@@ -435,6 +439,7 @@ static void* L1_thread( void* param ) {
if
(
rxtx
(
eNB
,
proc
,
thread_name
)
<
0
)
break
;
}
LOG_D
(
PHY
,
"L1_thread: RX done
\n
"
);
if
(
get_thread_parallel_conf
()
==
PARALLEL_RU_L1_SPLIT
)
phy_procedures_eNB_TX
(
eNB
,
proc
,
1
);
if
(
release_thread
(
&
proc
->
mutex
,
&
proc
->
instance_cnt
,
thread_name
)
<
0
)
break
;
if
(
nfapi_mode
!=
2
){
...
...
@@ -477,48 +482,54 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
int
wakeup_txfh
(
L1_rxtx_proc_t
*
proc
,
PHY_VARS_eNB
*
eNB
)
{
RU_t
*
ru
;
RU_proc_t
*
ru_proc
;
LTE_DL_FRAME_PARMS
*
fp
=
&
ru
->
frame_parms
;
LTE_DL_FRAME_PARMS
*
fp
;
struct
timespec
wait
;
wait
.
tv_sec
=
0
;
wait
.
tv_nsec
=
5000000L
;
printf
(
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~inside wakeup_txfh %d.%d IC_RU = %d
\n
"
,
proc
->
frame_tx
,
proc
->
subframe_tx
,
proc
->
instance_cnt_RUs
);
LOG_D
(
PHY
,
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~inside wakeup_txfh %d.%d IC_RU = %d
\n
"
,
proc
->
frame_tx
,
proc
->
subframe_tx
,
proc
->
instance_cnt_RUs
);
if
(
wait_on_condition
(
&
proc
->
mutex_RUs
,
&
proc
->
cond_RUs
,
&
proc
->
instance_cnt_RUs
,
"wakeup_txfh"
)
<
0
)
{
LOG_E
(
PHY
,
"Frame %d, subframe %d: TX FH not ready
\n
"
,
proc
->
frame_tx
,
proc
->
subframe_tx
);
return
(
-
1
);
}
/*
pthread_mutex_lock(&eNB->proc.mutex_RU_tx);
eNB->proc.RU_mask_tx = 0;
pthread_mutex_unlock(&eNB->proc.mutex_RU_tx);
*/
if
(
release_thread
(
&
proc
->
mutex_RUs
,
&
proc
->
instance_cnt_RUs
,
"wakeup_txfh"
)
<
0
)
return
(
-
1
);
for
(
int
ru_id
=
0
;
ru_id
<
eNB
->
num_RU
;
ru_id
++
){
ru_proc
=
&
eNB
->
RU_list
[
ru_id
]
->
proc
;
fp
=
&
eNB
->
RU_list
[
ru_id
]
->
frame_parms
;
if
((
fp
->
frame_type
==
TDD
)
&&
(
subframe_select
(
fp
,
proc
->
subframe_tx
)
==
SF_UL
))
continue
;
// skip the RUs that are not synced
if
(
eNB
->
RU_list
[
ru_id
]
->
state
==
RU_SYNC
)
{
LOG_D
(
PHY
,
"wakeup_txfh: eNB %d : Skipping ru %d
\n
"
,
eNB
->
Mod_id
,
ru_id
);
continue
;
}
if
(
ru_proc
==
NULL
)
{
return
(
0
);}
if
(((
fp
->
frame_type
==
TDD
)
&&
(
subframe_select
(
fp
,
proc
->
subframe_tx
)
==
SF_UL
))
||
(
eNB
->
RU_list
[
ru_id
]
->
state
==
RU_SYNC
)
||
(
eNB
->
RU_list
[
ru_id
]
->
wait_cnt
>
0
)){
pthread_mutex_lock
(
&
proc
->
mutex_RUs
);
proc
->
instance_cnt_RUs
=
0
;
pthread_mutex_unlock
(
&
proc
->
mutex_RUs
);
continue
;
//hacking only works when all RU_tx works on the same subframe #TODO: adding mask stuff
}
if
(
ru_proc
->
instance_cnt_eNBs
==
0
)
{
LOG_E
(
PHY
,
"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d
\n
"
,
ru_proc
->
frame_tx
,
ru_proc
->
subframe_tx
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
return
(
-
1
);
}
if
(
pthread_mutex_
timedlock
(
&
ru_proc
->
mutex_eNBs
,
&
wait
)
!=
0
)
{
if
(
pthread_mutex_
lock
(
&
ru_proc
->
mutex_eNBs
)
!=
0
)
{
LOG_E
(
PHY
,
"[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)
\n
"
,
ru_proc
->
subframe_rx
&
1
,
ru_proc
->
instance_cnt_eNBs
);
exit_fun
(
"error locking mutex_eNB"
);
return
(
-
1
);
}
ru_proc
->
instance_cnt_eNBs
=
0
;
//VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_IC_ENB+ru_id,ru_proc->instance_cnt_eNBs);
ru_proc
->
timestamp_tx
=
proc
->
timestamp_tx
;
ru_proc
->
subframe_tx
=
proc
->
subframe_tx
;
ru_proc
->
frame_tx
=
proc
->
frame_tx
;
// printf("wakeup_txfh: RU %d, frame_tx %d, subframe_tx %d\n",ru_id,ru_proc->frame_tx,ru_proc->subframe_tx);
// the thread can now be woken up
if
(
pthread_cond_signal
(
&
ru_proc
->
cond_eNBs
)
!=
0
)
{
LOG_E
(
PHY
,
"[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread
\n
"
);
...
...
@@ -541,7 +552,7 @@ int wakeup_tx(PHY_VARS_eNB *eNB) {
struct
timespec
wait
;
wait
.
tv_sec
=
0
;
wait
.
tv_nsec
=
5000000L
;
LOG_
I
(
PHY
,
"ENTERED wakeup_tx
\n
"
);
LOG_
D
(
PHY
,
"ENTERED wakeup_tx (IC %d)
\n
"
,
L1_proc_tx
->
instance_cnt
);
if
(
pthread_mutex_timedlock
(
&
L1_proc_tx
->
mutex
,
&
wait
)
!=
0
)
{
LOG_E
(
PHY
,
"[SCHED][eNB] ERROR locking mutex for eNB L1_thread_tx
\n
"
);
...
...
@@ -562,6 +573,7 @@ int wakeup_tx(PHY_VARS_eNB *eNB) {
L1_proc_tx
->
timestamp_tx
=
L1_proc
->
timestamp_tx
;
// the thread can now be woken up
LOG_D
(
PHY
,
"Waking up TX thread in %d.%d
\n
"
,
L1_proc
->
frame_tx
,
L1_proc
->
subframe_tx
);
if
(
pthread_cond_signal
(
&
L1_proc_tx
->
cond
)
!=
0
)
{
LOG_E
(
PHY
,
"[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread
\n
"
);
exit_fun
(
"ERROR pthread_cond_signal"
);
...
...
@@ -580,7 +592,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
L1_rxtx_proc_t
*
L1_proc
=&
proc
->
L1_proc
;
LTE_DL_FRAME_PARMS
*
fp
=
&
eNB
->
frame_parms
;
LOG_
I
(
PHY
,
"ENTERED wakeup_rxtx
\n
"
);
LOG_
D
(
PHY
,
"ENTERED wakeup_rxtx
\n
"
);
int
i
;
struct
timespec
wait
;
...
...
targets/RT/USER/lte-ru.c
View file @
23575ae4
...
...
@@ -164,11 +164,11 @@ static inline void fh_if5_south_out(RU_t *ru) {
// southbound IF4p5 fronthaul
static
inline
void
fh_if4p5_south_out
(
RU_t
*
ru
)
{
if
(
ru
==
RC
.
ru
[
0
])
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST
,
ru
->
proc
.
timestamp_tx
&
0xffffffff
);
LOG_
I
(
PHY
,
"ENTERED fh_if4p5_south_out Sending IF4p5 for frame %d subframe %d ru %d
\n
"
,
ru
->
proc
.
frame_tx
,
ru
->
proc
.
subframe_tx
,
ru
->
idx
);
LOG_
D
(
PHY
,
"ENTERED fh_if4p5_south_out Sending IF4p5 for frame %d subframe %d ru %d
\n
"
,
ru
->
proc
.
frame_tx
,
ru
->
proc
.
subframe_tx
,
ru
->
idx
);
if
(
subframe_select
(
&
ru
->
frame_parms
,
ru
->
proc
.
subframe_tx
)
!=
SF_UL
)
{
send_IF4p5
(
ru
,
ru
->
proc
.
frame_tx
,
ru
->
proc
.
subframe_tx
,
IF4p5_PDLFFT
);
ru
->
south_out_cnt
++
;
LOG_
I
(
PHY
,
"south_out_cnt %d
\n
"
,
ru
->
south_out_cnt
);
LOG_
D
(
PHY
,
"south_out_cnt %d
\n
"
,
ru
->
south_out_cnt
);
}
/*if (ru == RC.ru[0] || ru == RC.ru[1]) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU+ru->idx, ru->proc.frame_tx );
...
...
@@ -220,7 +220,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
RU_proc_t
*
proc
=
&
ru
->
proc
;
int
f
,
sf
;
LOG_I
(
PHY
,
"ENTERED fh_if4p5_south_in
\n
"
);
//
LOG_I(PHY,"ENTERED fh_if4p5_south_in\n");
uint16_t
packet_type
;
uint32_t
symbol_number
=
0
;
uint32_t
symbol_mask_full
;
...
...
@@ -229,7 +229,7 @@ LOG_I(PHY,"ENTERED fh_if4p5_south_in\n");
symbol_mask_full
=
(
1
<<
fp
->
ul_symbols_in_S_subframe
)
-
1
;
else
symbol_mask_full
=
(
1
<<
fp
->
symbols_per_tti
)
-
1
;
LOG_
I
(
PHY
,
"fh_if4p5_south_in: RU %d, frame %d, subframe %d, ru %d
\n
"
,
ru
->
idx
,
*
frame
,
*
subframe
,
ru
->
idx
);
LOG_
D
(
PHY
,
"fh_if4p5_south_in: RU %d, frame %d, subframe %d, ru %d
\n
"
,
ru
->
idx
,
*
frame
,
*
subframe
,
ru
->
idx
);
AssertFatal
(
proc
->
symbol_mask
[
*
subframe
]
==
0
,
"rx_fh_if4p5: proc->symbol_mask[%d] = %x
\n
"
,
*
subframe
,
proc
->
symbol_mask
[
*
subframe
]);
do
{
recv_IF4p5
(
ru
,
&
f
,
&
sf
,
&
packet_type
,
&
symbol_number
);
...
...
@@ -611,7 +611,7 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ
,
0
);
ru
->
south_in_cnt
++
;
LOG_
I
(
PHY
,
"south_in_cnt %d
\n
"
,
ru
->
south_in_cnt
);
LOG_
D
(
PHY
,
"south_in_cnt %d
\n
"
,
ru
->
south_in_cnt
);
if
(
ru
->
cmd
==
RU_FRAME_RESYNCH
)
{
LOG_I
(
PHY
,
"Applying frame resynch %d => %d
\n
"
,
*
frame
,
ru
->
cmdval
);
...
...
@@ -812,7 +812,7 @@ void tx_rf(RU_t *ru) {
ru
->
nb_tx
,
flags
);
ru
->
south_out_cnt
++
;
LOG_
I
(
PHY
,
"south_out_cnt %d
\n
"
,
ru
->
south_out_cnt
);
LOG_
D
(
PHY
,
"south_out_cnt %d
\n
"
,
ru
->
south_out_cnt
);
int
se
=
dB_fixed
(
signal_energy
(
txp
[
0
],
siglen
+
sf_extension
));
if
(
SF_type
==
SF_S
)
LOG_D
(
PHY
,
"[TXPATH] RU %d tx_rf (en %d,len %d), writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d
\n
"
,
ru
->
idx
,
se
,
siglen
+
sf_extension
,
...
...
@@ -1154,9 +1154,8 @@ void wakeup_L1s(RU_t *ru) {
L1_proc_t
*
proc
=
&
eNB
->
proc
;
RU_proc_t
*
ruproc
=
&
ru
->
proc
;
struct
timespec
t
;
LOG_D
(
PHY
,
"wakeup_eNBs (num %d) for RU %d (state %s)ru->eNB_top:%p
\n
"
,
ru
->
num_eNB
,
ru
->
idx
,
ru_states
[
ru
->
state
],
ru
->
eNB_top
);
LOG_
I
(
PHY
,
"wakeup_L1s (num %d) for RU %d ru->eNB_top:%p
\n
"
,
ru
->
num_eNB
,
ru
->
idx
,
ru
->
eNB_top
);
LOG_
D
(
PHY
,
"wakeup_L1s (num %d) for RU %d ru->eNB_top:%p
\n
"
,
ru
->
num_eNB
,
ru
->
idx
,
ru
->
eNB_top
);
// call eNB function directly
...
...
@@ -1226,12 +1225,13 @@ void wakeup_L1s(RU_t *ru) {
}
}
}
/*
AssertFatal(0==pthread_mutex_lock(&ruproc->mutex_eNBs),"");
LOG_D(PHY,"RU %d sending signal to unlock waiting ru_threads\n", ru->idx);
AssertFatal(0==pthread_cond_broadcast(&ruproc->cond_eNBs),"");
if (ruproc->instance_cnt_eNBs==-1) ruproc->instance_cnt_eNBs++;
AssertFatal(0==pthread_mutex_unlock(&ruproc->mutex_eNBs),"");
*/
}
else
...
...
@@ -1522,7 +1522,7 @@ static void* ru_thread_tx( void* param ) {
LOG_D
(
PHY
,
"ru_thread_tx: Waiting for TX processing
\n
"
);
// wait until eNBs are finished subframe RX n and TX n+4
wait_on_condition
(
&
proc
->
mutex_eNBs
,
&
proc
->
cond_eNBs
,
&
proc
->
instance_cnt_eNBs
,
"ru_thread_tx"
);
LOG_
I
(
PHY
,
"ru_thread_tx (ru %d): Woken from condition
\n
"
,
ru
->
idx
);
LOG_
D
(
PHY
,
"ru_thread_tx (ru %d): Woken from condition
\n
"
,
ru
->
idx
);
if
(
oai_exit
)
break
;
// do TX front-end processing if needed (precoding and/or IDFTs)
...
...
@@ -1537,7 +1537,7 @@ static void* ru_thread_tx( void* param ) {
if
(
ru
->
fh_north_out
)
ru
->
fh_north_out
(
ru
);
}
release_thread
(
&
proc
->
mutex_eNBs
,
&
proc
->
instance_cnt_eNBs
,
"ru_thread_tx"
);
LOG_D
(
PHY
,
"Releasing RU %d after processing, checking masks
\n
"
,
ru
->
idx
);
for
(
int
i
=
0
;
i
<
ru
->
num_eNB
;
i
++
)
{
eNB
=
ru
->
eNB_list
[
i
];
...
...
@@ -1553,6 +1553,7 @@ static void* ru_thread_tx( void* param ) {
eNB_proc
->
RU_mask_tx
|=
(
1
<<
j
);
}
}
LOG_D
(
PHY
,
"ru_thread_tx: RU_mask_tx is now %d
\n
"
,
eNB_proc
->
RU_mask_tx
);
if
(
eNB_proc
->
RU_mask_tx
!=
(
1
<<
eNB
->
num_RU
)
-
1
)
{
// not all RUs have provided their information so return
pthread_mutex_unlock
(
&
eNB_proc
->
mutex_RU_tx
);
}
...
...
@@ -1563,6 +1564,7 @@ static void* ru_thread_tx( void* param ) {
pthread_mutex_lock
(
&
L1_proc
->
mutex_RUs
);
L1_proc
->
instance_cnt_RUs
=
0
;
// the thread can now be woken up
LOG_D
(
PHY
,
"ru_thread_tx: clearing mask and Waking up L1 thread
\n
"
);
if
(
pthread_cond_signal
(
&
L1_proc
->
cond_RUs
)
!=
0
)
{
LOG_E
(
PHY
,
"[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread
\n
"
);
exit_fun
(
"ERROR pthread_cond_signal"
);
...
...
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