From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id AF8E2A6A for ; Fri, 18 Sep 2015 16:39:29 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 18 Sep 2015 07:39:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,553,1437462000"; d="scan'208";a="564276373" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 18 Sep 2015 07:39:18 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t8IEdFCR007675; Fri, 18 Sep 2015 22:39:15 +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 t8IEdDBU023741; Fri, 18 Sep 2015 22:39:15 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t8IEdCZd023737; Fri, 18 Sep 2015 22:39:12 +0800 From: Yong Liu To: dts@dpdk.org Date: Fri, 18 Sep 2015 22:39:08 +0800 Message-Id: <1442587148-23698-2-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1442587148-23698-1-git-send-email-yong.liu@intel.com> References: <1442587148-23698-1-git-send-email-yong.liu@intel.com> Subject: [dts] [PATCH 2/2] Support VF mac address assign feature 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:30 -0000 From: Marvin Liu Assgin VF mac address when pf driver is default linux driver. Now not support other dirver yet. Signed-off-by: Marvin Liu diff --git a/framework/net_device.py b/framework/net_device.py index 9afa6ca..37495bd 100644 --- a/framework/net_device.py +++ b/framework/net_device.py @@ -198,6 +198,24 @@ class NetDevice(object): return match[0] @nic_has_driver + def set_vf_mac_addr(self, vf_idx=0, mac="00:00:00:00:00:01"): + """ + Set mac address of specified vf device. + """ + set_vf_mac_addr = getattr(self, 'set_vf_mac_addr_%s' % self.__get_os_type()) + out = set_vf_mac_addr(self.intf_name, vf_idx, mac) + + def set_vf_mac_addr_linux(self, intf, vf_idx, mac): + """ + Set mac address of specified vf device on linux. + """ + if self.current_driver != self.default_driver: + print "Only support when PF bound to default driver" + return + + self.__send_expect("ip link set %s vf %d mac %s" % (intf, vf_idx, mac), "# ") + + @nic_has_driver def get_mac_addr(self): """ Get mac address of specified pci device. -- 1.9.3