Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Elsa Gonsiorowski
codes
Commits
603bdbe3
Commit
603bdbe3
authored
Aug 11, 2014
by
Jonathan Jenkins
Browse files
Fix packet size determination when using prio scheduler
parent
28d58fe6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/models/networks/model-net/model-net-lp.c
View file @
603bdbe3
...
...
@@ -159,18 +159,6 @@ static void base_read_config(const char * anno, model_net_base_params *p){
p
->
sched_params
.
type
=
MN_SCHED_FCFS
;
}
if
(
p
->
sched_params
.
type
==
MN_SCHED_FCFS_FULL
){
// override packet size to something huge (leave a bit in the unlikely
// case that an op using packet size causes overflow)
packet_size
=
1ull
<<
62
;
}
else
if
(
!
packet_size
&&
p
->
sched_params
.
type
!=
MN_SCHED_FCFS_FULL
)
{
packet_size
=
512
;
fprintf
(
stderr
,
"Warning, no packet size specified, setting packet "
"size to %llu
\n
"
,
packet_size
);
}
// get scheduler-specific parameters
if
(
p
->
sched_params
.
type
==
MN_SCHED_PRIO
){
// prio scheduler uses default parameters
...
...
@@ -206,6 +194,23 @@ static void base_read_config(const char * anno, model_net_base_params *p){
}
}
if
(
p
->
sched_params
.
type
==
MN_SCHED_FCFS_FULL
||
(
p
->
sched_params
.
type
==
MN_SCHED_PRIO
&&
p
->
sched_params
.
u
.
prio
.
sub_stype
==
MN_SCHED_FCFS_FULL
)){
// override packet size to something huge (leave a bit in the unlikely
// case that an op using packet size causes overflow)
packet_size
=
1ull
<<
62
;
}
else
if
(
!
packet_size
&&
(
p
->
sched_params
.
type
!=
MN_SCHED_FCFS_FULL
||
(
p
->
sched_params
.
type
==
MN_SCHED_PRIO
&&
p
->
sched_params
.
u
.
prio
.
sub_stype
!=
MN_SCHED_FCFS_FULL
))){
packet_size
=
512
;
fprintf
(
stderr
,
"WARNING, no packet size specified, setting packet "
"size to %llu
\n
"
,
packet_size
);
}
p
->
packet_size
=
packet_size
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment