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
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
Mingxuan Li
openairinterface5G
Commits
6ff951be
Commit
6ff951be
authored
4 years ago
by
Sakthivel Velumani
Browse files
Options
Downloads
Patches
Plain Diff
wait before abandoning next trx processing
parent
db501192
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
executables/nr-gnb.c
+30
-14
30 additions, 14 deletions
executables/nr-gnb.c
with
30 additions
and
14 deletions
executables/nr-gnb.c
+
30
−
14
View file @
6ff951be
...
...
@@ -545,6 +545,8 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
int
i
;
struct
timespec
abstime
;
int
time_ns
=
50000
;
int
wait_timer
=
0
;
bool
do_last_check
=
1
;
AssertFatal
((
ret
=
pthread_mutex_lock
(
&
proc
->
mutex_RU
))
==
0
,
"mutex_lock returns %d
\n
"
,
ret
);
for
(
i
=
0
;
i
<
gNB
->
num_RU
;
i
++
)
{
...
...
@@ -565,22 +567,36 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
proc
->
mutex_RU
))
==
0
,
"muex_unlock returns %d
\n
"
,
ret
);
}
clock_gettime
(
CLOCK_REALTIME
,
&
abstime
);
abstime
.
tv_nsec
=
abstime
.
tv_nsec
+
time_ns
;
if
(
abstime
.
tv_nsec
>=
1000
*
1000
*
1000
)
{
abstime
.
tv_nsec
-=
1000
*
1000
*
1000
;
abstime
.
tv_sec
+=
1
;
}
// wake up TX for subframe n+sf_ahead
// lock the TX mutex and make sure the thread is ready
AssertFatal
((
ret
=
pthread_mutex_timedlock
(
&
L1_proc
->
mutex
,
&
abstime
))
==
0
,
"mutex_lock returns %d
\n
"
,
ret
);
while
(
wait_timer
<
200
)
{
clock_gettime
(
CLOCK_REALTIME
,
&
abstime
);
abstime
.
tv_nsec
=
abstime
.
tv_nsec
+
time_ns
;
if
(
L1_proc
->
instance_cnt
==
0
)
{
// L1_thread is busy so abort the subframe
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
L1_proc
->
mutex
))
==
0
,
"muex_unlock return %d
\n
"
,
ret
);
LOG_W
(
PHY
,
"L1_thread isn't ready in %d.%d, aborting RX processing
\n
"
,
ru_proc
->
frame_rx
,
ru_proc
->
tti_rx
);
return
(
-
1
);
if
(
abstime
.
tv_nsec
>=
1000
*
1000
*
1000
)
{
abstime
.
tv_nsec
-=
1000
*
1000
*
1000
;
abstime
.
tv_sec
+=
1
;
}
AssertFatal
((
ret
=
pthread_mutex_timedlock
(
&
L1_proc
->
mutex
,
&
abstime
))
==
0
,
"mutex_lock returns %d
\n
"
,
ret
);
if
(
L1_proc
->
instance_cnt
==
0
)
{
// L1_thread is busy so wait for a bit
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
L1_proc
->
mutex
))
==
0
,
"muex_unlock return %d
\n
"
,
ret
);
wait_timer
+=
50
;
usleep
(
50
);
}
else
{
do_last_check
=
0
;
break
;
}
}
if
(
do_last_check
)
{
AssertFatal
((
ret
=
pthread_mutex_timedlock
(
&
L1_proc
->
mutex
,
&
abstime
))
==
0
,
"mutex_lock returns %d
\n
"
,
ret
);
if
(
L1_proc
->
instance_cnt
==
0
)
{
// L1_thread is busy so abort the subframe
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
L1_proc
->
mutex
))
==
0
,
"muex_unlock return %d
\n
"
,
ret
);
LOG_W
(
PHY
,
"L1_thread isn't ready in %d.%d, aborting RX processing
\n
"
,
ru_proc
->
frame_rx
,
ru_proc
->
tti_rx
);
return
(
-
1
);
}
}
++
L1_proc
->
instance_cnt
;
...
...
@@ -796,7 +812,7 @@ void init_gNB_proc(int inst) {
gNB
->
threadPool
=
(
tpool_t
*
)
malloc
(
sizeof
(
tpool_t
));
gNB
->
respDecode
=
(
notifiedFIFO_t
*
)
malloc
(
sizeof
(
notifiedFIFO_t
));
char
ul_pool
[]
=
"-1,-1,-1,-1,-1,-1,-1,-1
,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
"
;
char
ul_pool
[]
=
"-1,-1,-1,-1,-1,-1,-1,-1"
;
initTpool
(
ul_pool
,
gNB
->
threadPool
,
false
);
initNotifiedFIFO
(
gNB
->
respDecode
);
}
...
...
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