Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mininet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Olaf Bergmann
mininet
Commits
3e8df323
Commit
3e8df323
authored
10 years ago
by
Brian O'Connor
Browse files
Options
Downloads
Plain Diff
Merge pull request #374 from cdburkard/patches/rt
check if RT_GROUP_SCHED is enabled in kernel
parents
2c10a8e6
58324bdc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/limit.py
+11
-6
11 additions, 6 deletions
examples/limit.py
mininet/node.py
+6
-0
6 additions, 0 deletions
mininet/node.py
with
17 additions
and
6 deletions
examples/limit.py
+
11
−
6
View file @
3e8df323
...
...
@@ -8,15 +8,14 @@
from
mininet.link
import
TCIntf
from
mininet.node
import
CPULimitedHost
from
mininet.topolib
import
TreeTopo
from
mininet.util
import
custom
from
mininet.log
import
setLogLevel
from
mininet.util
import
custom
,
quietRun
from
mininet.log
import
setLogLevel
,
info
def
testLinkLimit
(
net
,
bw
):
"
Run bandwidth limit test
"
print
'
*** Testing network %.2f Mbps bandwidth limit
'
%
bw
net
.
iperf
(
)
info
(
'
*** Testing network %.2f Mbps bandwidth limit
\n
'
%
bw
)
net
.
iperf
()
def
limit
(
bw
=
10
,
cpu
=
.
1
):
"""
Example/test of link and CPU bandwidth limits
...
...
@@ -25,7 +24,13 @@ def limit( bw=10, cpu=.1 ):
intf
=
custom
(
TCIntf
,
bw
=
bw
)
myTopo
=
TreeTopo
(
depth
=
1
,
fanout
=
2
)
for
sched
in
'
rt
'
,
'
cfs
'
:
print
'
*** Testing with
'
,
sched
,
'
bandwidth limiting
'
info
(
'
*** Testing with
'
,
sched
,
'
bandwidth limiting
\n
'
)
if
sched
==
'
rt
'
:
release
=
quietRun
(
'
uname -r
'
).
strip
(
'
\r\n
'
)
output
=
quietRun
(
'
grep CONFIG_RT_GROUP_SCHED /boot/config-%s
'
%
release
)
if
output
==
'
# CONFIG_RT_GROUP_SCHED is not set
\n
'
:
info
(
'
*** RT Scheduler is not enabled in your kernel. Skipping this test
\n
'
)
continue
host
=
custom
(
CPULimitedHost
,
sched
=
sched
,
cpu
=
cpu
)
net
=
Mininet
(
topo
=
myTopo
,
intf
=
intf
,
host
=
host
)
net
.
start
()
...
...
This diff is collapsed.
Click to expand it.
mininet/node.py
+
6
−
0
View file @
3e8df323
...
...
@@ -617,6 +617,12 @@ def __init__( self, name, sched='cfs', **kwargs ):
# still does better with larger period values.
self
.
period_us
=
kwargs
.
get
(
'
period_us
'
,
100000
)
self
.
sched
=
sched
if
self
.
sched
==
'
rt
'
:
release
=
quietRun
(
'
uname -r
'
).
strip
(
'
\r\n
'
)
output
=
quietRun
(
'
grep CONFIG_RT_GROUP_SCHED /boot/config-%s
'
%
release
)
if
output
==
'
# CONFIG_RT_GROUP_SCHED is not set
\n
'
:
error
(
'
\n
*** error: please enable RT_GROUP_SCHED in your kernel
\n
'
)
exit
(
1
)
self
.
rtprio
=
20
def
cgroupSet
(
self
,
param
,
value
,
resource
=
'
cpu
'
):
...
...
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