Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-AMF
Commits
45b9c888
Commit
45b9c888
authored
Feb 02, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove SCHED_PARAMS
parent
63a4dc20
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
65 deletions
+3
-65
src/amf-app/amf_config.cpp
src/amf-app/amf_config.cpp
+1
-61
src/amf-app/amf_config.hpp
src/amf-app/amf_config.hpp
+2
-4
No files found.
src/amf-app/amf_config.cpp
View file @
45b9c888
...
...
@@ -373,7 +373,7 @@ void amf_config::display() {
Logger
::
config
().
info
(
" ip ...................: %s"
,
inet_ntoa
(
n2
.
addr4
));
Logger
::
config
().
info
(
" port .................: %d"
,
n2
.
port
);
Logger
::
config
().
info
(
"-
N11
Networking:"
);
Logger
::
config
().
info
(
"-
SBI
Networking:"
);
Logger
::
config
().
info
(
" iface ................: %s"
,
n11
.
if_name
.
c_str
());
Logger
::
config
().
info
(
" ip ...................: %s"
,
inet_ntoa
(
n11
.
addr4
));
Logger
::
config
().
info
(
" port .................: %d"
,
n11
.
port
);
...
...
@@ -445,66 +445,6 @@ int amf_config::load_interface(
}
if_cfg
.
lookupValue
(
AMF_CONFIG_STRING_PORT
,
cfg
.
port
);
try
{
const
Setting
&
sched_params_cfg
=
if_cfg
[
AMF_CONFIG_STRING_SCHED_PARAMS
];
load_thread_sched_params
(
sched_params_cfg
,
cfg
.
thread_rd_sched_params
);
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
Logger
::
amf_app
().
error
(
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
}
}
return
RETURNok
;
}
//------------------------------------------------------------------------------
int
amf_config
::
load_thread_sched_params
(
const
Setting
&
thread_sched_params_cfg
,
util
::
thread_sched_params
&
cfg
)
{
try
{
thread_sched_params_cfg
.
lookupValue
(
AMF_CONFIG_STRING_THREAD_RD_CPU_ID
,
cfg
.
cpu_id
);
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
Logger
::
amf_app
().
info
(
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
}
try
{
std
::
string
thread_rd_sched_policy
;
thread_sched_params_cfg
.
lookupValue
(
AMF_CONFIG_STRING_THREAD_RD_SCHED_POLICY
,
thread_rd_sched_policy
);
util
::
trim
(
thread_rd_sched_policy
);
if
(
boost
::
iequals
(
thread_rd_sched_policy
,
"SCHED_OTHER"
))
{
cfg
.
sched_policy
=
SCHED_OTHER
;
}
else
if
(
boost
::
iequals
(
thread_rd_sched_policy
,
"SCHED_IDLE"
))
{
cfg
.
sched_policy
=
SCHED_IDLE
;
}
else
if
(
boost
::
iequals
(
thread_rd_sched_policy
,
"SCHED_BATCH"
))
{
cfg
.
sched_policy
=
SCHED_BATCH
;
}
else
if
(
boost
::
iequals
(
thread_rd_sched_policy
,
"SCHED_FIFO"
))
{
cfg
.
sched_policy
=
SCHED_FIFO
;
}
else
if
(
boost
::
iequals
(
thread_rd_sched_policy
,
"SCHED_RR"
))
{
cfg
.
sched_policy
=
SCHED_RR
;
}
else
{
Logger
::
amf_app
().
error
(
"thread_rd_sched_policy: %s, unknown in config file"
,
thread_rd_sched_policy
.
c_str
());
return
RETURNerror
;
}
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
Logger
::
amf_app
().
info
(
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
}
try
{
thread_sched_params_cfg
.
lookupValue
(
AMF_CONFIG_STRING_THREAD_RD_SCHED_PRIORITY
,
cfg
.
sched_priority
);
if
((
cfg
.
sched_priority
>
99
)
||
(
cfg
.
sched_priority
<
1
))
{
Logger
::
amf_app
().
error
(
"thread_rd_sched_priority: %d, must be in interval [1..99] in config "
"file"
,
cfg
.
sched_priority
);
return
RETURNerror
;
}
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
Logger
::
amf_app
().
info
(
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
}
return
RETURNok
;
}
...
...
src/amf-app/amf_config.hpp
View file @
45b9c888
...
...
@@ -116,7 +116,7 @@ typedef struct interface_cfg_s {
struct
in6_addr
addr6
;
unsigned
int
mtu
;
unsigned
int
port
;
util
::
thread_sched_params
thread_rd_sched_params
;
//
util::thread_sched_params thread_rd_sched_params;
}
interface_cfg_t
;
typedef
struct
itti_cfg_s
{
...
...
@@ -166,9 +166,7 @@ class amf_config {
~
amf_config
();
int
load
(
const
std
::
string
&
config_file
);
int
load_interface
(
const
Setting
&
if_cfg
,
interface_cfg_t
&
cfg
);
int
load_thread_sched_params
(
const
libconfig
::
Setting
&
thread_sched_params_cfg
,
util
::
thread_sched_params
&
cfg
);
void
display
();
unsigned
int
instance
;
std
::
string
pid_dir
;
...
...
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