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
Michael Black
OpenXG-RAN
Commits
9a91ed0e
Commit
9a91ed0e
authored
Mar 06, 2023
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
priorities/policy on usrp-tx-thread. Thread id for ru_thread
parent
d379bbae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
executables/nr-ru.c
executables/nr-ru.c
+2
-2
radio/USRP/USERSPACE/LIB/usrp_lib.cpp
radio/USRP/USERSPACE/LIB/usrp_lib.cpp
+30
-1
No files found.
executables/nr-ru.c
View file @
9a91ed0e
...
...
@@ -1083,7 +1083,7 @@ void *ru_thread( void *param ) {
ru_thread_status
=
0
;
// set default return value
sprintf
(
threadname
,
"ru_thread %u"
,
ru
->
idx
);
LOG_I
(
PHY
,
"Starting RU %d (%s,%s)
,
\n
"
,
ru
->
idx
,
NB_functions
[
ru
->
function
],
NB_timing
[
ru
->
if_timing
]
);
LOG_I
(
PHY
,
"Starting RU %d (%s,%s)
on core %d
\n
"
,
ru
->
idx
,
NB_functions
[
ru
->
function
],
NB_timing
[
ru
->
if_timing
],
sched_getcpu
()
);
memcpy
((
void
*
)
&
ru
->
config
,(
void
*
)
&
RC
.
gNB
[
0
]
->
gNB_config
,
sizeof
(
ru
->
config
));
if
(
emulate_rf
)
{
...
...
@@ -1342,7 +1342,7 @@ void init_RU_proc(RU_t *ru) {
pthread_mutex_init
(
&
proc
->
mutex_emulateRF
,
NULL
);
pthread_cond_init
(
&
proc
->
cond_emulateRF
,
NULL
);
threadCreate
(
&
proc
->
pthread_FH
,
ru_thread
,
(
void
*
)
ru
,
"ru_thread"
,
ru
->
tpcores
[
0
]
,
OAI_PRIORITY_RT_MAX
);
threadCreate
(
&
proc
->
pthread_FH
,
ru_thread
,
(
void
*
)
ru
,
"ru_thread"
,
-
1
/*ru->tpcores[0]*/
,
OAI_PRIORITY_RT_MAX
);
if
(
emulate_rf
)
threadCreate
(
&
proc
->
pthread_emulateRF
,
emulatedRF_thread
,
(
void
*
)
proc
,
"emulateRF"
,
-
1
,
OAI_PRIORITY_RT
);
...
...
radio/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
9a91ed0e
...
...
@@ -556,6 +556,7 @@ void *trx_usrp_write_thread(void * arg){
signed
char
last_packet
;
int
flags_gpio
;
printf
(
"trx_usrp_write_thread started on cpu %d
\n
"
,
sched_getcpu
());
while
(
1
){
pthread_mutex_lock
(
&
write_thread
->
mutex_write
);
while
(
write_thread
->
count_write
==
0
)
{
...
...
@@ -658,7 +659,35 @@ int trx_usrp_write_init(openair0_device *device){
printf
(
"end of tx write thread
\n
"
);
pthread_mutex_init
(
&
write_thread
->
mutex_write
,
NULL
);
pthread_cond_init
(
&
write_thread
->
cond_write
,
NULL
);
pthread_create
(
&
write_thread
->
pthread_write
,
NULL
,
trx_usrp_write_thread
,(
void
*
)
device
);
struct
sched_param
sparam
=
{
0
};
sparam
.
sched_priority
=
sched_get_priority_max
(
SCHED_RR
);
pthread_attr_t
attr
;
int
ret
=
pthread_attr_init
(
&
attr
);
if
(
ret
!=
0
)
{
printf
(
"error initializing USRP tx-thread attribute ret %d, errno: %d
\n
"
,
ret
,
errno
);
exit
(
-
1
);
}
else
printf
(
"USRP tx-thread attribute initialized
\n
"
);
ret
=
pthread_attr_setinheritsched
(
&
attr
,
PTHREAD_EXPLICIT_SCHED
);
if
(
ret
!=
0
)
{
printf
(
"error setting USRP tx-thread inheritance ret %d, errno: %d
\n
"
,
ret
,
errno
);
exit
(
-
1
);
}
else
printf
(
"USRP tx-thread inheritance set
\n
"
);
ret
=
pthread_attr_setschedpolicy
(
&
attr
,
SCHED_RR
);
if
(
ret
!=
0
)
{
printf
(
"error setting USRP tx-thread scheduling policy ret %d, errno: %d
\n
"
,
ret
,
errno
);
exit
(
-
1
);
}
else
printf
(
"USRP tx-thread scheduling policy set to SCHED_RR
\n
"
);
ret
=
pthread_attr_setschedparam
(
&
attr
,
&
sparam
);
if
(
ret
!=
0
)
{
printf
(
"error setting USRP tx-thread priority ret %d, errno: %d
\n
"
,
ret
,
errno
);
exit
(
-
1
);
}
else
printf
(
"USRP tx-thread priority set to %d
\n
"
,
sparam
.
sched_priority
);
pthread_create
(
&
write_thread
->
pthread_write
,
&
attr
,
trx_usrp_write_thread
,(
void
*
)
device
);
return
(
0
);
}
...
...
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