From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 22D19902 for ; Fri, 18 Sep 2015 16:39:15 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 18 Sep 2015 07:39:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,553,1437462000"; d="scan'208";a="792545679" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 18 Sep 2015 07:39:13 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t8IEdCFj007540; Fri, 18 Sep 2015 22:39:12 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t8IEd9Tf023734; Fri, 18 Sep 2015 22:39:12 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t8IEd96U023730; Fri, 18 Sep 2015 22:39:09 +0800 From: Yong Liu To: dts@dpdk.org Date: Fri, 18 Sep 2015 22:39:07 +0800 Message-Id: <1442587148-23698-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dts] [PATCH 1/2] Support assign vf mac address in scenario configuration X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2015 14:39:16 -0000 From: Marvin Liu Scenario module will call Netdevice module set_vf_mac_addr function to assign VF mac address. Signed-off-by: Marvin Liu 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