From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH 1/2] Support assign vf mac address in scenario configuration
Date: Fri, 18 Sep 2015 22:39:07 +0800 [thread overview]
Message-ID: <1442587148-23698-1-git-send-email-yong.liu@intel.com> (raw)
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
next reply other threads:[~2015-09-18 14:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-18 14:39 Yong Liu [this message]
2015-09-18 14:39 ` [dts] [PATCH 2/2] Support VF mac address assign feature Yong Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1442587148-23698-1-git-send-email-yong.liu@intel.com \
--to=yong.liu@intel.com \
--cc=dts@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).