Commit f216d1ab authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

experiments: add support for disabling sync in switch

parent 50ed11f7
...@@ -41,6 +41,7 @@ for host_type in host_types: ...@@ -41,6 +41,7 @@ for host_type in host_types:
# host # host
if host_type == 'qemu': if host_type == 'qemu':
host_class = sim.QemuHost host_class = sim.QemuHost
net.sync = False
elif host_type == 'qt': elif host_type == 'qt':
def qemu_timing(): def qemu_timing():
h = sim.QemuHost() h = sim.QemuHost()
......
...@@ -255,9 +255,15 @@ class WireNet(NetSim): ...@@ -255,9 +255,15 @@ class WireNet(NetSim):
return cmd return cmd
class SwitchNet(NetSim): class SwitchNet(NetSim):
sync = True
def run_cmd(self, env): def run_cmd(self, env):
cmd = env.repodir + '/sims/net/switch/net_switch' cmd = env.repodir + '/sims/net/switch/net_switch'
cmd += f' -m {self.sync_mode} -S {self.sync_period} -E {self.eth_latency}' cmd += f' -m {self.sync_mode} -S {self.sync_period} -E {self.eth_latency}'
if not self.sync:
cmd += ' -u'
if len(env.pcap_file) > 0: if len(env.pcap_file) > 0:
cmd += ' -p ' + env.pcap_file cmd += ' -p ' + env.pcap_file
for n in self.nics: for n in self.nics:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment