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
32271a5b
Commit
32271a5b
authored
Sep 13, 2024
by
Hejing Li
Browse files
eth.py: nic constructor generates eth interface
parent
8a5e54cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
experiments/simbricks/orchestration/system/eth.py
experiments/simbricks/orchestration/system/eth.py
+1
-1
experiments/simbricks/orchestration/system/nic.py
experiments/simbricks/orchestration/system/nic.py
+1
-1
No files found.
experiments/simbricks/orchestration/system/eth.py
View file @
32271a5b
...
@@ -44,7 +44,7 @@ class EthSimpleNIC(base.Component):
...
@@ -44,7 +44,7 @@ class EthSimpleNIC(base.Component):
def
__init__
(
self
,
s
:
base
.
System
)
->
None
:
def
__init__
(
self
,
s
:
base
.
System
)
->
None
:
super
().
__init__
(
s
)
super
().
__init__
(
s
)
self
.
_ip
=
None
self
.
_ip
=
None
self
.
_eth_if
:
EthInterface
|
None
=
None
self
.
_eth_if
=
EthInterface
(
self
)
def
add_ipv4
(
self
,
ip
:
str
)
->
None
:
def
add_ipv4
(
self
,
ip
:
str
)
->
None
:
assert
self
.
_ip
is
None
assert
self
.
_ip
is
None
...
...
experiments/simbricks/orchestration/system/nic.py
View file @
32271a5b
...
@@ -30,7 +30,7 @@ class SimplePCIeNIC(pcie.PCIeSimpleDevice, eth.EthSimpleNIC):
...
@@ -30,7 +30,7 @@ class SimplePCIeNIC(pcie.PCIeSimpleDevice, eth.EthSimpleNIC):
super
().
__init__
(
s
)
super
().
__init__
(
s
)
def
interfaces
(
self
)
->
list
[
base
.
Interface
]:
def
interfaces
(
self
)
->
list
[
base
.
Interface
]:
return
[
self
.
pci_if
,
self
.
eth_if
]
return
[
self
.
_
pci_if
,
self
.
_
eth_if
]
def
add_if
(
self
,
interface
:
eth
.
EthInterface
|
pcie
.
PCIeDeviceInterface
)
->
None
:
def
add_if
(
self
,
interface
:
eth
.
EthInterface
|
pcie
.
PCIeDeviceInterface
)
->
None
:
match
interface
:
match
interface
:
...
...
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