From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id BBEB11B1A3 for ; Thu, 21 Sep 2017 16:50:40 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Sep 2017 07:50:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,425,1500966000"; d="scan'208";a="902593275" Received: from yuweizh1-mobl2.ccr.corp.intel.com ([10.255.28.94]) by FMSMGA003.fm.intel.com with ESMTP; 21 Sep 2017 07:50:38 -0700 From: Yuwei Zhang To: dts@dpdk.org Cc: Yuwei Zhang Date: Thu, 21 Sep 2017 22:50:36 +0800 Message-Id: <20170921145036.1320-1-yuwei1.zhang@intel.com> X-Mailer: git-send-email 2.14.1.windows.1 Subject: [dts] [PATCH V1] add vfio-pci assign method to vf_packet_rxtx test suite 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: Thu, 21 Sep 2017 14:50:41 -0000 Signed-off-by: Yuwei Zhang --- conf/vf_packet_rxtx.cfg | 5 +++++ tests/TestSuite_vf_packet_rxtx.py | 21 +++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/conf/vf_packet_rxtx.cfg b/conf/vf_packet_rxtx.cfg index 20db90c..6eb9c40 100644 --- a/conf/vf_packet_rxtx.cfg +++ b/conf/vf_packet_rxtx.cfg @@ -122,3 +122,8 @@ vnc = displayNum=2; daemon = enable=yes; + +# suite conf +# vf_assign_method only support vfio-pci and pci-assign method for now +[suite] +vf_assign_method= \ No newline at end of file diff --git a/tests/TestSuite_vf_packet_rxtx.py b/tests/TestSuite_vf_packet_rxtx.py index 50451f6..d88506d 100644 --- a/tests/TestSuite_vf_packet_rxtx.py +++ b/tests/TestSuite_vf_packet_rxtx.py @@ -19,6 +19,19 @@ class TestVfPacketRxtx(TestCase): self.vm0 = None self.vm1 = None + suite_conf = SuiteConf('vf_packet_rxtx') + self.vf_assign_method = suite_conf.load_case_config()['vf_assign_method'] + if self.vf_assign_method.strip() == '': + self.vf_assign_method = 'pci-assign' + self.verify(self.vf_assign_method in ['pci-assign', 'vfio-pci'], + "not supported vf assign method") + if self.vf_assign_method == 'vfio-pci': + self.dut.send_expect('modprobe vfio', '#') + self.dut.send_expect('modprobe vfio-pci', '#') + self.vf_driver = 'vfio-pci' + else: + self.vf_driver = 'pci-stub' + def set_up(self): self.setup_2pf_2vf_1vm_env_flag = 0 @@ -37,10 +50,10 @@ class TestVfPacketRxtx(TestCase): try: for port in self.sriov_vfs_port_0: - port.bind_driver('pci-stub') + port.bind_driver(self.vf_driver) for port in self.sriov_vfs_port_1: - port.bind_driver('pci-stub') + port.bind_driver(self.vf_driver) time.sleep(1) vf0_prop = {'opt_host': self.sriov_vfs_port_0[0].pci} @@ -59,8 +72,8 @@ class TestVfPacketRxtx(TestCase): # set up VM0 ENV self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_packet_rxtx') - self.vm0.set_vm_device(driver='pci-assign', **vf0_prop) - self.vm0.set_vm_device(driver='pci-assign', **vf1_prop) + self.vm0.set_vm_device(driver=self.vf_assign_method, **vf0_prop) + self.vm0.set_vm_device(driver=self.vf_assign_method, **vf1_prop) self.vm_dut_0 = self.vm0.start() if self.vm_dut_0 is None: raise Exception("Set up VM0 ENV failed!") -- 2.14.1.windows.1