[dts] [PATCH] Support specified dut ports map in virtual scenario

Yong Liu yong.liu at intel.com
Thu Jun 18 11:16:35 CEST 2015


From: Marvin Liu <yong.liu at intel.com>

Signed-off-by: Marvin Liu <yong.liu at 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



More information about the dts mailing list