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
a562ca1b
Commit
a562ca1b
authored
10 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Move RT check into its own method, and save value.
parent
658761d9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mininet/node.py
+19
-10
19 additions, 10 deletions
mininet/node.py
with
19 additions
and
10 deletions
mininet/node.py
+
19
−
10
View file @
a562ca1b
...
...
@@ -166,7 +166,7 @@ def mountPrivateDirs( self ):
for
directory
in
self
.
privateDirs
:
if
isinstance
(
directory
,
tuple
):
# mount given private directory
privateDir
=
directory
[
1
]
%
self
.
__dict__
privateDir
=
directory
[
1
]
%
self
.
__dict__
mountPoint
=
directory
[
0
]
self
.
cmd
(
'
mkdir -p %s
'
%
privateDir
)
self
.
cmd
(
'
mkdir -p %s
'
%
mountPoint
)
...
...
@@ -174,7 +174,7 @@ def mountPrivateDirs( self ):
(
privateDir
,
mountPoint
)
)
else
:
# mount temporary filesystem on directory
self
.
cmd
(
'
mkdir -p %s
'
%
directory
)
self
.
cmd
(
'
mkdir -p %s
'
%
directory
)
self
.
cmd
(
'
mount -n -t tmpfs tmpfs %s
'
%
directory
)
def
unmountPrivateDirs
(
self
):
...
...
@@ -640,13 +640,9 @@ 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
if
sched
==
'
rt
'
:
self
.
checkRtGroupSched
()
self
.
rtprio
=
20
def
cgroupSet
(
self
,
param
,
value
,
resource
=
'
cpu
'
):
"
Set a cgroup parameter and return its value
"
...
...
@@ -710,6 +706,19 @@ def rtInfo( self, f ):
quota
=
int
(
self
.
period_us
*
f
)
return
pstr
,
qstr
,
self
.
period_us
,
quota
_rtGroupSched
=
False
# internal class var: Is CONFIG_RT_GROUP_SCHED set?
@classmethod
def
checkRtGroupSched
(
cls
):
"
Check (Ubuntu,Debian) kernel config for CONFIG_RT_GROUP_SCHED for RT
"
if
not
cls
.
_rtGroupSched
:
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
)
cls
.
_rtGroupSched
=
True
def
cfsInfo
(
self
,
f
):
"
Internal method: return parameters for CFS bandwidth
"
pstr
,
qstr
=
'
cfs_period_us
'
,
'
cfs_quota_us
'
...
...
@@ -1370,7 +1379,7 @@ def __init__( self, name, *ryuArgs, **kwargs ):
Controller
.
__init__
(
self
,
name
,
command
=
'
ryu-manager
'
,
cargs
=
'
--ofp-tcp-listen-port %s
'
+
cargs
=
'
--ofp-tcp-listen-port %s
'
+
'
'
.
join
(
ryuArgs
),
cdir
=
ryuCoreDir
,
**
kwargs
)
...
...
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