Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
4e584719
Commit
4e584719
authored
Jun 20, 2024
by
Hejing Li
Committed by
Jonas Kaufmann
Aug 20, 2024
Browse files
simple_ping_sysconf.py: use LinuxHost and set driver as a list
parent
4b7d203d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
experiments/pyexps/simple_ping_sysconf.py
experiments/pyexps/simple_ping_sysconf.py
+4
-4
experiments/simbricks/splitsim/specification.py
experiments/simbricks/splitsim/specification.py
+5
-3
No files found.
experiments/pyexps/simple_ping_sysconf.py
View file @
4e584719
...
...
@@ -12,16 +12,16 @@ HOST0 -- NIC0 ------ SWITCH ------ NIC1 -- HOST1
system
=
spec
.
System
()
# create a host instance and a NIC instance then install the NIC on the host
host0
=
spec
.
Host
(
system
)
host0
=
spec
.
Linux
Host
(
system
)
nic0
=
spec
.
i40eNIC
(
system
)
host0
.
nic_driver
=
'i40e'
host0
.
nic_driver
=
[
'i40e'
]
host0
.
ip
=
'10.0.0.1'
pcichannel0
=
spec
.
PCI
(
system
)
pcichannel0
.
install
(
host0
,
nic0
)
host1
=
spec
.
Host
(
system
)
host1
=
spec
.
Linux
Host
(
system
)
nic1
=
spec
.
i40eNIC
(
system
)
host1
.
nic_driver
=
'i40e'
host1
.
nic_driver
=
[
'i40e'
]
host1
.
ip
=
'10.0.0.2'
pcichannel1
=
spec
.
PCI
(
system
)
pcichannel1
.
install
(
host1
,
nic1
)
...
...
experiments/simbricks/splitsim/specification.py
View file @
4e584719
...
...
@@ -13,6 +13,9 @@ class System():
self
.
pci_channels
:
tp
.
List
[
PCI
]
=
[]
self
.
eth_channels
:
tp
.
List
[
Eth
]
=
[]
class
SimObject
():
def
__init__
(
self
)
->
None
:
self
.
sync_period
=
500
#nano second
class
Channel
():
def
__init__
(
self
)
->
None
:
...
...
@@ -62,7 +65,7 @@ class Host():
self
.
sync
=
True
self
.
pci_channel
:
PCI
=
None
self
.
nics
:
tp
.
List
[
NIC
]
=
[]
self
.
nic_driver
=
'i40e'
self
.
nic_driver
=
[
'i40e'
]
self
.
sim
=
None
# HostSim & NodeConfig parameters
...
...
@@ -165,13 +168,12 @@ class LinuxHost(Host):
def
__init__
(
self
,
sys
)
->
None
:
super
().
__init__
(
sys
)
self
.
ifname
=
'eth0'
self
.
drivers
:
tp
.
List
[
str
]
=
[]
self
.
force_mac_addr
:
tp
.
Optional
[
str
]
=
None
def
prepare_post_cp
(
self
)
->
tp
.
List
[
str
]:
l
=
[]
for
d
in
self
.
driver
s
:
for
d
in
self
.
nic_
driver
:
if
d
[
0
]
==
'/'
:
l
.
append
(
'insmod '
+
d
)
else
:
...
...
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