* [dts] [PATCH] Support specified dut ports map in virtual scenario
@ 2015-06-18 9:16 Yong Liu
0 siblings, 0 replies; only message in thread
From: Yong Liu @ 2015-06-18 9:16 UTC (permalink / raw)
To: dts
From: Marvin Liu <yong.liu@intel.com>
Signed-off-by: Marvin Liu <yong.liu@intel.com>
diff --git a/conf/ports.cfg b/conf/ports.cfg
index 43cab27..27ebfe0 100644
--- a/conf/ports.cfg
+++ b/conf/ports.cfg
@@ -4,8 +4,15 @@
# pci=Pci BDF,intf=Kernel interface;
# pci=Pci BDF,mac=Mac address,peer=Tester Pci BDF,numa=Port Numa
# pci=Pci BDF,peer=IXIA:card.port
+# [VM NAME] virtual machine name; This section is for virutal scenario
+# ports =
+# dev_idx=device index of ports info, peer=Tester Pci BDF
[DUT IP]
ports =
pci=XX:XX.X,intf=eth0;
pci=YY:YY.Y,mac=XX:XX:XX:XX:XX:XX,peer=ZZ:ZZ.Z,numa=0;
pci=ZZ:ZZ.Y,peer=IXIA:X.Y
+[VM NAME]
+ports =
+ dev_idx=0,peer=XX:XX.X;
+ dev_idx=1,peer=YY:YY.Y;
diff --git a/framework/config.py b/framework/config.py
index 5948edb..65cecd4 100644
--- a/framework/config.py
+++ b/framework/config.py
@@ -150,6 +150,14 @@ class PortConf(UserConf):
for config in confs:
port_param = self.port_conf.load_param(config)
+ # port config for vm in virtualization scenario
+ if 'dev_idx' in port_param:
+ keys = port_param.keys()
+ keys.remove('dev_idx')
+ self.ports_cfg[port_param['dev_idx']] = {
+ key: port_param[key] for key in keys}
+ continue
+
# check pci BDF validity
if 'pci' not in port_param:
print "NOT FOUND CONFIG FOR NO PCI ADDRESS!!!"
@@ -177,7 +185,6 @@ class PortConf(UserConf):
return False
-
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="Load DTS configuration files")
--
1.9.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-06-18 9:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-18 9:16 [dts] [PATCH] Support specified dut ports map in virtual scenario Yong Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).