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
09a90a48
Commit
09a90a48
authored
Oct 18, 2021
by
Melissa Elkadi
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/episys/master-nsa' into eurecom-episys-merge-nsa
parents
fe78d8a0
09e1b98f
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
50 additions
and
36 deletions
+50
-36
common/utils/utils.c
common/utils/utils.c
+32
-0
common/utils/utils.h
common/utils/utils.h
+1
-0
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+7
-0
nfapi/oai_integration/nfapi.c
nfapi/oai_integration/nfapi.c
+2
-8
nfapi/oai_integration/nfapi_pnf.c
nfapi/oai_integration/nfapi_pnf.c
+2
-7
targets/COMMON/create_tasks.c
targets/COMMON/create_tasks.c
+4
-3
targets/RT/USER/lte-softmodem.c
targets/RT/USER/lte-softmodem.c
+1
-9
targets/RT/USER/lte-uesoftmodem.c
targets/RT/USER/lte-uesoftmodem.c
+1
-9
No files found.
common/utils/utils.c
View file @
09a90a48
...
...
@@ -2,6 +2,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <sched.h>
#include <errno.h>
#include "utils.h"
void
*
calloc_or_fail
(
size_t
size
)
{
...
...
@@ -137,3 +140,32 @@ void *memcpy1(void *dst,const void *src,size_t n) {
asm
volatile
(
"rep movsb"
:
"+D"
(
dst
)
:
"c"
(
n
),
"S"
(
src
)
:
"cc"
,
"memory"
);
return
(
ret
);
}
void
set_priority
(
int
priority
)
{
/* When running with a realtime scheduler, a buggy run-away process can take
down the host requiring a reboot to recover. To avoid this scenario, we
use alarm(2) to set a maximum running time */
unsigned
max_runtime_seconds
=
10
*
60
;
/* default */
const
char
*
env
=
getenv
(
"MAX_RUNTIME_SECONDS"
);
if
(
env
!=
NULL
)
{
max_runtime_seconds
=
atoi
(
env
);
}
unsigned
was_alarm
=
alarm
(
max_runtime_seconds
);
/* Normally, was_alarm should be 0 indicating there was no previous alarm set.
A non-zero value could indicate a mistake */
fprintf
(
stderr
,
"Set alarm for %u seconds, was %u (see $MAX_RUNTIME_SECONDS)
\n
"
,
max_runtime_seconds
,
was_alarm
);
struct
sched_param
param
=
{
.
sched_priority
=
priority
,
};
fprintf
(
stderr
,
"Calling sched_setscheduler(%d)
\n
"
,
priority
);
if
(
sched_setscheduler
(
0
,
SCHED_RR
,
&
param
)
==
-
1
)
{
fprintf
(
stderr
,
"sched_setscheduler: %s
\n
"
,
strerror
(
errno
));
abort
();
}
}
common/utils/utils.h
View file @
09a90a48
...
...
@@ -19,6 +19,7 @@ int hex_string_to_hex_value (uint8_t *hex_value, const char *hex_string, int siz
void
*
memcpy1
(
void
*
dst
,
const
void
*
src
,
size_t
n
);
void
set_priority
(
int
priority
);
char
*
itoa
(
int
i
);
...
...
executables/nr-uesoftmodem.c
View file @
09a90a48
...
...
@@ -415,6 +415,13 @@ void *rrc_enb_process_msg(void *notUsed) {
int
main
(
int
argc
,
char
**
argv
)
{
set_priority
(
79
);
if
(
mlockall
(
MCL_CURRENT
|
MCL_FUTURE
)
==
-
1
)
{
fprintf
(
stderr
,
"mlockall: %s
\n
"
,
strerror
(
errno
));
return
EXIT_FAILURE
;
}
//uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2;
PHY_VARS_NR_UE
*
UE
[
MAX_NUM_CCs
];
start_background_system
();
...
...
nfapi/oai_integration/nfapi.c
View file @
09a90a48
...
...
@@ -40,15 +40,9 @@ typedef struct {
static
nfapi_params_t
nfapi_params
=
{
0
};
void
set_thread_priority
(
int
priority
)
{
//printf("%s(priority:%d)\n", __FUNCTION__, priority);
pthread_attr_t
ptAttr
;
struct
sched_param
schedParam
;
schedParam
.
__sched_priority
=
priority
;
//79;
if
(
sched_setscheduler
(
0
,
SCHED_RR
,
&
schedParam
)
!=
0
)
{
printf
(
"Failed to set scheduler to SCHED_RR
\n
"
);
}
set_priority
(
priority
);
pthread_attr_t
ptAttr
;
if
(
pthread_attr_setschedpolicy
(
&
ptAttr
,
SCHED_RR
)
!=
0
)
{
printf
(
"Failed to set pthread sched policy SCHED_RR
\n
"
);
}
...
...
nfapi/oai_integration/nfapi_pnf.c
View file @
09a90a48
...
...
@@ -218,14 +218,9 @@ void pnf_nfapi_trace(nfapi_trace_level_t nfapi_level, const char *message, ...)
}
void
pnf_set_thread_priority
(
int
priority
)
{
pthread_attr_t
ptAttr
;
struct
sched_param
schedParam
;
schedParam
.
__sched_priority
=
priority
;
if
(
sched_setscheduler
(
0
,
SCHED_RR
,
&
schedParam
)
!=
0
)
{
printf
(
"failed to set SCHED_RR
\n
"
);
}
set_priority
(
priority
);
pthread_attr_t
ptAttr
;
if
(
pthread_attr_setschedpolicy
(
&
ptAttr
,
SCHED_RR
)
!=
0
)
{
printf
(
"failed to set pthread SCHED_RR %d
\n
"
,
errno
);
}
...
...
targets/COMMON/create_tasks.c
View file @
09a90a48
...
...
@@ -61,9 +61,10 @@ int create_tasks(uint32_t enb_nb) {
rc
=
itti_create_task
(
TASK_RRC_ENB
,
rrc_enb_task
,
NULL
);
AssertFatal
(
rc
>=
0
,
"Create task for RRC eNB failed
\n
"
);
if
(
get_softmodem_params
()
->
nsa
||
(
EPC_MODE_ENABLED
&&
split73
!=
SPLIT73_DU
))
{
rc
=
itti_create_task
(
TASK_SCTP
,
sctp_eNB_task
,
NULL
);
AssertFatal
(
rc
>=
0
,
"Create task for SCTP failed
\n
"
);
}
if
(
EPC_MODE_ENABLED
&&
!
NODE_IS_DU
(
type
)
&&
!
(
split73
==
SPLIT73_DU
)
)
{
rc
=
itti_create_task
(
TASK_S1AP
,
s1ap_eNB_task
,
NULL
);
...
...
targets/RT/USER/lte-softmodem.c
View file @
09a90a48
...
...
@@ -524,15 +524,7 @@ static void wait_nfapi_init(char *thread_name) {
int
main
(
int
argc
,
char
**
argv
)
{
struct
sched_param
param
=
{
.
sched_priority
=
79
};
if
(
sched_setscheduler
(
0
,
SCHED_RR
,
&
param
)
==
-
1
)
{
fprintf
(
stderr
,
"sched_setscheduler: %s
\n
"
,
strerror
(
errno
));
return
EXIT_FAILURE
;
}
set_priority
(
79
);
if
(
mlockall
(
MCL_CURRENT
|
MCL_FUTURE
)
==
-
1
)
{
fprintf
(
stderr
,
"mlockall: %s
\n
"
,
strerror
(
errno
));
...
...
targets/RT/USER/lte-uesoftmodem.c
View file @
09a90a48
...
...
@@ -547,15 +547,7 @@ AssertFatal(false,"");
}
int
main
(
int
argc
,
char
**
argv
)
{
struct
sched_param
param
=
{
.
sched_priority
=
79
};
if
(
sched_setscheduler
(
0
,
SCHED_RR
,
&
param
)
==
-
1
)
{
fprintf
(
stderr
,
"sched_setscheduler: %s
\n
"
,
strerror
(
errno
));
return
EXIT_FAILURE
;
}
set_priority
(
79
);
if
(
mlockall
(
MCL_CURRENT
|
MCL_FUTURE
)
==
-
1
)
{
fprintf
(
stderr
,
"mlockall: %s
\n
"
,
strerror
(
errno
));
...
...
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