test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH 1/2] Support assign vf mac address in scenario configuration
@ 2015-09-18 14:39 Yong Liu
  2015-09-18 14:39 ` [dts] [PATCH 2/2] Support VF mac address assign feature Yong Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Yong Liu @ 2015-09-18 14:39 UTC (permalink / raw)
  To: dts

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

Scenario module will call Netdevice module set_vf_mac_addr function to assign VF mac address.

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/conf/scene/vf_passthrough.cfg b/conf/scene/vf_passthrough.cfg
index aa5493d..19f41c1 100644
--- a/conf/scene/vf_passthrough.cfg
+++ b/conf/scene/vf_passthrough.cfg
@@ -18,11 +18,13 @@ mem =
     size=2048,hugepage=no;
 disk =
     file=/storage/vm-image/vm0.img;
+login =
+    user=root,password=tester;
 dev_gen =
     pf_idx=0,vf_num=2,driver=default;
     pf_idx=1,vf_num=2,driver=default;
 device =
-    vf_idx=0,pf_dev=0,guestpci=auto;
-    vf_idx=0,pf_dev=1,guestpci=auto;
+    vf_idx=0,pf_dev=0,guestpci=auto,mac=00:00:00:00:01:01;
+    vf_idx=0,pf_dev=1,guestpci=auto,mac=00:00:00:00:01:02;
 vnc = 
     displayNum=1;
diff --git a/framework/virt_scene.py b/framework/virt_scene.py
index b201541..7eb475d 100644
--- a/framework/virt_scene.py
+++ b/framework/virt_scene.py
@@ -259,6 +259,7 @@ class VirtScene(object):
         # strip vf pci id
         if 'pf_dev' in param.keys():
             pf = int(param['pf_dev'])
+            pf_net = self.host_dut.ports_info[pf]['port']
             vfs = self.host_dut.ports_info[pf]['vfs_port']
             vf_idx = int(param['vf_idx'])
             if vf_idx >= len(vfs):
@@ -268,6 +269,8 @@ class VirtScene(object):
             vf_param['opt_host'] = vf_pci
             if param['guestpci'] != 'auto':
                 vf_param['opt_addr'] = param['guestpci']
+            if 'mac' in param.keys():
+                pf_net.set_vf_mac_addr(vf_idx, param['mac'])
         else:
             print dts.RED("Invalid vf device config, request pf_dev")
 
-- 
1.9.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-18 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-18 14:39 [dts] [PATCH 1/2] Support assign vf mac address in scenario configuration Yong Liu
2015-09-18 14:39 ` [dts] [PATCH 2/2] Support VF mac address assign feature 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).